git.delta.rocks / jrsonnet / refs/commits / 13f8ec8b964e

difftreelog

fix secret generation

Yaroslav Bolyukin2024-09-09parent: #ef18a9f.patch.diff
in: trunk

3 files changed

modifiedcrates/fleet-base/src/host.rsdiffbeforeafterboth
6161
62 pub host_config: Option<Value>,62 pub host_config: Option<Value>,
63 pub nixos_config: OnceCell<Value>,63 pub nixos_config: OnceCell<Value>,
64 pub pkgs_override: Option<Value>,
6465
65 // TODO: Move command helpers away with connectivity refactor66 // TODO: Move command helpers away with connectivity refactor
66 pub local: bool,67 pub local: bool,
297298
298 /// Packages for this host, resolved with nixpkgs overlays299 /// Packages for this host, resolved with nixpkgs overlays
299 pub async fn pkgs(&self) -> Result<Value> {300 pub async fn pkgs(&self) -> Result<Value> {
301 if let Some(value) = &self.pkgs_override {
302 return Ok(value.clone());
303 }
300 let Some(host_config) = &self.host_config else {304 let Some(host_config) = &self.host_config else {
301 bail!("local host has no host_config");305 bail!("local host has no host_config");
302 };306 };
310 ConfigHost {314 ConfigHost {
311 config: self.clone(),315 config: self.clone(),
312 name: "<virtual localhost>".to_owned(),316 name: "<virtual localhost>".to_owned(),
313 local: true,
314 session: OnceLock::new(),
315 host_config: None,317 host_config: None,
316 nixos_config: OnceCell::new(),318 nixos_config: OnceCell::new(),
317 groups: {319 groups: {
318 let cell = OnceCell::new();320 let cell = OnceCell::new();
319 let _ = cell.set(vec![]);321 let _ = cell.set(vec![]);
320 cell322 cell
321 },323 },
324 pkgs_override: Some(self.default_pkgs.clone()),
325
326 local: true,
327 session: OnceLock::new(),
322 }328 }
323 }329 }
324330
332 host_config: Some(host_config),338 host_config: Some(host_config),
333 nixos_config: OnceCell::new(),339 nixos_config: OnceCell::new(),
334 groups: OnceCell::new(),340 groups: OnceCell::new(),
335 341 pkgs_override: None,
342
336 // TODO: Remove with connectivit refactor343 // TODO: Remove with connectivit refactor
337 local: self.localhost == name,344 local: self.localhost == name,
modifiedcrates/fleet-base/src/opts.rsdiffbeforeafterboth
196196
197 let import = nix_go!(builtins_field.import);197 let import = nix_go!(builtins_field.import);
198 let overlays = nix_go!(config_field.nixpkgs.overlays);198 let overlays = nix_go!(config_field.nixpkgs.overlays);
199 let nixpkgs = nix_go!(fleet_field.nixpkgs.buildUsing | import);199 let nixpkgs = nix_go!(config_field.nixpkgs.buildUsing | import);
200200
201 let default_pkgs = nix_go!(nixpkgs(Obj {201 let default_pkgs = nix_go!(nixpkgs(Obj {
202 overlays,202 overlays,
203 system: { self.local_system.clone() },203 system: { local_system.clone() },
204 }));204 }));
205205
206 Ok(Config(Arc::new(FleetConfigInternals {206 Ok(Config(Arc::new(FleetConfigInternals {
modifiedlib/flakePart.nixdiffbeforeafterboth
9 inherit (lib.attrsets) mapAttrs;9 inherit (lib.attrsets) mapAttrs;
10 inherit (lib.types) lazyAttrsOf deferredModule unspecified;10 inherit (lib.types) lazyAttrsOf deferredModule unspecified;
11 inherit (lib.strings) isPath;11 inherit (lib.strings) isPath;
12 inherit (fleetLib.options) mkHostsOption;
13in {12in {
14 options.fleetModules = mkOption {13 options.fleetModules = mkOption {
15 type = lazyAttrsOf unspecified;14 type = lazyAttrsOf unspecified;
42 ++ [41 ++ [
43 module42 module
44 {43 {
45 options.hosts = mkHostsOption {44 config = {
45 data =
46 if isPath data
47 then import data
48 else data;
46 nixos.nixpkgs.overlays = [49 nixpkgs.overlays = [
47 (final: prev:50 (final: prev:
48 import ../pkgs {51 import ../pkgs {
49 inherit (prev) callPackage;52 inherit (prev) callPackage;
50 craneLib = crane.mkLib prev;53 craneLib = crane.mkLib prev;
51 })54 })
52 ];55 ];
53 };56 };
54 config = {
55 data =
56 if isPath data
57 then import data
58 else data;
59 };
60 }57 }
61 ];58 ];
62 specialArgs = {59 specialArgs = {