mirror of
https://github.com/kmein/niveum
synced 2026-03-16 18:21:07 +01:00
feat: manage retiolum addresses globally, declaratively share moodle
This commit is contained in:
@@ -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 <niveum/lib>).retiolumAddresses; [kabsa manakish]; in ''
|
||||
/export ${lib.concatMapStringsSep " " (machine: "${machine.ipv4}(fsid=0)") machines}
|
||||
/export/moodle ${lib.concatMapStringsSep " " (machine: "${machine.ipv4}(insecure,rw)") machines}
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
||||
@@ -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";
|
||||
|
||||
21
lib/retiolum-network.nix
Normal file
21
lib/retiolum-network.nix
Normal 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";
|
||||
};
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
let
|
||||
nixpkgs-unstable = import <nixpkgs-unstable> { config.allowUnfree = true; };
|
||||
inherit (import <niveum/lib>) 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";
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{ lib, config, pkgs, ... }:
|
||||
let
|
||||
inherit (import <niveum/lib>) kieran;
|
||||
inherit (import <niveum/lib>) 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 <system-secrets/retiolum.key>;
|
||||
|
||||
@@ -3,6 +3,9 @@
|
||||
# and in the NixOS manual (accessible by running ‘nixos-help’).
|
||||
|
||||
{ config, pkgs, ... }:
|
||||
let
|
||||
inherit (import <niveum/lib>) 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";
|
||||
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
let
|
||||
inherit (import <niveum/lib>) 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";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user