difftreelog
refactor drop nix config compat
in: trunk
2 files changed
crates/fleet-base/src/fleetdata.rsdiffbeforeafterboth--- 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<ManagerKey>,
#[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<bool>,
#[serde(default)]
pub owners: BTreeSet<String>,
#[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,
lib/flakePart.nixdiffbeforeafterboth1{ crane }:2{3 fleetLib,4 lib,5 config,6 inputs,7 self,8 ...9}:10let11 inherit (lib.options) mkOption;12 inherit (lib.attrsets) mapAttrs;13 inherit (lib.types)14 lazyAttrsOf15 deferredModule16 unspecified17 ;18 inherit (lib.strings) isPath;19 inherit (lib.modules) mkOptionDefault;20in21{22 options.fleetModules = mkOption {23 type = lazyAttrsOf unspecified;24 default = { };25 };26 options.fleetConfigurations = mkOption {27 type = lazyAttrsOf deferredModule;28 apply =29 nameToModule:30 mapAttrs (31 name: module: data:32 let33 # To use user-provided nixpkgs, we first need to extract wanted nixpkgs attribute,34 # to do that, evaluate all the modules with only needed option declared.35 bootstrapEval = lib.evalModules {36 modules = [37 module38 {39 options.nixpkgs.buildUsing = mkOption {40 description = ''41 Nixpkgs to use for fleetConfiguration evaluation.42 '';43 };44 config = {45 _module.check = false;46 nixpkgs.buildUsing = mkOptionDefault inputs.nixpkgs;47 };48 }49 ];50 };51 bootstrapNixpkgs = bootstrapEval.config.nixpkgs.buildUsing;52 normalEval = bootstrapNixpkgs.lib.evalModules {53 modules = (import ../modules/module-list.nix) ++ [54 module55 (56 { inputs', ... }:57 {58 config = {59 data = if isPath data then import data else data;60 nixpkgs.buildUsing = mkOptionDefault bootstrapNixpkgs;61 nixpkgs.overlays = [62 (final: prev: {63 inherit64 (import ../pkgs {65 inherit (prev) callPackage;66 inherit inputs';67 craneLib = crane.mkLib prev;68 })69 fleet-install-secrets70 fleet-generator-helper71 ;72 })73 ];74 };75 }76 )77 ];78 specialArgs = {79 inherit inputs self;80 fleetLib = import ../lib {81 inherit (bootstrapNixpkgs) lib;82 };83 _fleetFlakeRootConfig = config;84 };85 };86 in87 normalEval88 ) nameToModule;89 };90 config = {91 _module.args.fleetLib = import ../lib { inherit lib; };92 flake.fleetConfigurations = config.fleetConfigurations;93 flake.fleetModules = config.fleetModules;94 };9596 _file = ./flakePart.nix;97}