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:
@@ -1,9 +1,9 @@
|
|||||||
{
|
{
|
||||||
"url": "https://cgit.krebsco.de/stockholm",
|
"url": "https://cgit.krebsco.de/stockholm",
|
||||||
"rev": "b034f63f7a2e4361b32c33c0e1a980eecf1a5aa6",
|
"rev": "a85b25865a5b4aade9e3ec97871f3e3d553199d6",
|
||||||
"date": "2020-10-17T01:00:54+02:00",
|
"date": "2020-11-10T21:07:09+01:00",
|
||||||
"path": "/nix/store/1lh7aw8x93856fni7sih4shlyyd7cxik-stockholm",
|
"path": "/nix/store/4n7vv3clsld151pyzjda0xrwxqsqmrcp-stockholm",
|
||||||
"sha256": "1ji45h7xp3za5lq9qdg3f8gldrvqfpr8grinblzvf9iqxjgidr68",
|
"sha256": "117n7a0094n02li325qlv2ly6v4pa186gfbvrw1plyjsl0r85i0f",
|
||||||
"fetchSubmodules": false,
|
"fetchSubmodules": false,
|
||||||
"deepClone": false,
|
"deepClone": false,
|
||||||
"leaveDotGit": false
|
"leaveDotGit": false
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ in {
|
|||||||
port = 443;
|
port = 443;
|
||||||
};
|
};
|
||||||
zaatar = {
|
zaatar = {
|
||||||
hostname = "zaatar.local";
|
hostname = "zaatar.r";
|
||||||
user = "root";
|
user = "root";
|
||||||
port = sshPort;
|
port = sshPort;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ in {
|
|||||||
zaatar = writeDeploy "deploy-zaatar" (regularSystem {
|
zaatar = writeDeploy "deploy-zaatar" (regularSystem {
|
||||||
path = systems/zaatar;
|
path = systems/zaatar;
|
||||||
name = "zaatar";
|
name = "zaatar";
|
||||||
address = "192.168.178.21";
|
address = "zaatar.r";
|
||||||
});
|
});
|
||||||
wilde = writeDeploy "deploy-wilde" (regularSystem {
|
wilde = writeDeploy "deploy-wilde" (regularSystem {
|
||||||
path = systems/wilde;
|
path = systems/wilde;
|
||||||
|
|||||||
@@ -1,17 +1,18 @@
|
|||||||
{ config, pkgs, lib, ... }:
|
{ config, pkgs, lib, ... }:
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
let
|
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";
|
netname = "retiolum";
|
||||||
cfg = config.networking.retiolum;
|
cfg = config.networking.retiolum;
|
||||||
|
|
||||||
retiolum = pkgs.fetchFromGitHub {
|
|
||||||
owner = "krebs";
|
|
||||||
repo = netname;
|
|
||||||
rev = "76e8de36d4ac06bcfaf551946aa2f6a41d9e6555";
|
|
||||||
sha256 = "0yhmmvg6gm5yxs1gzszl19bs6y302yjg81a7sckfglwzcql3q0wf";
|
|
||||||
};
|
|
||||||
in {
|
in {
|
||||||
options = {
|
options = {
|
||||||
networking.retiolum.ipv4 = mkOption {
|
networking.retiolum.ipv4 = mkOption {
|
||||||
@@ -44,13 +45,20 @@ in {
|
|||||||
AutoConnect = yes
|
AutoConnect = yes
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# environment.etc."tinc/retiolum".source = hostsPackage;
|
||||||
|
|
||||||
systemd.services."tinc.${netname}" = {
|
systemd.services."tinc.${netname}" = {
|
||||||
preStart = ''
|
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 =
|
networking.extraHosts =
|
||||||
|
# TODO generate from stockholm
|
||||||
builtins.readFile (toString <retiolum/etc.hosts>);
|
builtins.readFile (toString <retiolum/etc.hosts>);
|
||||||
|
|
||||||
environment.systemPackages =
|
environment.systemPackages =
|
||||||
|
|||||||
Reference in New Issue
Block a user