This commit is contained in:
2026-07-27 12:34:20 +09:00
parent 9771a85e3f
commit c58bdd30c3
9 changed files with 48 additions and 20 deletions
+1
View File
@@ -1,6 +1,7 @@
{ {
x1g9 = { x1g9 = {
system = "x86_64-linux"; system = "x86_64-linux";
stateVersion = "26.05";
user = "moons"; user = "moons";
path = ./x1g9; path = ./x1g9;
-2
View File
@@ -2,6 +2,4 @@
imports = [ imports = [
./hardware.nix ./hardware.nix
]; ];
system.stateVersion = "26.05";
} }
+24 -10
View File
@@ -37,16 +37,25 @@ let
"${name}: path must name an existing host directory" "${name}: path must name an existing host directory"
( (
ensure ensure
(lib.all (
(field: builtins.isList (spec.${field} or [ ]) && lib.all builtins.isString (spec.${field} or [ ])) spec ? stateVersion
[ && builtins.isString spec.stateVersion
"profiles" && builtins.match "[0-9][0-9]\\.[0-9][0-9]" spec.stateVersion != null
"applications" )
"units" "${name}: stateVersion is required and must have the form YY.MM"
] (
ensure
(lib.all
(field: builtins.isList (spec.${field} or [ ]) && lib.all builtins.isString (spec.${field} or [ ]))
[
"profiles"
"applications"
"units"
]
)
"${name}: profiles, applications, and units must be lists of strings"
(ensure (builtins.isBool (spec.homeManager or true)) "${name}: homeManager must be a boolean" spec)
) )
"${name}: profiles, applications, and units must be lists of strings"
(ensure (builtins.isBool (spec.homeManager or true)) "${name}: homeManager must be a boolean" spec)
) )
) )
) )
@@ -67,6 +76,7 @@ let
homeModules = [ homeModules = [
(registry.mkModule { class = "home"; }) (registry.mkModule { class = "home"; })
(registry.mkSelectionModule selected) (registry.mkSelectionModule selected)
{ home.stateVersion = spec.stateVersion; }
] ]
++ lib.optional (homePath != null) homePath; ++ lib.optional (homePath != null) homePath;
in in
@@ -88,6 +98,7 @@ let
homeModules = [ homeModules = [
(registry.mkModule { class = "home"; }) (registry.mkModule { class = "home"; })
(registry.mkSelectionModule selected) (registry.mkSelectionModule selected)
{ home.stateVersion = spec.stateVersion; }
] ]
++ lib.optional (homePath != null) homePath; ++ lib.optional (homePath != null) homePath;
in in
@@ -111,7 +122,10 @@ let
modules = [ modules = [
(registry.mkModule { class = "nixos"; }) (registry.mkModule { class = "nixos"; })
(registry.mkSelectionModule selected) (registry.mkSelectionModule selected)
{ networking.hostName = lib.mkDefault name; } {
networking.hostName = lib.mkDefault name;
system.stateVersion = spec.stateVersion;
}
] ]
++ lib.optional (spec.homeManager or true) (mkHomeManagerModule name spec selected) ++ lib.optional (spec.homeManager or true) (mkHomeManagerModule name spec selected)
++ lib.optional (nixosPath != null) nixosPath; ++ lib.optional (nixosPath != null) nixosPath;
-1
View File
@@ -3,7 +3,6 @@
home = { home = {
username = primaryUser; username = primaryUser;
homeDirectory = "/home/${primaryUser}"; homeDirectory = "/home/${primaryUser}";
stateVersion = "26.05";
}; };
programs.home-manager.enable = true; programs.home-manager.enable = true;
+18 -1
View File
@@ -1,12 +1,29 @@
{ primaryUser, ... }: { primaryUser, pkgs, ... }:
{ {
users.users.${primaryUser} = { users.users.${primaryUser} = {
isNormalUser = true; isNormalUser = true;
description = "moons"; description = "moons";
extraGroups = [ extraGroups = [
"adbusers"
"docker"
"libvirtd"
"lp"
"networkmanager" "networkmanager"
"scanner"
"wheel" "wheel"
"vboxusers"
"dialout"
]; ];
shell = pkgs.zsh;
ignoreShellProgramCheck = true;
openssh.authorizedKeys.keys = [
"sk-ssh-ed25519@openssh.com AAAAGnNrLXNzaC1lZDI1NTE5QG9wZW5zc2guY29tAAAAIKhxDkucmeCor6CKoXAua7DgDSzuXrZOtpdkyzQxz5+aAAAABHNzaDo= moons@moons14.com"
"sk-ssh-ed25519@openssh.com AAAAGnNrLXNzaC1lZDI1NTE5QG9wZW5zc2guY29tAAAAIN6hZJyng/5LgFKPjR6uZAd/00UkO0vN0uQOoIvfSELdAAAABHNzaDo= moons@moons14.com"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPLwReAiwhXoO34S2+MrvqUhi8IWp4IzUq4OSp3niJdq"
];
}; };
nix.settings = { nix.settings = {
-4
View File
@@ -1,6 +1,2 @@
{ inputs, ... }:
{ {
flake.overlays.default = _final: prev: {
llm-agents = inputs.llm-agents.packages.${prev.stdenv.hostPlatform.system};
};
} }
-1
View File
@@ -5,5 +5,4 @@
}; };
boot.loader.grub.enable = false; boot.loader.grub.enable = false;
system.stateVersion = "26.05";
} }
-1
View File
@@ -3,6 +3,5 @@
home = { home = {
username = "test"; username = "test";
homeDirectory = if pkgs.stdenv.hostPlatform.isDarwin then "/Users/test" else "/home/test"; homeDirectory = if pkgs.stdenv.hostPlatform.isDarwin then "/Users/test" else "/home/test";
stateVersion = "26.05";
}; };
} }
+5
View File
@@ -43,6 +43,7 @@ let
nixosHost = hostLib.mkNixos "registry-test" { nixosHost = hostLib.mkNixos "registry-test" {
system = "x86_64-linux"; system = "x86_64-linux";
stateVersion = "26.05";
user = "test"; user = "test";
path = ./fixtures/registry/hosts; path = ./fixtures/registry/hosts;
profiles = [ "interface.test" ]; profiles = [ "interface.test" ];
@@ -50,6 +51,7 @@ let
darwinHost = hostLib.mkDarwin "registry-test-darwin" { darwinHost = hostLib.mkDarwin "registry-test-darwin" {
system = "aarch64-darwin"; system = "aarch64-darwin";
stateVersion = "26.05";
user = "test"; user = "test";
path = ./fixtures/registry/hosts; path = ./fixtures/registry/hosts;
applications = [ "alpha" ]; applications = [ "alpha" ];
@@ -109,6 +111,8 @@ let
"beta-home" "beta-home"
]; ];
assert nixosHost.config.my.profiles.interface.test.enable; assert nixosHost.config.my.profiles.interface.test.enable;
assert nixosHost.config.system.stateVersion == "26.05";
assert nixosHost.config.home-manager.users.test.home.stateVersion == "26.05";
assert nixosHost.config.home-manager.users.test.my.applications.alpha.enable; assert nixosHost.config.home-manager.users.test.my.applications.alpha.enable;
assert assert
nixosHost.config.home-manager.users.test.test.homeValues == [ nixosHost.config.home-manager.users.test.test.homeValues == [
@@ -116,6 +120,7 @@ let
"beta-home" "beta-home"
]; ];
assert darwinHost.config.my.applications.alpha.enable; assert darwinHost.config.my.applications.alpha.enable;
assert darwinHost.config.home-manager.users.test.home.stateVersion == "26.05";
assert darwinHost.config.home-manager.users.test.my.applications.alpha.enable; assert darwinHost.config.home-manager.users.test.my.applications.alpha.enable;
assert darwinHost.config.home-manager.users.test.test.homeValues == [ "home" ]; assert darwinHost.config.home-manager.users.test.test.homeValues == [ "home" ];
assert assert