Add state-version nixos option

This reverts commit 8f6f06bef3.
This commit is contained in:
pinpox
2025-07-02 09:46:06 +02:00
parent 1b34aa06a4
commit 9a293f790e
9 changed files with 27 additions and 18 deletions

View File

@@ -22,6 +22,7 @@ in
imports = filter pathExists [ imports = filter pathExists [
./backups/flake-module.nix ./backups/flake-module.nix
../nixosModules/clanCore/machine-id/tests/flake-module.nix ../nixosModules/clanCore/machine-id/tests/flake-module.nix
../nixosModules/clanCore/state-version/tests/flake-module.nix
./devshell/flake-module.nix ./devshell/flake-module.nix
./flash/flake-module.nix ./flash/flake-module.nix
./impure/flake-module.nix ./impure/flake-module.nix

View File

@@ -5,9 +5,12 @@ in
{ {
warnings = [ warnings = [
"The clan.state-version module is deprecated and will be removed on 2025-07-15. ''
Please migrate to user-maintained configuration or the new equivalent clan services The clan.state-version service is deprecated and will be
(https://docs.clan.lol/reference/clanServices)." removed on 2025-07-15 in favor of a nix option.
Please migrate your configuration to use `clan.core.settings.state-version.enable = true` instead.
''
]; ];
system.stateVersion = lib.mkDefault (lib.removeSuffix "\n" var.value); system.stateVersion = lib.mkDefault (lib.removeSuffix "\n" var.value);

View File

@@ -20,6 +20,16 @@
var = config.clan.core.vars.generators.state-version.files.version or { }; var = config.clan.core.vars.generators.state-version.files.version or { };
in in
{ {
warnings = [
''
The clan.state-version service is deprecated and will be
removed on 2025-07-15 in favor of a nix option.
Please migrate your configuration to use `clan.core.settings.state-version.enable = true` instead.
''
];
system.stateVersion = lib.mkDefault (lib.removeSuffix "\n" var.value); system.stateVersion = lib.mkDefault (lib.removeSuffix "\n" var.value);
clan.core.vars.generators.state-version = { clan.core.vars.generators.state-version = {

View File

@@ -1,5 +1,6 @@
{ lib, ... }:
{ {
name = "state-version"; name = "service-state-version";
clan = { clan = {
directory = ./.; directory = ./.;
@@ -15,7 +16,7 @@
nodes.server = { }; nodes.server = { };
testScript = '' testScript = lib.mkDefault ''
start_all() start_all()
''; '';
} }

View File

@@ -13,13 +13,13 @@
./options.nix ./options.nix
./outputs.nix ./outputs.nix
./sops.nix ./sops.nix
./state-version/default.nix
./vars ./vars
] ]
++ lib.optionals (_class == "nixos") [ ++ lib.optionals (_class == "nixos") [
./nixos-facter.nix ./nixos-facter.nix
./vm.nix ./vm.nix
./machine-id ./machine-id
./state-version
./wayland-proxy-virtwl.nix ./wayland-proxy-virtwl.nix
./zerotier ./zerotier
./zfs.nix ./zfs.nix

View File

@@ -0,0 +1,4 @@
{
"publickey": "age1qm0p4vf9jvcnn43s6l4prk8zn6cx0ep9gzvevxecv729xz540v8qa742eg",
"type": "age"
}

View File

@@ -64,17 +64,7 @@ def create_base_inventory(ssh_keys_pairs: list[SSHKeyPair]) -> InventoryWrapper:
ssh_keys.append(InvSSHKeyEntry(f"user_{num}", ssh_key.public.read_text())) ssh_keys.append(InvSSHKeyEntry(f"user_{num}", ssh_key.public.read_text()))
"""Create the base inventory structure.""" """Create the base inventory structure."""
legacy_services: dict[str, Any] = { legacy_services: dict[str, Any] = {}
"state-version": {
"someid": {
"roles": {
"default": {
"tags": ["all"],
}
}
}
},
}
instances = InventoryInstancesType( instances = InventoryInstancesType(
{ {

View File

@@ -12,7 +12,6 @@
# Set a root password # Set a root password
clan-core.clanModules.root-password clan-core.clanModules.root-password
clan-core.clanModules.user-password clan-core.clanModules.user-password
clan-core.clanModules.state-version
# You can access other flakes imported in your flake via `self` like this: # You can access other flakes imported in your flake via `self` like this:
# self.inputs.nix-index-database.nixosModules.nix-index # self.inputs.nix-index-database.nixosModules.nix-index