From 7fe0aa0f549bd0cbba0ba01f9d139ffbf2903d0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torjus=20H=C3=A5kestad?= Date: Sun, 1 Feb 2026 16:38:13 +0100 Subject: [PATCH] test: add testvm01 for pipeline testing --- flake.nix | 16 +++++++++ hosts/testvm01/configuration.nix | 61 ++++++++++++++++++++++++++++++++ hosts/testvm01/default.nix | 5 +++ terraform/vms.tf | 7 ++++ 4 files changed, 89 insertions(+) create mode 100644 hosts/testvm01/configuration.nix create mode 100644 hosts/testvm01/default.nix diff --git a/flake.nix b/flake.nix index f585f52..e3b6054 100644 --- a/flake.nix +++ b/flake.nix @@ -335,6 +335,22 @@ ]; }; }; + testvm01 = nixpkgs.lib.nixosSystem { + inherit system; + specialArgs = { + inherit inputs self sops-nix; + }; + modules = [ + ( + { config, pkgs, ... }: + { + nixpkgs.overlays = commonOverlays; + } + ) + ./hosts/testvm01 + sops-nix.nixosModules.sops + ]; + }; packages = forAllSystems ( { pkgs }: { diff --git a/hosts/testvm01/configuration.nix b/hosts/testvm01/configuration.nix new file mode 100644 index 0000000..f5b0fdf --- /dev/null +++ b/hosts/testvm01/configuration.nix @@ -0,0 +1,61 @@ +{ + config, + lib, + pkgs, + ... +}: + +{ + imports = [ + ../template2/hardware-configuration.nix + + ../../system + ../../common/vm + ]; + + nixpkgs.config.allowUnfree = true; + boot.loader.grub.enable = true; + boot.loader.grub.device = "/dev/vda"; + + networking.hostName = "testvm01"; + networking.domain = "home.2rjus.net"; + networking.useNetworkd = true; + networking.useDHCP = false; + services.resolved.enable = false; + networking.nameservers = [ + "10.69.13.5" + "10.69.13.6" + ]; + + systemd.network.enable = true; + systemd.network.networks."ens18" = { + matchConfig.Name = "ens18"; + address = [ + "10.69.13.101/24" + ]; + routes = [ + { Gateway = "10.69.13.1"; } + ]; + linkConfig.RequiredForOnline = "routable"; + }; + time.timeZone = "Europe/Oslo"; + + nix.settings.experimental-features = [ + "nix-command" + "flakes" + ]; + nix.settings.tarball-ttl = 0; + environment.systemPackages = with pkgs; [ + vim + wget + git + ]; + + # Open ports in the firewall. + # networking.firewall.allowedTCPPorts = [ ... ]; + # networking.firewall.allowedUDPPorts = [ ... ]; + # Or disable the firewall altogether. + networking.firewall.enable = false; + + system.stateVersion = "25.11"; # Did you read the comment? +} \ No newline at end of file diff --git a/hosts/testvm01/default.nix b/hosts/testvm01/default.nix new file mode 100644 index 0000000..57ed4b4 --- /dev/null +++ b/hosts/testvm01/default.nix @@ -0,0 +1,5 @@ +{ ... }: { + imports = [ + ./configuration.nix + ]; +} \ No newline at end of file diff --git a/terraform/vms.tf b/terraform/vms.tf index eecac99..604377f 100644 --- a/terraform/vms.tf +++ b/terraform/vms.tf @@ -31,6 +31,13 @@ locals { # Example Minimal VM using all defaults (uncomment to deploy): # "minimal-vm" = {} # "bootstrap-verify-test" = {} + "testvm01" = { + ip = "10.69.13.101/24" + cpu_cores = 2 + memory = 2048 + disk_size = "20G" + flake_branch = "pipeline-testing-improvements" + } } # Compute VM configurations with defaults applied