git.delta.rocks / jrsonnet / refs/commits / c02ef189daa2

difftreelog

refactor recurse less

Yaroslav Bolyukin2021-07-10parent: #c6d77aa.patch.diff
in: trunk

5 files changed

modifiedlib/default.nixdiffbeforeafterboth
1{1{
2 fleetConfiguration = { common ? { modules = []; }, hosts, nixpkgs }@args:2 fleetConfiguration = { nixpkgs, hosts, ... }@allConfig:
3 let
4 config = builtins.removeAttrs allConfig [ "nixpkgs" ];
5 in
3 rec {6 rec {
4 root = nixpkgs.lib.evalModules {7 root = nixpkgs.lib.evalModules {
5 modules = [8 modules =
9 (import ../modules/modules.nix) ++ [
10 config
6 (11 (
7 { ... }: {12 { ... }: {
13 options = { };
8 config = {14 config = {
9 inherit hosts;
10 # Secret data is available only via fleet build-systems15 # Secret data is available only via fleet build-systems
11 secrets = if builtins?getEnv then16 secrets =
17 if builtins?getEnv then
18
19 }24 }
20 )25 )
21 ] ++ common.modules ++ import ../modules/modules.nix {26 ];
22 pkgs = nixpkgs;
23 lib = nixpkgs.lib;
24 };
25
26 specialArgs = {27 specialArgs = {
28 inherit nixpkgs;
27 fleet = import ./fleetLib.nix {29 fleet = import ./fleetLib.nix {
28 inherit nixpkgs hosts;30 inherit nixpkgs hosts;
29 };31 };
40 };43 };
41 }44 }
42 ) (builtins.attrNames hosts)45 )
46 (builtins.attrNames root.config.hosts)
43 ); #nixpkgs.lib.nixosSystem {}47 ); #nixpkgs.lib.nixosSystem {}
44 };48 };
45}49}
modifiedlib/fleetLib.nixdiffbeforeafterboth

no syntactic changes

modifiedmodules/modules.nixdiffbeforeafterboth
1{ pkgs
2, lib
3, check ? true
4}:
5with lib; [1[
6 ./networking/wireguard2 ./networking/wireguard
7 ./root.nix3 ./root.nix
8]4]
modifiedmodules/networking/wireguard/default.nixdiffbeforeafterboth
1{ config, lib, nixpkgs, fleet, ... }: with lib; with fleet; let1{ config, lib, fleet, ... }: with lib; with fleet; let
2 cfg = config.networking.wireguard;2 cfg = config.networking.wireguard;
3 genWgKey = { owners }: {3 genWgKey = { owners }: {
4 inherit owners;4 inherit owners;
modifiedmodules/root.nixdiffbeforeafterboth
65 };65 };
66 };66 };
67 config = {};67 config = {
68 secrets =
69 if builtins?getEnv then
70 let
71 stringData = builtins.getEnv "SECRET_DATA";
72 in
73 if stringData != "" then (builtins.fromJSON stringData) else { }
74 else { };
75 };
68}76}
6977