diff --git a/nixos/configurations.nix b/nixos/configurations.nix index 649b882..a1a0cbe 100644 --- a/nixos/configurations.nix +++ b/nixos/configurations.nix @@ -46,6 +46,15 @@ in ]; }; + mag = nixosSystem rec { + system = "x86_64-linux"; + modules = (nixpkgs.lib.attrValues self.nixosModules) ++ [ + (adapterModule system) + ./modules/profiles/server.nix + ./mag/configuration.nix + ]; + }; + surgat = nixosSystem rec { system = "x86_64-linux"; modules = (nixpkgs.lib.attrValues self.nixosModules) ++ [ diff --git a/nixos/mag/configuration.nix b/nixos/mag/configuration.nix new file mode 100644 index 0000000..f81b525 --- /dev/null +++ b/nixos/mag/configuration.nix @@ -0,0 +1,74 @@ +{ config, pkgs, lib, ... }: +let + hostAliases = [ + "mag.dadada.li" + "vpn.dadada.li" + ]; +in +{ + imports = [ +# ./hardware-configuration.nix + ]; + + dadada = { + admin.enable = true; + vpnServer = { + enable = true; + peers = { + "morax" = { + id = "2"; + key = "Lq5QLGoI3r3BXEJ72dWH9UTmY/8uaYRPLQB5WWHqJUE="; + }; + "gorgon" = { + id = "3"; + key = "0eWP1hzkyoXlrjPSOq+6Y1u8tnFH+SejBJs8f8lf+iU="; + }; + "surgat" = { + id = "4"; + key = "+paiOqOITdLy3oqoI2DhOj4k8gncAcjFLkJrxJl0iBE="; + }; + "pruflas" = { + id = "5"; + key = "o8B8rTA+u5XOJK4JI+TRCFjVJn/3T7UofLqFRIPoNQk="; + }; + }; + }; + ddns.domains = [ + "vpn.dadada.li" + ]; + }; + + networking.hostName = "mag"; + + networking.hosts = { + "127.0.0.1" = hostAliases; + "::1" = hostAliases; + }; + + # Use the GRUB 2 boot loader. + boot.loader.grub.enable = true; + boot.loader.grub.version = 2; + boot.loader.grub.device = "/dev/sda"; + + networking.interfaces."ens3".tempAddress = "disabled"; + + networking.useDHCP = false; + networking.interfaces.ens3.useDHCP = true; + + boot.kernelParams = [ + "console=ttyS0,115200" + ]; + + networking.firewall = { + enable = true; + allowPing = true; + allowedTCPPorts = [ + 22 # SSH + ]; + allowedUDPPorts = [ + 51234 + ]; + }; + + system.stateVersion = "22.05"; +} diff --git a/nixos/mag/hardware-configuration.nix b/nixos/mag/hardware-configuration.nix new file mode 100644 index 0000000..e69de29