diff --git a/.versions/stockholm.json b/.versions/stockholm.json index b602bef..97ec3d7 100644 --- a/.versions/stockholm.json +++ b/.versions/stockholm.json @@ -1,9 +1,9 @@ { "url": "https://cgit.krebsco.de/stockholm", - "rev": "b034f63f7a2e4361b32c33c0e1a980eecf1a5aa6", - "date": "2020-10-17T01:00:54+02:00", - "path": "/nix/store/1lh7aw8x93856fni7sih4shlyyd7cxik-stockholm", - "sha256": "1ji45h7xp3za5lq9qdg3f8gldrvqfpr8grinblzvf9iqxjgidr68", + "rev": "a85b25865a5b4aade9e3ec97871f3e3d553199d6", + "date": "2020-11-10T21:07:09+01:00", + "path": "/nix/store/4n7vv3clsld151pyzjda0xrwxqsqmrcp-stockholm", + "sha256": "117n7a0094n02li325qlv2ly6v4pa186gfbvrw1plyjsl0r85i0f", "fetchSubmodules": false, "deepClone": false, "leaveDotGit": false diff --git a/configs/ssh.nix b/configs/ssh.nix index 2aef020..6897b4b 100644 --- a/configs/ssh.nix +++ b/configs/ssh.nix @@ -16,7 +16,7 @@ in { port = 443; }; zaatar = { - hostname = "zaatar.local"; + hostname = "zaatar.r"; user = "root"; port = sshPort; }; diff --git a/deploy.nix b/deploy.nix index 1d553a1..a4fa9b9 100644 --- a/deploy.nix +++ b/deploy.nix @@ -38,7 +38,7 @@ in { zaatar = writeDeploy "deploy-zaatar" (regularSystem { path = systems/zaatar; name = "zaatar"; - address = "192.168.178.21"; + address = "zaatar.r"; }); wilde = writeDeploy "deploy-wilde" (regularSystem { path = systems/wilde; diff --git a/modules/retiolum.nix b/modules/retiolum.nix index 08d183d..646f750 100644 --- a/modules/retiolum.nix +++ b/modules/retiolum.nix @@ -1,17 +1,18 @@ { config, pkgs, lib, ... }: - with lib; - let + stockholm-systems = + let systemsDir = + "/krebs/1systems"; + in genAttrs + (attrNames (filterAttrs (_: value: value == "directory") (builtins.readDir systemsDir))) + (name: import { + configuration = import (systemsDir + "/${name}/config.nix"); + }); + + hostsPackage = stockholm-systems.filebitch.config.krebs.tinc.retiolum.hostsPackage; + netname = "retiolum"; cfg = config.networking.retiolum; - - retiolum = pkgs.fetchFromGitHub { - owner = "krebs"; - repo = netname; - rev = "76e8de36d4ac06bcfaf551946aa2f6a41d9e6555"; - sha256 = "0yhmmvg6gm5yxs1gzszl19bs6y302yjg81a7sckfglwzcql3q0wf"; - }; in { options = { networking.retiolum.ipv4 = mkOption { @@ -44,13 +45,20 @@ in { AutoConnect = yes ''; }; + + # environment.etc."tinc/retiolum".source = hostsPackage; + systemd.services."tinc.${netname}" = { preStart = '' - cp -R ${toString } /etc/tinc/retiolum/ || true + set -eu + + mkdir -p /etc/tinc/${netname}/hosts/ + cp ${hostsPackage}/* /etc/tinc/${netname}/hosts/ ''; }; networking.extraHosts = + # TODO generate from stockholm builtins.readFile (toString ); environment.systemPackages =