From ec6390be3ffcfe4f1a39d5abb419ff3ea30c1cc4 Mon Sep 17 00:00:00 2001 From: clerie <git@clerie.de> Date: Thu, 13 Mar 2025 18:04:19 +0100 Subject: [PATCH] profiles/netcup: Add profile for Netcup VM --- flake.nix | 1 + flake/nixosConfigurations.nix | 1 + hosts/porter/configuration.nix | 4 ++-- profiles/default.nix | 9 +++++++++ profiles/netcup/default.nix | 20 ++++++++++++++++++++ 5 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 profiles/default.nix create mode 100644 profiles/netcup/default.nix diff --git a/flake.nix b/flake.nix index a5ce04f..0a2791a 100644 --- a/flake.nix +++ b/flake.nix @@ -120,6 +120,7 @@ nixosModules = { nixfilesInputs = import ./flake/modules.nix inputs; clerie = import ./modules; + profiles = import ./profiles; default = self.nixosModules.clerie; }; diff --git a/flake/nixosConfigurations.nix b/flake/nixosConfigurations.nix index dd969aa..be4df26 100644 --- a/flake/nixosConfigurations.nix +++ b/flake/nixosConfigurations.nix @@ -16,6 +16,7 @@ let modules = modules ++ [ self.nixosModules.nixfilesInputs self.nixosModules.clerie + self.nixosModules.profiles ({ config, lib, ... }: { # Set hostname diff --git a/hosts/porter/configuration.nix b/hosts/porter/configuration.nix index a0b06c8..7974fb1 100644 --- a/hosts/porter/configuration.nix +++ b/hosts/porter/configuration.nix @@ -7,6 +7,8 @@ ../../configuration/router ]; + profiles.clerie.netcup.enable = true; + boot.loader.grub.enable = true; boot.loader.grub.device = "/dev/sda"; @@ -25,8 +27,6 @@ linkConfig.RequiredForOnline = "routable"; }; - networking.nameservers = [ "46.38.255.230" "46.38.252.230" ]; - clerie.nginx-port-forward = { enable = true; tcpPorts."2022" = { diff --git a/profiles/default.nix b/profiles/default.nix new file mode 100644 index 0000000..3f4c91f --- /dev/null +++ b/profiles/default.nix @@ -0,0 +1,9 @@ +{ ... }: + +{ + + imports = [ + ./netcup + ]; + +} diff --git a/profiles/netcup/default.nix b/profiles/netcup/default.nix new file mode 100644 index 0000000..abc7e39 --- /dev/null +++ b/profiles/netcup/default.nix @@ -0,0 +1,20 @@ +{ config, lib, ... }: + +with lib; + +{ + + options.profiles.clerie.netcup = { + enable = mkEnableOption "Profile for Netcup VM"; + }; + + config = mkIf config.profiles.clerie.netcup.enable { + + services.qemuGuest.enable = true; + + # https://helpcenter.netcup.com/de/wiki/server/nameserver/ + networking.nameservers = [ "2a03:4000:0:1::e1e6" "2a03:4000:8000::fce6" "46.38.255.230" "46.38.252.230" ]; + + }; + +}