diff --git a/flake.nix b/flake.nix index 05d7a18..4bb29e9 100644 --- a/flake.nix +++ b/flake.nix @@ -350,6 +350,22 @@ sops-nix.nixosModules.sops ]; }; + vault01 = nixpkgs.lib.nixosSystem { + inherit system; + specialArgs = { + inherit inputs self sops-nix; + }; + modules = [ + ( + { config, pkgs, ... }: + { + nixpkgs.overlays = commonOverlays; + } + ) + ./hosts/vault01 + sops-nix.nixosModules.sops + ]; + }; }; packages = forAllSystems ( { pkgs }: diff --git a/hosts/vault01/configuration.nix b/hosts/vault01/configuration.nix new file mode 100644 index 0000000..9548141 --- /dev/null +++ b/hosts/vault01/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 = "vault01"; + 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.19/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/vault01/default.nix b/hosts/vault01/default.nix new file mode 100644 index 0000000..57ed4b4 --- /dev/null +++ b/hosts/vault01/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 340b2cb..8a0e5c7 100644 --- a/terraform/vms.tf +++ b/terraform/vms.tf @@ -38,6 +38,12 @@ locals { disk_size = "20G" flake_branch = "pipeline-testing-improvements" } + "vault01" = { + ip = "10.69.13.19/24" + cpu_cores = 2 + memory = 2048 + disk_size = "20G" + } } # Compute VM configurations with defaults applied