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 = {
system = "x86_64-linux";
stateVersion = "26.05";
user = "moons";
path = ./x1g9;
-2
View File
@@ -2,6 +2,4 @@
imports = [
./hardware.nix
];
system.stateVersion = "26.05";
}
+15 -1
View File
@@ -35,6 +35,14 @@ let
ensure (spec ? user && builtins.isString spec.user && spec.user != "") "${name}: user is required" (
ensure (spec ? path && builtins.pathExists spec.path)
"${name}: path must name an existing host directory"
(
ensure
(
spec ? stateVersion
&& builtins.isString spec.stateVersion
&& builtins.match "[0-9][0-9]\\.[0-9][0-9]" spec.stateVersion != null
)
"${name}: stateVersion is required and must have the form YY.MM"
(
ensure
(lib.all
@@ -51,6 +59,7 @@ let
)
)
)
)
);
mkSpecialArgs = name: spec: {
@@ -67,6 +76,7 @@ let
homeModules = [
(registry.mkModule { class = "home"; })
(registry.mkSelectionModule selected)
{ home.stateVersion = spec.stateVersion; }
]
++ lib.optional (homePath != null) homePath;
in
@@ -88,6 +98,7 @@ let
homeModules = [
(registry.mkModule { class = "home"; })
(registry.mkSelectionModule selected)
{ home.stateVersion = spec.stateVersion; }
]
++ lib.optional (homePath != null) homePath;
in
@@ -111,7 +122,10 @@ let
modules = [
(registry.mkModule { class = "nixos"; })
(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 (nixosPath != null) nixosPath;
-1
View File
@@ -3,7 +3,6 @@
home = {
username = primaryUser;
homeDirectory = "/home/${primaryUser}";
stateVersion = "26.05";
};
programs.home-manager.enable = true;
+18 -1
View File
@@ -1,12 +1,29 @@
{ primaryUser, ... }:
{ primaryUser, pkgs, ... }:
{
users.users.${primaryUser} = {
isNormalUser = true;
description = "moons";
extraGroups = [
"adbusers"
"docker"
"libvirtd"
"lp"
"networkmanager"
"scanner"
"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 = {
-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;
system.stateVersion = "26.05";
}
-1
View File
@@ -3,6 +3,5 @@
home = {
username = "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" {
system = "x86_64-linux";
stateVersion = "26.05";
user = "test";
path = ./fixtures/registry/hosts;
profiles = [ "interface.test" ];
@@ -50,6 +51,7 @@ let
darwinHost = hostLib.mkDarwin "registry-test-darwin" {
system = "aarch64-darwin";
stateVersion = "26.05";
user = "test";
path = ./fixtures/registry/hosts;
applications = [ "alpha" ];
@@ -109,6 +111,8 @@ let
"beta-home"
];
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.test.homeValues == [
@@ -116,6 +120,7 @@ let
"beta-home"
];
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.test.homeValues == [ "home" ];
assert