git.delta.rocks / fleet / refs/commits / 347078813131

difftreelog

feat fleetConfiguration is not longer a function

mzxqtyzyYaroslav Bolyukin2026-07-07parent: #14689aa.patch.diff

2 files changed

modifiedcrates/fleet-base/src/opts.rsdiffbeforeafterboth
--- a/crates/fleet-base/src/opts.rs
+++ b/crates/fleet-base/src/opts.rs
@@ -242,7 +242,7 @@
 		let builtins_field = Value::eval("builtins")?;
 
 		let fleet_root = flake.get_field("fleetConfigurations")?;
-		let fleet_field = nix_go!(fleet_root.default(Obj {}));
+		let fleet_field = nix_go!(fleet_root.default);
 
 		let config_field = nix_go!(fleet_field.config);
 
modifiedlib/flakePart.nixdiffbeforeafterboth
after · lib/flakePart.nix
1{ 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: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            class = "fleet";37            prefix = [ "fleetConfiguration" ];38            modules = [39              module40              {41                options.nixpkgs.buildUsing = mkOption {42                  description = ''43                    Nixpkgs to use for fleetConfiguration evaluation.44                  '';45                };46                config = {47                  _module.check = false;48                  nixpkgs.buildUsing = mkOptionDefault inputs.nixpkgs;49                };50              }51            ];52          };53          bootstrapNixpkgs = bootstrapEval.config.nixpkgs.buildUsing;54          normalEval = bootstrapNixpkgs.lib.evalModules {55            class = "fleet";56            prefix = [ "fleetConfiguration" ];57            modules = (import ../modules/module-list.nix) ++ [58              module59              (60                { inputs, ... }:61                {62                  config = {63                    data = { };64                    nixpkgs.buildUsing = mkOptionDefault bootstrapNixpkgs;65                    nixpkgs.overlays = [66                      (final: prev: {67                        inherit68                          (import ../pkgs {69                            inherit (final) callPackage;70                            inherit inputs;71                            craneLib = crane.mkLib prev;72                          })73                          fleet-install-secrets74                          fleet-generator-helper75                          fleet-usbd76                          remowt-plugin-fleet77                          ;78                      })79                    ];80                  };81                }82              )83            ];84            specialArgs = {85              inherit inputs self;86              fleetLib = import ../lib {87                inherit (bootstrapNixpkgs) lib;88              };89              _fleetFlakeRootConfig = config;90            };91          };92        in93        normalEval94      ) nameToModule;95  };96  config = {97    _module.args.fleetLib = import ../lib { inherit lib; };98    flake.fleetConfigurations = config.fleetConfigurations;99    flake.fleetModules = config.fleetModules;100  };101102  _file = ./flakePart.nix;103}