diff --git a/configs/moodle-dl/meinhark.nix b/configs/moodle-dl/meinhark.nix index f51a051..c6bc4b1 100644 --- a/configs/moodle-dl/meinhark.nix +++ b/configs/moodle-dl/meinhark.nix @@ -65,9 +65,9 @@ in services.nfs.server = { enable = true; - exports = '' - /export 10.243.2.4(fsid=0) 10.243.2.85(fsid=0) - /export/moodle 10.243.2.4(insecure,rw) 10.243.2.85(insecure,rw) + exports = let machines = with (import ).retiolumAddresses; [kabsa manakish]; in '' + /export ${lib.concatMapStringsSep " " (machine: "${machine.ipv4}(fsid=0)") machines} + /export/moodle ${lib.concatMapStringsSep " " (machine: "${machine.ipv4}(insecure,rw)") machines} ''; }; } diff --git a/lib/default.nix b/lib/default.nix index 98060cd..7f327bf 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -34,6 +34,8 @@ rec { defaultApplications = import ./default-applications.nix; + retiolumAddresses = import ./retiolum-network.nix; + localAddresses = import ./local-network.nix; email-sshKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINKz33wHtPuIfgXEb0+hybxFGV9ZuPsDTLUZo/+hlcdA"; diff --git a/lib/retiolum-network.nix b/lib/retiolum-network.nix new file mode 100644 index 0000000..e1eb846 --- /dev/null +++ b/lib/retiolum-network.nix @@ -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"; + }; +} diff --git a/systems/kabsa/configuration.nix b/systems/kabsa/configuration.nix index 44dfdf0..42dc0cf 100644 --- a/systems/kabsa/configuration.nix +++ b/systems/kabsa/configuration.nix @@ -1,6 +1,7 @@ { config, pkgs, lib, ... }: let nixpkgs-unstable = import { config.allowUnfree = true; }; + inherit (import ) retiolumAddresses; in { imports = [ @@ -39,10 +40,7 @@ in networking.wireless.interfaces = [ "wlp3s0" ]; - networking.retiolum = { - ipv4 = "10.243.2.4"; - ipv6 = "42:0:3c46:861f:a118:8e9a:82c9:3d"; - }; + networking.retiolum = retiolumAddresses.kabsa; system.stateVersion = "19.03"; } diff --git a/systems/makanek/configuration.nix b/systems/makanek/configuration.nix index 6e2ca45..2d68fe0 100644 --- a/systems/makanek/configuration.nix +++ b/systems/makanek/configuration.nix @@ -1,6 +1,6 @@ { lib, config, pkgs, ... }: let - inherit (import ) kieran; + inherit (import ) kieran retiolumAddresses; in { imports = [ @@ -87,10 +87,7 @@ in services.openssh.enable = true; - networking.retiolum = { - ipv4 = "10.243.2.84"; - ipv6 = "42:0:3c46:f7a9:1f0a:1b2b:822a:6050"; - }; + networking.retiolum = retiolumAddresses.makanek; environment.etc."tinc/retiolum/rsa_key.priv" = { text = builtins.readFile ; diff --git a/systems/manakish/configuration.nix b/systems/manakish/configuration.nix index e5f312f..a519e91 100644 --- a/systems/manakish/configuration.nix +++ b/systems/manakish/configuration.nix @@ -3,6 +3,9 @@ # and in the NixOS manual (accessible by running ‘nixos-help’). { config, pkgs, ... }: +let + inherit (import ) retiolumAddresses; +in { imports = [ # Include the results of the hardware scan. ./hardware-configuration.nix @@ -45,10 +48,7 @@ git vim ]; - networking.retiolum = { - ipv4 = "10.243.2.85"; - ipv6 = "42:0:3c46:ac99:ae36:cb8:c551:ba27"; - }; + networking.retiolum = retiolumAddresses.manakish; networking.hostName = "manakish"; diff --git a/systems/zaatar/configuration.nix b/systems/zaatar/configuration.nix index 70df560..36ae0df 100644 --- a/systems/zaatar/configuration.nix +++ b/systems/zaatar/configuration.nix @@ -1,4 +1,7 @@ { config, pkgs, lib, ... }: +let + inherit (import ) retiolumAddresses; +in { imports = [ ./hardware-configuration.nix @@ -117,10 +120,7 @@ networking.hostName = "zaatar"; networking.wireless.interfaces = [ "wlp2s0" ]; - networking.retiolum = { - ipv4 = "10.243.2.34"; - ipv6 = "42:0:3c46:156e:10b6:3bd6:6e82:b2cd"; - }; + networking.retiolum = retiolumAddresses.zaatar; system.stateVersion = "20.09"; }