diff --git a/modules/packages/boilerplate/boilerplate.py b/modules/packages/boilerplate/boilerplate.py index 97966a1..5b1251f 100644 --- a/modules/packages/boilerplate/boilerplate.py +++ b/modules/packages/boilerplate/boilerplate.py @@ -46,6 +46,7 @@ def host_templates(name: str) -> dict[Path, str]: {{ self, inputs, ... }}: {{ flake.nixosConfigurations.{name} = inputs.nixpkgs.lib.nixosSystem {{ + system = builtins.currentSystem; modules = [ self.nixosModules.{name}Configuration ]; @@ -64,6 +65,7 @@ def host_templates(name: str) -> dict[Path, str]: imports = [ self.nixosModules.{name}Hardware ]; + system.stateVersion = "25.11"; }}; }} """ @@ -77,7 +79,17 @@ def host_templates(name: str) -> dict[Path, str]: {{ lib, pkgs, ... }}: {{ config = {{ - # Copy the generated hardware configuration here. + # If you're building a full system here, you'd likely want to just copy the hardware + # configuration generated by the NixOS installer. I've added some stuff here just so + # `nix flake check` passes on initialization of the flake and to show how it _could_ + # look. You can find it here: `/etc/nixos/hardware-configuration.nix` + + boot.loader.grub.devices = [ "/dev/sda" ]; + + fileSystems."/" = {{ + device = "tmpfs"; + fsType = "tmpfs"; + }}; }}; }}; }} diff --git a/templates/generic/nix-modules/packages/boilerplate/boilerplate.py b/templates/generic/nix-modules/packages/boilerplate/boilerplate.py index 39874dd..a6b498b 100644 --- a/templates/generic/nix-modules/packages/boilerplate/boilerplate.py +++ b/templates/generic/nix-modules/packages/boilerplate/boilerplate.py @@ -46,7 +46,7 @@ def host_templates(name: str) -> dict[Path, str]: {{ self, inputs, ... }}: {{ flake.nixosConfigurations.{name} = inputs.nixpkgs.lib.nixosSystem {{ - system = "x86_64-linux"; + system = builtins.currentSystem; modules = [ self.nixosModules.{name}Configuration ];