1
0
Fork 0

Add git and borg containers

This commit is contained in:
Malte Brandy 2018-06-09 02:41:51 +02:00
parent 5fb373088d
commit 6620a988cd
2 changed files with 61 additions and 0 deletions

26
hosts/hera/borg.nix Normal file
View file

@ -0,0 +1,26 @@
{ config, ... }:
let
me = config.m-0.private.me;
in {
containers.borg = {
autoStart = true;
privateNetwork = true;
hostBridge = "bridge";
config = { pkgs, ... }: {
imports = [../../system];
networking = {
interfaces.eth0 = {
ipv6.addresses = [{ address = config.m-0.hosts.borg; prefixLength = 64; }];
};
inherit (config.networking) nameservers;
defaultGateway6 = { address = config.m-0.hosts.hera-intern; interface = "eth0"; };
};
services.borgbackup.repos.backups = {
authorizedKeys = me.keys;
quota = "150G";
};
};
};
}

35
hosts/hera/git.nix Normal file
View file

@ -0,0 +1,35 @@
{ config, ... }:
let
me = config.m-0.private.me;
in {
containers.git = {
autoStart = true;
privateNetwork = true;
bindMounts = {
"/home/git" = { hostPath = "/home/maralorn/data/git"; isReadOnly = false; };
};
hostBridge = "bridge";
config = { pkgs, ... }: {
imports = [../../system];
users.users.git = {
isNormalUser = true;
uid = 1000;
openssh.authorizedKeys.keys = me.keys;
};
networking = {
interfaces.eth0 = {
ipv6.addresses = [{ address = config.m-0.hosts.git; prefixLength = 64; }];
};
inherit (config.networking) nameservers;
defaultGateway6 = { address = config.m-0.hosts.hera-intern; interface = "eth0"; };
};
environment.systemPackages = [ pkgs.git ];
services = {
sshd.enable = true;
};
};
};
}