difftreelog
fix baseModules arg
in: trunk
5 files changed
crates/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"
crates/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>(
modules/nixos.nixdiffbeforeafterboth1{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) deferredModule unspecified uniq str;14 inherit (lib.strings) escapeNixIdentifier;15 inherit (fleetLib.options) mkHostsOption;1617 _file = ./nixos.nix;18in19{20 options = {21 nixos = mkOption {22 description = ''23 Shared nixos configuration module for all hosts.24 '';25 type = deferredModule;26 };27 hosts = mkHostsOption (hostArgs: let28 hostName = hostArgs.config._module.args.name;29 in {30 inherit _file;31 options = {32 name = mkOption {33 description = ''34 Host name (alias)35 '';36 type = uniq str;37 default = hostName;38 };39 nixos = mkOption {40 description = ''41 Nixos configuration for the current host.42 '';43 type = deferredModule;44 apply =45 module:46 let47 modulesPath = "${config.nixpkgs.buildUsing}/nixos/modules";48 in49 config.nixpkgs.buildUsing.lib.evalModules {50 class = "nixos";51 prefix = [52 "fleetConfiguration"53 "hosts"54 hostName55 "nixos"56 ];57 modules = (import "${modulesPath}/module-list.nix") ++ [58 (module // { key = "attr<host.nixos>"; })59 (config.nixos // { key = "attr<fleet.nixos>"; })60 ];61 specialArgs = {62 inherit63 fleetLib64 inputs65 self66 modulesPath67 ;68 };69 };70 };71 nixos_unchecked = mkOption {72 type = unspecified;73 };74 };75 config = {76 nixos =77 let78 inherit (hostArgs.config) system;79 in80 {81 _module.args = {82 nixosHosts = mapAttrs (_: value: value.nixos_unchecked.config) config.hosts;83 hosts = config.hosts;84 host = hostArgs.config;85 fleetConfiguration = config;8687 inputs' = mapAttrs (88 inputName: input:89 builtins.addErrorContext90 "while retrieving system-dependent attributes for input ${escapeNixIdentifierinputName}"91 (92 if input._type or null == "flake" then93 _fleetFlakeRootConfig.perInput system input94 else95 "input is not a flake, perhaps flake = false was added to te input declaration?"96 )97 ) inputs;98 self' = builtins.addErrorContext "while retrieving system-dependent attributes for a flake's own outputs" (99 _fleetFlakeRootConfig.perInput system self100 );101 };102 nixpkgs.hostPlatform = system;103 };104 nixos_unchecked = hostArgs.config.nixos.extendModules {105 modules = [106 {107 _module.check = false;108 }109 ];110 };111 };112 });113 };114 config.nixos.imports = import ./nixos/module-list.nix;115}modules/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"
modules/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 =