yggdrasil-hq: fix, enable for server7
This commit is contained in:
parent
dce1a251ce
commit
45c65cbac5
|
@ -7,7 +7,6 @@
|
|||
../../lib/emery.nix
|
||||
./containers
|
||||
./hardware-configuration.nix
|
||||
./yggdrasil-prefix.nix
|
||||
./hydra.nix
|
||||
./nix-serve.nix
|
||||
];
|
||||
|
@ -50,6 +49,10 @@
|
|||
enp2s0f1.useDHCP = false;
|
||||
};
|
||||
};
|
||||
hq.yggdrasil = {
|
||||
enable = true;
|
||||
interface = "br0";
|
||||
};
|
||||
|
||||
environment.systemPackages = with pkgs; [ tmux htop vim gitMinimal nixfmt ];
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
{
|
||||
imports = [
|
||||
../../../../lib/yggdrasil-hq.nix
|
||||
../../../../lib/hq.nix
|
||||
];
|
||||
|
||||
services.uhub = {
|
||||
|
|
|
@ -4,8 +4,7 @@
|
|||
imports = [
|
||||
<nixpkgs/nixos/modules/profiles/minimal.nix>
|
||||
../../../../lib/hq.nix
|
||||
../../../../lib/yggdrasil.nix
|
||||
./yggdrasil-prefix.nix
|
||||
../../../../lib/yggdrasil-service.nix
|
||||
];
|
||||
|
||||
networking.interfaces.eth0 = {
|
||||
|
|
|
@ -18,5 +18,10 @@ in {
|
|||
];
|
||||
};
|
||||
|
||||
# Please import only things that are configurable and OFF BY DEFAULT!
|
||||
imports = [
|
||||
./yggdrasil-hq.nix
|
||||
];
|
||||
|
||||
users.motd = builtins.readFile ./motd;
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@ with lib;
|
|||
|
||||
let
|
||||
cfg = config.hq.yggdrasil;
|
||||
hostNameHash = hashString "sha256" config.networking.hostName;
|
||||
hostNameHash = builtins.hashString "sha256" config.networking.hostName;
|
||||
hextets = map (i: substring (4 * i) (4 * (i + 1)) hostNameHash) [ 0 1 2 3 ];
|
||||
hostAddr = concatStringsSep ":" hextets;
|
||||
in {
|
||||
|
@ -22,16 +22,18 @@ in {
|
|||
|
||||
config = mkIf cfg.enable {
|
||||
networking.interfaces = {
|
||||
"${cfg.interface}.ipv6" = {
|
||||
addresses = [{
|
||||
address = "310:5217:69c0:9afc:${hostAddr}";
|
||||
prefixLength = 64;
|
||||
}];
|
||||
routes = [{
|
||||
address = "200::";
|
||||
prefixLength = 7;
|
||||
via = "310:5217:69c0:9afc::1";
|
||||
}];
|
||||
"${cfg.interface}" = {
|
||||
"ipv6" = {
|
||||
addresses = [{
|
||||
address = "310:5217:69c0:9afc:${hostAddr}";
|
||||
prefixLength = 64;
|
||||
}];
|
||||
routes = [{
|
||||
address = "200::";
|
||||
prefixLength = 7;
|
||||
via = "310:5217:69c0:9afc::1";
|
||||
}];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue