diff --git a/nixos/flake-module.nix b/nixos/flake-module.nix index bc1769b..1027f0f 100644 --- a/nixos/flake-module.nix +++ b/nixos/flake-module.nix @@ -14,7 +14,13 @@ importedConfig = import (./. + "/machines/${name}/configuration.nix"); systemConfig = if lib.isFunction importedConfig - then x: importedConfig (x // {flake-inputs = inputs;}) + then + x: + importedConfig (x + // { + flake-inputs = inputs; + inherit pkgs; + }) else importedConfig; in pkgs.nixos { diff --git a/nixos/machines/nodens/configuration.nix b/nixos/machines/nodens/configuration.nix new file mode 100644 index 0000000..554e407 --- /dev/null +++ b/nixos/machines/nodens/configuration.nix @@ -0,0 +1,16 @@ +{pkgs, ...}: { + imports = [ + ./hardware-configuration.nix + ../../roles + ../../roles/vm.nix + ../../modules/vmNetwork.nix + ]; + + # System configuration here + + environment.systemPackages = [pkgs.git]; + + networking.hostName = "nodens"; + vmNetwork.ipv4 = "192.168.0.18"; + system.stateVersion = "24.11"; +} diff --git a/nixos/machines/nodens/hardware-configuration.nix b/nixos/machines/nodens/hardware-configuration.nix new file mode 100644 index 0000000..fec0aec --- /dev/null +++ b/nixos/machines/nodens/hardware-configuration.nix @@ -0,0 +1,33 @@ +{ + lib, + pkgs, + ... +}: { + imports = []; + + fileSystems."/" = { + device = "root"; + fsType = "tmpfs"; + options = ["size=1G" "mode=755"]; + }; + # Different than usual names in order to automount other VMs + fileSystems."/persist" = { + device = "/dev/disk/by-label/nixosNodens"; + fsType = "btrfs"; + options = ["subvol=persist"]; + neededForBoot = true; + }; + fileSystems."/boot" = { + device = "/dev/disk/by-label/bootNodens"; + fsType = "ext4"; + }; + fileSystems."/nix" = { + device = "/dev/disk/by-label/nixosNodens"; + fsType = "btrfs"; + options = ["subvol=nix"]; + }; + + swapDevices = [{device = "/dev/disk/by-uuid/89e13a83-506a-43b4-b06a-09424500ceda";}]; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; +}