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

feat: manage retiolum addresses globally, declaratively share moodle

This commit is contained in:
2021-10-12 11:51:55 +02:00
parent 6119c0dbcc
commit c50698f275
7 changed files with 38 additions and 20 deletions

View File

@@ -65,9 +65,9 @@ in
services.nfs.server = { services.nfs.server = {
enable = true; enable = true;
exports = '' exports = let machines = with (import <niveum/lib>).retiolumAddresses; [kabsa manakish]; in ''
/export 10.243.2.4(fsid=0) 10.243.2.85(fsid=0) /export ${lib.concatMapStringsSep " " (machine: "${machine.ipv4}(fsid=0)") machines}
/export/moodle 10.243.2.4(insecure,rw) 10.243.2.85(insecure,rw) /export/moodle ${lib.concatMapStringsSep " " (machine: "${machine.ipv4}(insecure,rw)") machines}
''; '';
}; };
} }

View File

@@ -34,6 +34,8 @@ rec {
defaultApplications = import ./default-applications.nix; defaultApplications = import ./default-applications.nix;
retiolumAddresses = import ./retiolum-network.nix;
localAddresses = import ./local-network.nix; localAddresses = import ./local-network.nix;
email-sshKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINKz33wHtPuIfgXEb0+hybxFGV9ZuPsDTLUZo/+hlcdA"; email-sshKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINKz33wHtPuIfgXEb0+hybxFGV9ZuPsDTLUZo/+hlcdA";

21
lib/retiolum-network.nix Normal file
View File

@@ -0,0 +1,21 @@
{
kabsa = {
ipv4 = "10.243.2.4";
ipv6 = "42:0:3c46:861f:a118:8e9a:82c9:3d";
};
zaatar = {
ipv4 = "10.243.2.34";
ipv6 = "42:0:3c46:156e:10b6:3bd6:6e82:b2cd";
};
makanek = {
ipv4 = "10.243.2.84";
ipv6 = "42:0:3c46:f7a9:1f0a:1b2b:822a:6050";
};
manakish = {
ipv4 = "10.243.2.85";
ipv6 = "42:0:3c46:ac99:ae36:cb8:c551:ba27";
};
}

View File

@@ -1,6 +1,7 @@
{ config, pkgs, lib, ... }: { config, pkgs, lib, ... }:
let let
nixpkgs-unstable = import <nixpkgs-unstable> { config.allowUnfree = true; }; nixpkgs-unstable = import <nixpkgs-unstable> { config.allowUnfree = true; };
inherit (import <niveum/lib>) retiolumAddresses;
in in
{ {
imports = [ imports = [
@@ -39,10 +40,7 @@ in
networking.wireless.interfaces = [ "wlp3s0" ]; networking.wireless.interfaces = [ "wlp3s0" ];
networking.retiolum = { networking.retiolum = retiolumAddresses.kabsa;
ipv4 = "10.243.2.4";
ipv6 = "42:0:3c46:861f:a118:8e9a:82c9:3d";
};
system.stateVersion = "19.03"; system.stateVersion = "19.03";
} }

View File

@@ -1,6 +1,6 @@
{ lib, config, pkgs, ... }: { lib, config, pkgs, ... }:
let let
inherit (import <niveum/lib>) kieran; inherit (import <niveum/lib>) kieran retiolumAddresses;
in in
{ {
imports = [ imports = [
@@ -87,10 +87,7 @@ in
services.openssh.enable = true; services.openssh.enable = true;
networking.retiolum = { networking.retiolum = retiolumAddresses.makanek;
ipv4 = "10.243.2.84";
ipv6 = "42:0:3c46:f7a9:1f0a:1b2b:822a:6050";
};
environment.etc."tinc/retiolum/rsa_key.priv" = { environment.etc."tinc/retiolum/rsa_key.priv" = {
text = builtins.readFile <system-secrets/retiolum.key>; text = builtins.readFile <system-secrets/retiolum.key>;

View File

@@ -3,6 +3,9 @@
# and in the NixOS manual (accessible by running nixos-help). # and in the NixOS manual (accessible by running nixos-help).
{ config, pkgs, ... }: { config, pkgs, ... }:
let
inherit (import <niveum/lib>) retiolumAddresses;
in
{ {
imports = [ # Include the results of the hardware scan. imports = [ # Include the results of the hardware scan.
./hardware-configuration.nix ./hardware-configuration.nix
@@ -45,10 +48,7 @@
git vim git vim
]; ];
networking.retiolum = { networking.retiolum = retiolumAddresses.manakish;
ipv4 = "10.243.2.85";
ipv6 = "42:0:3c46:ac99:ae36:cb8:c551:ba27";
};
networking.hostName = "manakish"; networking.hostName = "manakish";

View File

@@ -1,4 +1,7 @@
{ config, pkgs, lib, ... }: { config, pkgs, lib, ... }:
let
inherit (import <niveum/lib>) retiolumAddresses;
in
{ {
imports = [ imports = [
./hardware-configuration.nix ./hardware-configuration.nix
@@ -117,10 +120,7 @@
networking.hostName = "zaatar"; networking.hostName = "zaatar";
networking.wireless.interfaces = [ "wlp2s0" ]; networking.wireless.interfaces = [ "wlp2s0" ];
networking.retiolum = { networking.retiolum = retiolumAddresses.zaatar;
ipv4 = "10.243.2.34";
ipv6 = "42:0:3c46:156e:10b6:3bd6:6e82:b2cd";
};
system.stateVersion = "20.09"; system.stateVersion = "20.09";
} }