Add git and borg containers
This commit is contained in:
parent
5fb373088d
commit
6620a988cd
26
hosts/hera/borg.nix
Normal file
26
hosts/hera/borg.nix
Normal 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
35
hosts/hera/git.nix
Normal 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;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue