From 98314cfacdde32b03109d85dc1c7b649f5f61579 Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Tue, 06 Jan 2026 04:38:45 +0000 Subject: [PATCH] refactor: drop nix config compat --- --- a/crates/fleet-base/src/fleetdata.rs +++ b/crates/fleet-base/src/fleetdata.rs @@ -73,7 +73,7 @@ #[serde(default = "generate_gc_prefix")] pub gc_root_prefix: String, - #[serde(default)] + #[serde(default, skip_serializing_if = "Vec::is_empty")] pub manager_keys: Vec, #[serde(default)] @@ -148,13 +148,13 @@ #[serde(rename_all = "camelCase")] #[must_use] pub struct FleetSecretDistribution { - #[serde(default)] - #[serde(skip_serializing_if = "Option::is_none")] - pub managed: Option, #[serde(default)] pub owners: BTreeSet, #[serde(flatten)] pub secret: FleetSecretData, + + #[serde(default, skip_serializing, alias="managed")] + pub _deprecated_managed: bool, } #[derive(Clone)] @@ -244,9 +244,10 @@ } = self; let idx = distributions.0.len(); distributions.0.push(FleetSecretDistribution { - managed: None, owners: BTreeSet::from_iter([owner.clone()]), secret, + + _deprecated_managed: true, }); OccupiedDistEntry { distributions, --- a/lib/flakePart.nix +++ b/lib/flakePart.nix @@ -8,34 +8,21 @@ ... }: let - inherit (lib.options) mkOption mkEnableOption; + inherit (lib.options) mkOption; inherit (lib.attrsets) mapAttrs; inherit (lib.types) lazyAttrsOf deferredModule unspecified - str ; inherit (lib.strings) isPath; - inherit (lib.modules) mkIf mkOptionDefault; + inherit (lib.modules) mkOptionDefault; in { options.fleetModules = mkOption { type = lazyAttrsOf unspecified; default = { }; }; - options.fleetNixosConfigurationsCompat = { - enable = mkEnableOption "Create nixosConfiguration output based on fleetConfiguration"; - configuration = mkOption { - type = str; - description = "Which fleetConfiguration to use for compatibility"; - default = "default"; - }; - data = mkOption { - type = unspecified; - description = "Imported fleet.nix file for fleet"; - }; - }; options.fleetConfigurations = mkOption { type = lazyAttrsOf deferredModule; apply = @@ -103,14 +90,6 @@ config = { _module.args.fleetLib = import ../lib { inherit lib; }; flake.fleetConfigurations = config.fleetConfigurations; - flake.nixosConfigurations = - let - cfg = config.fleetNixosConfigurationsCompat; - in - mkIf cfg.enable ( - mapAttrs (name: host: host.nixos) - (config.fleetConfigurations.${cfg.configuration} cfg.data).config.hosts - ); flake.fleetModules = config.fleetModules; }; -- gitstuff