use builtins.currentSystem, sync some changes from template to original package

This commit is contained in:
jackjohn7 2026-04-12 03:27:32 -05:00
parent 5fa9ccb970
commit 687b99ae04
2 changed files with 14 additions and 2 deletions

View file

@ -46,6 +46,7 @@ def host_templates(name: str) -> dict[Path, str]:
{{ self, inputs, ... }}: {{ self, inputs, ... }}:
{{ {{
flake.nixosConfigurations.{name} = inputs.nixpkgs.lib.nixosSystem {{ flake.nixosConfigurations.{name} = inputs.nixpkgs.lib.nixosSystem {{
system = builtins.currentSystem;
modules = [ modules = [
self.nixosModules.{name}Configuration self.nixosModules.{name}Configuration
]; ];
@ -64,6 +65,7 @@ def host_templates(name: str) -> dict[Path, str]:
imports = [ imports = [
self.nixosModules.{name}Hardware self.nixosModules.{name}Hardware
]; ];
system.stateVersion = "25.11";
}}; }};
}} }}
""" """
@ -77,7 +79,17 @@ def host_templates(name: str) -> dict[Path, str]:
{{ lib, pkgs, ... }}: {{ lib, pkgs, ... }}:
{{ {{
config = {{ 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";
}};
}}; }};
}}; }};
}} }}

View file

@ -46,7 +46,7 @@ def host_templates(name: str) -> dict[Path, str]:
{{ self, inputs, ... }}: {{ self, inputs, ... }}:
{{ {{
flake.nixosConfigurations.{name} = inputs.nixpkgs.lib.nixosSystem {{ flake.nixosConfigurations.{name} = inputs.nixpkgs.lib.nixosSystem {{
system = "x86_64-linux"; system = builtins.currentSystem;
modules = [ modules = [
self.nixosModules.{name}Configuration self.nixosModules.{name}Configuration
]; ];