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
30 inherit _file;38 inherit _file;
31 options = {39 options = {
32 name = mkOption {40 name = mkOption {
33 description = ''41 description = ''
34 Host name (alias)42 Host name (alias)
35 '';43 '';
36 type = uniq str;44 type = uniq str;
37 default = hostName;45 default = hostName;
38 };46 };
39 nixos = mkOption {47 nixos = mkOption {
40 description = ''48 description = ''
41 Nixos configuration for the current host.49 Nixos configuration for the current host.
42 '';50 '';
43 type = deferredModule;51 type = deferredModule;
44 apply =52 apply =
45 module:53 module:
46 let54 let
47 modulesPath = "${config.nixpkgs.buildUsing}/nixos/modules";55 modulesPath = "${config.nixpkgs.buildUsing}/nixos/modules";
48 in
49 config.nixpkgs.buildUsing.lib.evalModules {
50 class = "nixos";56 baseModules = (import "${modulesPath}/module-list.nix");
51 prefix = [
52 "fleetConfiguration"
53 "hosts"
54 hostName
55 "nixos"
56 ];
57 modules = (import "${modulesPath}/module-list.nix") ++ [57 modules = baseModules ++ [
58 (module // { key = "attr<host.nixos>"; })58 (module // { key = "attr<host.nixos>"; })
59 (config.nixos // { key = "attr<fleet.nixos>"; })59 (config.nixos // { key = "attr<fleet.nixos>"; })
60 ];60 ];
61 in
62 config.nixpkgs.buildUsing.lib.evalModules {
63 class = "nixos";
64 prefix = [
65 "fleetConfiguration"
66 "hosts"
67 hostName
68 "nixos"
69 ];
70 inherit modules;
61 specialArgs = {71 specialArgs = {
62 inherit72 inherit
63 fleetLib73 fleetLib
64 inputs74 inputs
65 self75 self
66 modulesPath76 modulesPath
77 baseModules
78 modules
67 ;79 ;
80 noUserModules = baseModules;
81 extraModules = [ ];
68 };82 };
69 };83 };
70 };84 };
71 nixos_unchecked = mkOption {85 nixos_unchecked = mkOption {
72 type = unspecified;86 type = unspecified;
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 =