From 3557cc4101a8efd7c77deaae98754129fdc62ca0 Mon Sep 17 00:00:00 2001 From: Victor Date: Mon, 18 Dec 2023 15:49:08 +0100 Subject: [PATCH] add tudelft vm --- flake.lock | 30 ++++++++++----------- flake.nix | 18 +++++-------- nixos/hosts/hades/default.nix | 5 +++- nixos/hosts/hades/tudelft/configuration.nix | 22 +++++++++++++++ nixos/templates/proxmox-vm.nix | 7 ++--- nixos/util.nix | 3 ++- 6 files changed, 53 insertions(+), 32 deletions(-) create mode 100644 nixos/hosts/hades/tudelft/configuration.nix diff --git a/flake.lock b/flake.lock index eab3417..b9eec3c 100644 --- a/flake.lock +++ b/flake.lock @@ -664,11 +664,11 @@ ] }, "locked": { - "lastModified": 1702538064, - "narHash": "sha256-At5GwJPu2tzvS9dllhBoZmqK6lkkh/sOp2YefWRlaL8=", + "lastModified": 1702814335, + "narHash": "sha256-Qck7BAMi3eydzT1WFOzp/SgECetyPpOn1dLgmxH2ebQ=", "owner": "nix-community", "repo": "home-manager", - "rev": "0e2e443ff24f9d75925e91b89d1da44b863734af", + "rev": "e4dba0bd01956170667458be7b45f68170a63651", "type": "github" }, "original": { @@ -1066,11 +1066,11 @@ }, "nixpkgs_4": { "locked": { - "lastModified": 1702483393, - "narHash": "sha256-xdZ+69I2z5ywVtJHW3+BQ99rKFDPkyaPNznstw+gfS8=", + "lastModified": 1702855317, + "narHash": "sha256-5EXeUkoWvrfbZQQLVRn7Ebb9LOt3DkVm6T0M31/VhtM=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "224b3a5ad9a960e4a6e3cd59233c1616164c5ef5", + "rev": "3a16c6447466f4034c2d75fe7014477142c9513e", "type": "github" }, "original": { @@ -1161,11 +1161,11 @@ }, "nixpkgs_stable": { "locked": { - "lastModified": 1702350026, - "narHash": "sha256-A+GNZFZdfl4JdDphYKBJ5Ef1HOiFsP18vQe9mqjmUis=", + "lastModified": 1702759837, + "narHash": "sha256-u3XeJVRe/Q975nwFE+6ALEwypMKJEELMJKDAhSKyq3M=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "9463103069725474698139ab10f17a9d125da859", + "rev": "b2566f4f897ac6224e094b167d9488d03e157f28", "type": "github" }, "original": { @@ -1181,11 +1181,11 @@ "pre-commit-hooks": "pre-commit-hooks" }, "locked": { - "lastModified": 1702508038, - "narHash": "sha256-m/Oo1A9fjd9WroX9Ta/K01qjN3Vz2M7VRnS1qCxE/pU=", + "lastModified": 1702895385, + "narHash": "sha256-xCfbHlBEPbjpecbhd9zJ79xyI9pURW9/BsY75DNIfs4=", "owner": "pta2002", "repo": "nixvim", - "rev": "41f5b167e7cfe2fe1ef90f7007708916bd65565d", + "rev": "309e5644fc72ce82b31da5290638019f60a0a84b", "type": "github" }, "original": { @@ -1196,11 +1196,11 @@ }, "nur": { "locked": { - "lastModified": 1702543472, - "narHash": "sha256-4qX7qaSoabwR+kK0tcPMhafjVyYJnHroRNlWAVG7sVU=", + "lastModified": 1702889123, + "narHash": "sha256-hgdt5ZE76rBbOXVgaBfTY5pT8VezeAeeYomyofrs9RY=", "owner": "nix-community", "repo": "NUR", - "rev": "e45bc50d0fb04e748cf890062023da461c2476ad", + "rev": "5eb36fd2d32f43177896e8dd5a7ba134d3d5e949", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 3ef1297..9326daa 100644 --- a/flake.nix +++ b/flake.nix @@ -125,12 +125,12 @@ }; # Broken - # proxmox-vm = nixos-generators.nixosGenerate { - # inherit system pkgs specialArgs; - # format = "proxmox"; - # modules = util.base_imports - # ++ [ (import ./nixos/templates/proxmox-vm.nix) ]; - # }; + proxmox-vm = nixos-generators.nixosGenerate { + inherit system specialArgs; + format = "proxmox"; + modules = util.base_imports + ++ [ (import ./nixos/templates/proxmox-vm.nix) ]; + }; }; # Use by running `nix develop` @@ -142,12 +142,7 @@ colmena.packages.${system}.colmena cachix deadnix - fluxcd - k9s - kubectl - kubectx statix - terraform nixfmt nixpkgs-fmt nixUnstable @@ -158,7 +153,6 @@ (vault-push-approle-envs self { }) (vault-push-approles self { }) fast-repl - weave-gitops ]; }; }; diff --git a/nixos/hosts/hades/default.nix b/nixos/hosts/hades/default.nix index ba83fad..8f9a049 100644 --- a/nixos/hosts/hades/default.nix +++ b/nixos/hosts/hades/default.nix @@ -153,7 +153,10 @@ mac = "00:0c:29:9b:e1:c4"; nix = false; }; - # ip = "192.168.0.132"; + "tudelft" = { + ip = "192.168.0.132"; + mac = "AE:B3:93:4B:04:76"; + }; "mastodon" = { ip = "192.168.0.138"; mac = "52:60:8a:06:86:9c"; diff --git a/nixos/hosts/hades/tudelft/configuration.nix b/nixos/hosts/hades/tudelft/configuration.nix new file mode 100644 index 0000000..b1c2ee4 --- /dev/null +++ b/nixos/hosts/hades/tudelft/configuration.nix @@ -0,0 +1,22 @@ +# Edit this configuration file to define what should be installed on +# your system. Help is available in the configuration.nix(5) man page +# and in the NixOS manual (accessible by running ‘nixos-help’). + +{ pkgs, ... }: + +{ + imports = [ ]; + + # This value determines the NixOS release from which the default + # settings for stateful data, like file locations and database versions + # on your system were taken. It‘s perfectly fine and recommended to leave + # this value at the release version of the first install of this system. + # Before changing this value read the documentation for this option + # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). + system.stateVersion = "23.11"; # Did you read the comment? + + # Additional packages + environment.systemPackages = with pkgs; [ ]; + + networking.firewall.allowedTCPPorts = [ ]; +} diff --git a/nixos/templates/proxmox-vm.nix b/nixos/templates/proxmox-vm.nix index 567090f..0c220eb 100644 --- a/nixos/templates/proxmox-vm.nix +++ b/nixos/templates/proxmox-vm.nix @@ -1,11 +1,12 @@ { lib, ... }: { - imports = [ ../common/common.nix ../common/generic-vm.nix ]; + imports = [ ../common ../common/generic-vm.nix ]; proxmox.qemuConf = { virtio0 = "local-zfs:vm-9999-disk-0"; - cores = 1; - memory = 1024; + cores = 4; + memory = 4096; bios = "ovmf"; + additionalSpace = "20G"; }; # Enable SSH diff --git a/nixos/util.nix b/nixos/util.nix index 5a55aa5..79fe2a0 100644 --- a/nixos/util.nix +++ b/nixos/util.nix @@ -3,6 +3,7 @@ let inherit (builtins) filter attrValues concatMap mapAttrs; inherit (nixpkgs.lib.attrsets) mapAttrsToList; base_imports = [ + ./common home-manager.nixosModules.home-manager mailserver.nixosModules.mailserver attic.nixosModules.atticd @@ -25,7 +26,7 @@ let # Helper function to resolve what should be imported depending on the type of config (lxc, vm, bare metal) resolve_imports = { hostname, realm, profile ? hostname, type ? "lxc", ... }: type_import type - ++ [ ./common "${./.}/hosts/${realm}/${profile}/configuration.nix" ]; + ++ [ "${./.}/hosts/${realm}/${profile}/configuration.nix" ]; # Add to whatever realm a host belong to its list of tags add_realm_to_tags = mapAttrs (realm: