git.delta.rocks / jrsonnet / refs/commits / 6fa49bc8c59c

difftreelog

fix baseModules arg

ntqvslxqYaroslav Bolyukin2026-02-03parent: #d0ea8ea.patch.diff
in: trunk

5 files changed

modifiedcrates/nix-eval/Cargo.tomldiffbeforeafterboth
--- a/crates/nix-eval/Cargo.toml
+++ b/crates/nix-eval/Cargo.toml
@@ -16,9 +16,9 @@
 cxx = "1.0.168"
 itertools = "0.14.0"
 test-log = { version = "0.2.18", features = ["trace"] }
+tokio.workspace = true
 tracing-indicatif = { version = "0.3.13", optional = true }
 vte = { version = "0.15.0", features = ["ansi"] }
-tokio.workspace = true
 
 [build-dependencies]
 bindgen = "0.72.0"
modifiedcrates/nix-eval/src/lib.rsdiffbeforeafterboth
--- a/crates/nix-eval/src/lib.rs
+++ b/crates/nix-eval/src/lib.rs
@@ -307,9 +307,8 @@
 	}
 }
 
-static GLOBAL_STATE: LazyLock<GlobalState> = LazyLock::new(|| {
-	GlobalState::new().expect("global state init shouldn't fail")
-});
+static GLOBAL_STATE: LazyLock<GlobalState> =
+	LazyLock::new(|| GlobalState::new().expect("global state init shouldn't fail"));
 
 thread_local! {
 	static THREAD_STATE: RefCell<ThreadState> = RefCell::new(ThreadState::new().expect("thread state init shouldn't fail"));
@@ -965,7 +964,9 @@
 	let runtime = TOKIO_FOR_NIX
 		.get()
 		.expect("init_tokio_for_nix was not called");
-	std::thread::spawn(move || runtime.block_on(f)).join().expect("await_in_nix inner thread panicked")
+	std::thread::spawn(move || runtime.block_on(f))
+		.join()
+		.expect("await_in_nix inner thread panicked")
 }
 
 unsafe extern "C" fn nix_primop_closure_adapter<const N: usize>(
modifiedmodules/nixos.nixdiffbeforeafterboth
after · modules/nixos.nix
1{2  lib,3  fleetLib,4  inputs,5  self,6  config,7  _fleetFlakeRootConfig,8  ...9}:10let11  inherit (lib.attrsets) mapAttrs;12  inherit (lib.options) mkOption;13  inherit (lib.types)14    deferredModule15    unspecified16    uniq17    str18    ;19  inherit (lib.strings) escapeNixIdentifier;20  inherit (fleetLib.options) mkHostsOption;2122  _file = ./nixos.nix;23in24{25  options = {26    nixos = mkOption {27      description = ''28        Shared nixos configuration module for all hosts.29      '';30      type = deferredModule;31    };32    hosts = mkHostsOption (33      hostArgs:34      let35        hostName = hostArgs.config._module.args.name;36      in37      {38        inherit _file;39        options = {40          name = mkOption {41            description = ''42              Host name (alias)43            '';44            type = uniq str;45            default = hostName;46          };47          nixos = mkOption {48            description = ''49              Nixos configuration for the current host.50            '';51            type = deferredModule;52            apply =53              module:54              let55                modulesPath = "${config.nixpkgs.buildUsing}/nixos/modules";56                baseModules = (import "${modulesPath}/module-list.nix");57                modules = baseModules ++ [58                  (module // { key = "attr<host.nixos>"; })59                  (config.nixos // { key = "attr<fleet.nixos>"; })60                ];61              in62              config.nixpkgs.buildUsing.lib.evalModules {63                class = "nixos";64                prefix = [65                  "fleetConfiguration"66                  "hosts"67                  hostName68                  "nixos"69                ];70                inherit modules;71                specialArgs = {72                  inherit73                    fleetLib74                    inputs75                    self76                    modulesPath77                    baseModules78                    modules79                    ;80                  noUserModules = baseModules;81                  extraModules = [ ];82                };83              };84          };85          nixos_unchecked = mkOption {86            type = unspecified;87          };88        };89        config = {90          nixos =91            let92              inherit (hostArgs.config) system;93            in94            {95              _module.args = {96                nixosHosts = mapAttrs (_: value: value.nixos_unchecked.config) config.hosts;97                hosts = config.hosts;98                host = hostArgs.config;99                fleetConfiguration = config;100101                inputs' = mapAttrs (102                  inputName: input:103                  builtins.addErrorContext104                    "while retrieving system-dependent attributes for input ${escapeNixIdentifier inputName}"105                    (106                      if input._type or null == "flake" then107                        _fleetFlakeRootConfig.perInput system input108                      else109                        "input is not a flake, perhaps flake = false was added to te input declaration?"110                    )111                ) inputs;112                self' = builtins.addErrorContext "while retrieving system-dependent attributes for a flake's own outputs" (113                  _fleetFlakeRootConfig.perInput system self114                );115              };116              nixpkgs.hostPlatform = system;117            };118          nixos_unchecked = hostArgs.config.nixos.extendModules {119            modules = [120              {121                _module.check = false;122              }123            ];124          };125        };126      }127    );128  };129  config.nixos.imports = import ./nixos/module-list.nix;130}
modifiedmodules/nixos/secrets.nixdiffbeforeafterboth
--- a/modules/nixos/secrets.nix
+++ b/modules/nixos/secrets.nix
@@ -142,7 +142,7 @@
         List of shared secrets, for which the current host was specified as `expectedOwners`
       '';
       type = listOf str;
-      default = [];
+      default = [ ];
       internal = true;
     };
     secrets = mkOption {
@@ -189,10 +189,7 @@
       {
         assertion =
           (secret.definition.generator == "shared") == hasSharedDefinition
-          && (
-            hasSharedDefinition
-            -> (elem host.name fleetConfiguration.secrets.${name}.expectedOwners)
-          );
+          && (hasSharedDefinition -> (elem host.name fleetConfiguration.secrets.${name}.expectedOwners));
         message =
           if hasSharedDefinition then
             "secret ${name} has host-specific secret generator, secrets with host-specific generators can not have shared generator in fleet configuration"
modifiedmodules/secrets.nixdiffbeforeafterboth
--- a/modules/secrets.nix
+++ b/modules/secrets.nix
@@ -83,9 +83,13 @@
     };
   };
   config = {
-    nixos = {host, ...}: {
-      _providedSharedSecrets = filter (name: elem host.name config.secrets.${name}.expectedOwners) (attrNames config.secrets);
-    };
+    nixos =
+      { host, ... }:
+      {
+        _providedSharedSecrets = filter (name: elem host.name config.secrets.${name}.expectedOwners) (
+          attrNames config.secrets
+        );
+      };
     nixpkgs.overlays = [
       (final: prev: {
         mkSecretGenerators =