From b1f71fe4fbd5533985e2a3f9f69ecba2b382b58b Mon Sep 17 00:00:00 2001 From: Johannes Kirschbauer Date: Wed, 2 Jul 2025 18:17:03 +0200 Subject: [PATCH] clan.deployment: unify deprecated option --- checks/flash/flake-module.nix | 1 - docs/site/guides/getting-started/deploy.md | 4 +-- nixosModules/clanCore/networking.nix | 35 +++++++--------------- nixosModules/clanCore/outputs.nix | 8 ++--- pkgs/clan-cli/clan_cli/machines/cli.py | 2 +- 5 files changed, 17 insertions(+), 33 deletions(-) diff --git a/checks/flash/flake-module.nix b/checks/flash/flake-module.nix index 713dcbfc0..cb6ef6280 100644 --- a/checks/flash/flake-module.nix +++ b/checks/flash/flake-module.nix @@ -51,7 +51,6 @@ self.nixosConfigurations."test-flash-machine-${pkgs.hostPlatform.system}".config.system.build.diskoScript self.nixosConfigurations."test-flash-machine-${pkgs.hostPlatform.system}".config.system.build.diskoScript.drvPath self.nixosConfigurations."test-flash-machine-${pkgs.hostPlatform.system}".config.system.clan.deployment.file - ] ++ builtins.map (i: i.outPath) (builtins.attrValues self.inputs); closureInfo = pkgs.closureInfo { rootPaths = dependencies; }; in diff --git a/docs/site/guides/getting-started/deploy.md b/docs/site/guides/getting-started/deploy.md index 5101044b1..eb0fe089c 100644 --- a/docs/site/guides/getting-started/deploy.md +++ b/docs/site/guides/getting-started/deploy.md @@ -304,14 +304,14 @@ clan { ### Excluding from Automatic Updates To exclude machines from being updated when running `clan machines update` without any machines specified, -one can set the `clan.deployment.requireExplicitUpdate` option to true: +one can set the `clan.core.deployment.requireExplicitUpdate` option to true: ```{.nix hl_lines="5" .no-copy} clan { # ... machines = { "jon" = { - clan.deployment.requireExplicitUpdate = true; + clan.core.deployment.requireExplicitUpdate = true; }; }; }; diff --git a/nixosModules/clanCore/networking.nix b/nixosModules/clanCore/networking.nix index f91911ea1..85c473e4b 100644 --- a/nixosModules/clanCore/networking.nix +++ b/nixosModules/clanCore/networking.nix @@ -84,31 +84,16 @@ use = lib.trace "Obsolete option `${lib.showOption from}' is used. It was renamed to `${lib.showOption to}'."; withPriority = false; }) - (lib.mkRenamedOptionModule - [ - "clan" - "deployment" - ] - [ - "clan" - "core" - "deployment" - ] - ) - (lib.mkRenamedOptionModule - [ - "clan" - "core" - "networking" - "deploymentAddress" - ] - [ - "clan" - "core" - "networking" - "targetHost" - ] - ) + (lib.mkRemovedOptionModule [ + "clan" + "deployment" + ] "Use clan.core.deployment instead") + (lib.mkRemovedOptionModule [ + "clan" + "core" + "networking" + "deploymentAddress" + ] "Use clan.core.network.targetHost instead") ]; config = lib.optionalAttrs (_class == "nixos") ( lib.mkIf config.clan.core.enableRecommendedDefaults { diff --git a/nixosModules/clanCore/outputs.nix b/nixosModules/clanCore/outputs.nix index ba517b9a6..6acc4fc28 100644 --- a/nixosModules/clanCore/outputs.nix +++ b/nixosModules/clanCore/outputs.nix @@ -47,10 +47,10 @@ deployment.nixosMobileWorkaround = lib.mkOption { type = lib.types.bool; description = '' - if true, the deployment will first do a nixos-rebuild switch + if true, the deployment will first do a nixos-rebuild switch to register the boot profile the command will fail applying it to the running system - which is why afterwards we execute a nixos-rebuild test to apply - the new config without having to reboot. + which is why afterwards we execute a nixos-rebuild test to apply + the new config without having to reboot. This is a nixos-mobile deployment bug and will be removed in the future ''; default = false; @@ -80,8 +80,8 @@ }; sops.defaultGroups = config.clan.core.sops.defaultGroups; inherit (config.clan.core.networking) targetHost buildHost; + inherit (config.clan.core.deployment) requireExplicitUpdate; inherit (config.system.clan.deployment) nixosMobileWorkaround; - inherit (config.clan.deployment) requireExplicitUpdate; }; system.clan.deployment.file = pkgs.writeText "deployment.json" ( builtins.toJSON config.system.clan.deployment.data diff --git a/pkgs/clan-cli/clan_cli/machines/cli.py b/pkgs/clan-cli/clan_cli/machines/cli.py index cf8935d0c..708291dfe 100644 --- a/pkgs/clan-cli/clan_cli/machines/cli.py +++ b/pkgs/clan-cli/clan_cli/machines/cli.py @@ -34,7 +34,7 @@ Examples: $ clan machines update [MACHINES] Will update the specified machines [MACHINES], if [MACHINES] is omitted, the command will attempt to update every configured machine. - To exclude machines being updated `clan.deployment.requireExplicitUpdate = true;` + To exclude machines being updated `clan.core.deployment.requireExplicitUpdate = true;` can be set in the machine config. $ clan machines update --tags [TAGS..]