1
0
mirror of https://github.com/kmein/niveum synced 2026-03-16 10:11:08 +01:00

feat(retiolum): generate hosts from stockholm, finally add zaatar

This commit is contained in:
2020-11-10 22:17:33 +01:00
parent 8cda7861f9
commit 218c251d31
4 changed files with 24 additions and 16 deletions

View File

@@ -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

View File

@@ -16,7 +16,7 @@ in {
port = 443;
};
zaatar = {
hostname = "zaatar.local";
hostname = "zaatar.r";
user = "root";
port = sshPort;
};

View File

@@ -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;

View File

@@ -1,17 +1,18 @@
{ config, pkgs, lib, ... }:
with lib;
let
stockholm-systems =
let systemsDir = <stockholm> + "/krebs/1systems";
in genAttrs
(attrNames (filterAttrs (_: value: value == "directory") (builtins.readDir systemsDir)))
(name: import <nixpkgs/nixos> {
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 <retiolum/hosts>} /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 <retiolum/etc.hosts>);
environment.systemPackages =