forked from Fachschaft/nixConfig
Compare commits
3 commits
354488c38d
...
dcc055891f
Author | SHA1 | Date | |
---|---|---|---|
dcc055891f | |||
93644c4dd1 | |||
8625b9a307 |
5 changed files with 34 additions and 52 deletions
|
@ -4,7 +4,7 @@
|
||||||
../../modules/jitsi.nix
|
../../modules/jitsi.nix
|
||||||
../../roles
|
../../roles
|
||||||
../../roles/vm.nix
|
../../roles/vm.nix
|
||||||
../../modules/vmNetwork.nix
|
./network.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
services.mathebau-jitsi = {
|
services.mathebau-jitsi = {
|
||||||
|
@ -14,6 +14,5 @@
|
||||||
|
|
||||||
# System configuration here
|
# System configuration here
|
||||||
networking.hostName = "ghatanothoa";
|
networking.hostName = "ghatanothoa";
|
||||||
vmNetwork.ipv4 = "192.168.0.25";
|
|
||||||
system.stateVersion = "23.11";
|
system.stateVersion = "23.11";
|
||||||
}
|
}
|
||||||
|
|
16
nixos/machines/ghatanothoa/network.nix
Normal file
16
nixos/machines/ghatanothoa/network.nix
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
# We sohuld put that config somewhere in roles and give it a parameter or something,
|
||||||
|
# everyone gets the same nameserver and the same prefixLength and address vs defaultGateway alsways
|
||||||
|
# depend on the same thing
|
||||||
|
{
|
||||||
|
imports = [];
|
||||||
|
networking = {
|
||||||
|
interfaces.enX0.ipv4.addresses = [
|
||||||
|
{
|
||||||
|
address = "192.168.0.25";
|
||||||
|
prefixLength = 16;
|
||||||
|
}
|
||||||
|
];
|
||||||
|
defaultGateway = "192.168.0.152";
|
||||||
|
nameservers = ["130.83.2.22" "130.83.56.60" "130.83.22.60" "130.82.22.63"];
|
||||||
|
};
|
||||||
|
}
|
|
@ -4,7 +4,7 @@
|
||||||
../../modules/mailman.nix
|
../../modules/mailman.nix
|
||||||
../../roles
|
../../roles
|
||||||
../../roles/vm.nix
|
../../roles/vm.nix
|
||||||
../../modules/vmNetwork.nix
|
./network.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
# System configuration here
|
# System configuration here
|
||||||
|
@ -16,7 +16,6 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
networking.hostName = "lobon";
|
networking.hostName = "lobon";
|
||||||
vmNetwork.ipv4 = "192.168.0.22";
|
|
||||||
system.stateVersion = "23.11";
|
system.stateVersion = "23.11";
|
||||||
|
|
||||||
sops.secrets = {
|
sops.secrets = {
|
||||||
|
|
16
nixos/machines/lobon/network.nix
Normal file
16
nixos/machines/lobon/network.nix
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
# We sohuld put that config somewhere in roles and give it a parameter or something,
|
||||||
|
# everyone gets the same nameserver and the same prefixLength and address vs defaultGateway alsways
|
||||||
|
# depend on the same thing
|
||||||
|
{
|
||||||
|
imports = [];
|
||||||
|
networking = {
|
||||||
|
interfaces.enX0.ipv4.addresses = [
|
||||||
|
{
|
||||||
|
address = "192.168.0.22";
|
||||||
|
prefixLength = 16;
|
||||||
|
}
|
||||||
|
];
|
||||||
|
defaultGateway = "192.168.0.149";
|
||||||
|
nameservers = ["130.83.2.22" "130.83.56.60" "130.83.22.60" "130.82.22.63"];
|
||||||
|
};
|
||||||
|
}
|
|
@ -1,48 +0,0 @@
|
||||||
{
|
|
||||||
lib,
|
|
||||||
config,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
inherit
|
|
||||||
(lib)
|
|
||||||
mkOption
|
|
||||||
types
|
|
||||||
last
|
|
||||||
init
|
|
||||||
;
|
|
||||||
inherit
|
|
||||||
(lib.strings)
|
|
||||||
splitString
|
|
||||||
concatStringsSep
|
|
||||||
toInt
|
|
||||||
;
|
|
||||||
cfg = config.vmNetwork;
|
|
||||||
in {
|
|
||||||
imports = [];
|
|
||||||
|
|
||||||
options.vmNetwork = {
|
|
||||||
ipv4 = mkOption {
|
|
||||||
type = types.str;
|
|
||||||
description = "the ipv4 adress of this machine";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
config = {
|
|
||||||
networking = {
|
|
||||||
interfaces.enX0.ipv4.addresses = [
|
|
||||||
{
|
|
||||||
address = cfg.ipv4;
|
|
||||||
prefixLength = 16;
|
|
||||||
}
|
|
||||||
];
|
|
||||||
defaultGateway = let
|
|
||||||
addr = splitString "." cfg.ipv4;
|
|
||||||
addrInit = init addr;
|
|
||||||
addrLastInt = builtins.toString (toInt (last addr) + 127);
|
|
||||||
in
|
|
||||||
concatStringsSep "." (addrInit ++ [addrLastInt]);
|
|
||||||
# https://www.hrz.tu-darmstadt.de/services/it_services/nameserver_dns/index.de.jsp
|
|
||||||
nameservers = ["130.83.22.63" "130.83.22.60" "130.83.56.60"];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
Loading…
Reference in a new issue