diff --git a/flake.lock b/flake.lock index 3ad6926..1476948 100644 --- a/flake.lock +++ b/flake.lock @@ -78,11 +78,11 @@ "yants": "yants" }, "locked": { - "lastModified": 1697286215, - "narHash": "sha256-c2ikSdh12SYLoOs2hQG1bvSMfV7aO/S1+2BNbdyBUuw=", + "lastModified": 1697524403, + "narHash": "sha256-s9xi3msMYedaTY5hojT48XJSakvrsX8qrmfPEsg1Gao=", "owner": "gtrunsec", "repo": "flops", - "rev": "94a3d0fe7581e3e91727dab7abf4e0728716dd0f", + "rev": "8e985bcff0f9fbdacb1cc2fdc08c3a7c4823c880", "type": "github" }, "original": { diff --git a/lib/exporter/flakeOutputs.nix b/lib/exporter/flakeOutputs.nix index cdc8175..7e98b4c 100644 --- a/lib/exporter/flakeOutputs.nix +++ b/lib/exporter/flakeOutputs.nix @@ -12,6 +12,7 @@ in homeModules devshellModules devshellProfiles + flake ; units = { @@ -36,7 +37,6 @@ in dotfiles = inputs.self.outPath + "/dotfiles"; # aliases - __inputs__ = outputs.loadInputs; flakeModules = outputs.flake-parts.profiles; flakeProfiles = outputs.flake-parts.modules; } diff --git a/lib/exporter/pops.nix b/lib/exporter/pops.nix index 9eb4aa6..4f14995 100644 --- a/lib/exporter/pops.nix +++ b/lib/exporter/pops.nix @@ -8,7 +8,7 @@ let }; in { - loadInputs = flops.flake.pops.default.setInitInputs ( + flake = flops.flake.pops.default.setInitInputs ( inputs.self.outPath + "/local/lock" ); @@ -73,7 +73,7 @@ in }; srvos = flops.haumea.pops.default.setInit { - src = self.loadInputs.outputs.srvos + "/nixos"; + src = self.flake.inputs.srvos + "/nixos"; type = "nixosProfiles"; # reset the transformer to the default transformer = [ (_: _: _) ]; diff --git a/lib/mapPopsLayouts'.nix b/lib/mapPopsLayouts'.nix index 7c24bdf..702693f 100644 --- a/lib/mapPopsLayouts'.nix +++ b/lib/mapPopsLayouts'.nix @@ -1,5 +1,3 @@ { lib }: pops: -lib.mapAttrsRecursiveCond ((as: !(as ? "layouts" || as ? "outputs"))) - (_: v: v.layouts or v.outputs) - pops +lib.mapAttrsRecursiveCond ((as: !(as ? "layouts"))) (_: v: v.layouts or v) pops diff --git a/lib/mapPopsLayouts.nix b/lib/mapPopsLayouts.nix index b7d966f..2eb8449 100644 --- a/lib/mapPopsLayouts.nix +++ b/lib/mapPopsLayouts.nix @@ -1,6 +1,5 @@ { lib }: pops: -lib.mapAttrsRecursiveCond - ((as: !(as ? "layouts" && as.layouts ? "default" || as ? "outputs"))) - (_: v: v.layouts.default or v.outputs) +lib.mapAttrsRecursiveCond ((as: !(as ? "layouts" && as.layouts ? "default"))) + (_: v: v.layouts.default or v) pops diff --git a/local/cells/repo/shells.nix b/local/cells/repo/shells.nix index a7bcb23..834643c 100755 --- a/local/cells/repo/shells.nix +++ b/local/cells/repo/shells.nix @@ -8,7 +8,7 @@ let inherit (inputs) nixpkgs; devshellProfiles = let - __inptus__ = (inputs.omnibus.pops.loadInputs.setSystem nixpkgs.system).outputs; + __inptus__ = (inputs.omnibus.pops.flake.setSystem nixpkgs.system).inputs; in (inputs.omnibus.devshell.loadProfiles.addLoadExtender { inputs = { diff --git a/templates/nixos/flake.lock b/templates/nixos/flake.lock index dd65ff3..6487926 100644 --- a/templates/nixos/flake.lock +++ b/templates/nixos/flake.lock @@ -139,11 +139,11 @@ "yants": "yants" }, "locked": { - "lastModified": 1697013157, - "narHash": "sha256-cu7V3jcTqk+zzEwPGNWj61nD76Fe8KZgN/BtuNO5rZQ=", + "lastModified": 1697524403, + "narHash": "sha256-s9xi3msMYedaTY5hojT48XJSakvrsX8qrmfPEsg1Gao=", "owner": "gtrunsec", "repo": "flops", - "rev": "dd2aeb15b7d4c4ccc3d6c03aed403f0e14b1127a", + "rev": "8e985bcff0f9fbdacb1cc2fdc08c3a7c4823c880", "type": "github" }, "original": { @@ -403,11 +403,11 @@ ] }, "locked": { - "lastModified": 1697282052, - "narHash": "sha256-5zgxmgqWbe7iZn4EGM4fGT1u6+yw0Fh7aoiOXecPRHA=", + "lastModified": 1697524438, + "narHash": "sha256-6tNE9XlJOMriM+bideQwXWDTK57ppAp7jTWChnEngBk=", "owner": "gtrunsec", "repo": "omnibus", - "rev": "e120bc53d46b942681335b21d0ef69a740d189d2", + "rev": "90b76ff1b6bf1cdc1c431e1947b230d8fa7dc34e", "type": "github" }, "original": { diff --git a/templates/nixos/nix/lib/exporter/flakeOutputs.nix b/templates/nixos/nix/lib/exporter/flakeOutputs.nix index 4986a17..cb274ea 100644 --- a/templates/nixos/nix/lib/exporter/flakeOutputs.nix +++ b/templates/nixos/nix/lib/exporter/flakeOutputs.nix @@ -1,3 +1,9 @@ +{ + lib, + super, + omnibus, + eachSystem, +}: let filterConfigs = config: @@ -17,13 +23,13 @@ in system: let inputs' = (super.inputs.setSystem system).outputs; - loadDataAll = + dataAll = (super.pops.omnibus.lib.addLoadExtender { load.inputs.inputs = inputs'; }) - .layouts.default.loadDataAll; + .layouts.default.exporter.pops.loadDataAll; in { data = - (loadDataAll.addLoadExtender { load.src = projectDir + "/local/data"; }) + (dataAll.addLoadExtender { load.src = projectDir + "/local/data"; }) .layouts.default; } ); diff --git a/templates/nixos/nix/lib/exporter/hosts.nix b/templates/nixos/nix/lib/exporter/hosts.nix index 63f230b..53856e5 100644 --- a/templates/nixos/nix/lib/exporter/hosts.nix +++ b/templates/nixos/nix/lib/exporter/hosts.nix @@ -2,7 +2,7 @@ load = { src = inputs.self.outPath + "/nixos/hosts"; inputs = { - inputs = inputs // root.exporter.inputs; + inputs = inputs // root.exporter.pops.flake.inputs; omnibus = inputs.omnibus // { self = root.omnibus.lib.layouts.default; }; diff --git a/templates/nixos/nix/lib/exporter/pops/__hostsFun/darwinModules.nix b/templates/nixos/nix/lib/exporter/pops/__hostsFun/darwinModules.nix index 89c8971..45325a0 100644 --- a/templates/nixos/nix/lib/exporter/pops/__hostsFun/darwinModules.nix +++ b/templates/nixos/nix/lib/exporter/pops/__hostsFun/darwinModules.nix @@ -1,10 +1,6 @@ -{ - omnibus, - root, - inputs, -}: +{ root, inputs }: name: -(omnibus.pops.nixosModules.addLoadExtender { +(root.exporter.pops.nixosModules.addLoadExtender { load = { src = root.filterPopsSrc (inputs.self.outPath + "/nixos/hosts/${name}") diff --git a/templates/nixos/nix/lib/exporter/pops/__hostsFun/darwinProfiles.nix b/templates/nixos/nix/lib/exporter/pops/__hostsFun/darwinProfiles.nix index ade311a..3f5abe6 100644 --- a/templates/nixos/nix/lib/exporter/pops/__hostsFun/darwinProfiles.nix +++ b/templates/nixos/nix/lib/exporter/pops/__hostsFun/darwinProfiles.nix @@ -1,10 +1,6 @@ -{ - omnibus, - root, - inputs, -}: +{ root, inputs }: name: -(omnibus.pops.nixosModules.addLoadExtender { +(root.exporter.pops.nixosModules.addLoadExtender { load = { src = root.filterPopsSrc (inputs.self.outPath + "/nixos/hosts/${name}") diff --git a/templates/nixos/nix/lib/exporter/pops/__hostsFun/homeModules.nix b/templates/nixos/nix/lib/exporter/pops/__hostsFun/homeModules.nix index 284a41d..dd904c5 100644 --- a/templates/nixos/nix/lib/exporter/pops/__hostsFun/homeModules.nix +++ b/templates/nixos/nix/lib/exporter/pops/__hostsFun/homeModules.nix @@ -1,10 +1,6 @@ -{ - omnibus, - root, - inputs, -}: +{ root, inputs }: name: -(omnibus.pops.homeModules.addLoadExtender { +(root.exporter.pops.homeModules.addLoadExtender { load = { src = root.filterPopsSrc (inputs.self.outPath + "/nixos/hosts/${name}") diff --git a/templates/nixos/nix/lib/exporter/pops/__hostsFun/homeProfiles.nix b/templates/nixos/nix/lib/exporter/pops/__hostsFun/homeProfiles.nix index 03e0f22..d608de3 100644 --- a/templates/nixos/nix/lib/exporter/pops/__hostsFun/homeProfiles.nix +++ b/templates/nixos/nix/lib/exporter/pops/__hostsFun/homeProfiles.nix @@ -1,10 +1,6 @@ -{ - omnibus, - root, - inputs, -}: +{ root, inputs }: name: -(omnibus.pops.homeProfiles.addLoadExtender { +(root.exporter.pops.homeProfiles.addLoadExtender { load = { src = root.filterPopsSrc (inputs.self.outPath + "/nixos/hosts/${name}") diff --git a/templates/nixos/nix/lib/exporter/pops/__hostsFun/nixosModules.nix b/templates/nixos/nix/lib/exporter/pops/__hostsFun/nixosModules.nix index c9a5a1e..37c1b23 100644 --- a/templates/nixos/nix/lib/exporter/pops/__hostsFun/nixosModules.nix +++ b/templates/nixos/nix/lib/exporter/pops/__hostsFun/nixosModules.nix @@ -1,10 +1,6 @@ -{ - omnibus, - root, - inputs, -}: +{ root, inputs }: name: -(omnibus.pops.nixosModules.addLoadExtender { +(root.exporter.pops.nixosModules.addLoadExtender { load = { src = root.filterPopsSrc (inputs.self.outPath + "/nixos/hosts/${name}") diff --git a/templates/nixos/nix/lib/exporter/pops/__hostsFun/nixosProfiles.nix b/templates/nixos/nix/lib/exporter/pops/__hostsFun/nixosProfiles.nix index 7588d21..03e248d 100644 --- a/templates/nixos/nix/lib/exporter/pops/__hostsFun/nixosProfiles.nix +++ b/templates/nixos/nix/lib/exporter/pops/__hostsFun/nixosProfiles.nix @@ -1,10 +1,6 @@ -{ - omnibus, - root, - inputs, -}: +{ root, inputs }: name: -(omnibus.pops.nixosProfiles.addLoadExtender { +(root.exporter.pops.nixosProfiles.addLoadExtender { load = { src = root.filterPopsSrc (inputs.self.outPath + "/nixos/hosts/${name}") diff --git a/templates/nixos/nix/lib/exporter/inputs.nix b/templates/nixos/nix/lib/exporter/pops/flake.nix similarity index 53% rename from templates/nixos/nix/lib/exporter/inputs.nix rename to templates/nixos/nix/lib/exporter/pops/flake.nix index 29aefb8..a7afa89 100644 --- a/templates/nixos/nix/lib/exporter/inputs.nix +++ b/templates/nixos/nix/lib/exporter/pops/flake.nix @@ -1,13 +1,13 @@ -(omnibus.pops.loadInputs.addInputsExtender ( +(omnibus.pops.flake.addInputsExtender ( POP.extendPop flops.flake.pops.inputsExtender ( self: super: let - selfInputs = omnibus.pops.loadInputs.setInitInputs ../__lock; + selfInputs = omnibus.pops.flake.setInitInputs ../../__lock; in { inputs = { nixpkgs = inputs.nixpkgs.legacyPackages; - } // selfInputs.outputs; + } // selfInputs.inputs; } ) )) diff --git a/templates/nixos/nix/lib/exporter/pops/omnibus/lib.nix b/templates/nixos/nix/lib/exporter/pops/omnibus/lib.nix index e3c8d15..a4f6d8c 100644 --- a/templates/nixos/nix/lib/exporter/pops/omnibus/lib.nix +++ b/templates/nixos/nix/lib/exporter/pops/omnibus/lib.nix @@ -1,5 +1,5 @@ omnibus.pops.lib.addLoadExtender { load.inputs = { - inputs = inputs // root.exporter.inputs.outputs; + inputs = inputs // root.exporter.pops.flake.inputs; }; } diff --git a/templates/nixos/nix/lib/filterPopsSrc.nix b/templates/nixos/nix/lib/filterPopsSrc.nix index caf6f7f..36830ba 100644 --- a/templates/nixos/nix/lib/filterPopsSrc.nix +++ b/templates/nixos/nix/lib/filterPopsSrc.nix @@ -1,7 +1,7 @@ { lib, root }: src: dir: let - inherit (root.exporter.inputs.outputs) nix-filter; + inherit (root.exporter.pops.flake.inputs) nix-filter; popsDirs = lib.attrNames ( lib.removeAttrs root.exporter.pops [ "hosts" diff --git a/templates/nixos/nixos/hosts/nixos/layouts.nix b/templates/nixos/nixos/hosts/nixos/layouts.nix index aacafc6..897f6a1 100644 --- a/templates/nixos/nixos/hosts/nixos/layouts.nix +++ b/templates/nixos/nixos/hosts/nixos/layouts.nix @@ -1,6 +1,6 @@ let outputs = inputs.self; - host = inputs.self.hosts.nixos; + self' = inputs.self.hosts.nixos; in { system = "x86_64-linux"; @@ -8,7 +8,7 @@ in data = outputs.data.default; nixosSuites = lib.flatten [ - host.nixosProfiles.bootstrap + self'.nixosProfiles.bootstrap outputs.nixosProfiles.presets.boot # outputs.nixosModules.default.programs.git diff --git a/tests/data/expr.nix b/tests/data/expr.nix index 94906aa..c802c5d 100644 --- a/tests/data/expr.nix +++ b/tests/data/expr.nix @@ -1,6 +1,6 @@ { omnibus }: let - inherit (omnibus.__inputs__) nixpkgs; + inherit (omnibus.flake.inputs) nixpkgs; dataAll = (omnibus.pops.lib.addLoadExtender { load = { diff --git a/tests/devshell/expr.nix b/tests/devshell/expr.nix index 35d86f7..6ee3652 100644 --- a/tests/devshell/expr.nix +++ b/tests/devshell/expr.nix @@ -7,20 +7,20 @@ let inputs = let - baseInputs = omnibus.pops.loadInputs.setInitInputs ./__lock; + baseInputs = omnibus.pops.flake.setInitInputs ./__lock; in ((baseInputs.addInputsExtender ( POP.lib.extendPop flops.lib.flake.pops.inputsExtender ( self: super: { inputs = { - devshell = baseInputs.outputs.devshell.legacyPackages; - nixpkgs = baseInputs.outputs.nixpkgs.legacyPackages; + devshell = baseInputs.inputs.devshell.legacyPackages; + nixpkgs = baseInputs.inputs.nixpkgs.legacyPackages; }; } ) )).setSystem "x86_64-linux" - ).outputs; + ).inputs; devshellProfiles = (omnibus.pops.devshellProfiles.addLoadExtender { diff --git a/tests/flake-parts/expr.nix b/tests/flake-parts/expr.nix index 8a1f365..36cfc28 100644 --- a/tests/flake-parts/expr.nix +++ b/tests/flake-parts/expr.nix @@ -7,44 +7,44 @@ }: let system = "x86_64-linux"; - __inputs__ = + flake.inputs = let - loadInputs = omnibus.pops.loadInputs.setInitInputs ./__lock; + flake = omnibus.pops.flake.setInitInputs ./__lock; in - ((loadInputs.addInputsExtender ( + ((flake.addInputsExtender ( POP.lib.extendPop flops.lib.flake.pops.inputsExtender ( self: super: { inputs = { - nixpkgs = loadInputs.outputs.nixpkgs.legacyPackages; + nixpkgs = flake.inputs.nixpkgs.legacyPackages; }; } ) )).setSystem system - ).outputs; + ).inputs; flakeProfiles = (omnibus.pops.flake-parts.profiles.addLoadExtender { load = { inputs = { inputs = { - inherit (__inputs__) chinookDb; + inherit (flake.inputs) chinookDb; }; }; }; }).layouts.default.process-compose; mkFlake = - __inputs__.flake-parts.lib.mkFlake + flake.inputs.flake-parts.lib.mkFlake { - inputs = __inputs__ // { + inputs = flake.inputs // { # fake self argument to make sure that the flake is self = inputs.self; }; } { systems = [ system ]; - imports = [ __inputs__.process-compose-flake.flakeModule ]; + imports = [ flake.inputs.process-compose-flake.flakeModule ]; perSystem = { self', ... }: { imports = [ flakeProfiles.sqlite-example ]; }; }; in diff --git a/tests/makes/expr.nix b/tests/makes/expr.nix index b7e7d4b..b97706e 100644 --- a/tests/makes/expr.nix +++ b/tests/makes/expr.nix @@ -1,6 +1,6 @@ { omnibus, lib }: let - inherit (omnibus.__inputs__) nixpkgs makes; + inherit (omnibus.flake.inputs) nixpkgs makes; makesLib = (omnibus.pops.lib.addLoadExtender { load = { diff --git a/tests/nixos/__fixture/pops/homeModules.nix b/tests/nixos/__fixture/pops/homeModules.nix index cfd745d..1d67bb7 100644 --- a/tests/nixos/__fixture/pops/homeModules.nix +++ b/tests/nixos/__fixture/pops/homeModules.nix @@ -4,7 +4,7 @@ in (omnibus.pops.homeModules.addLoadExtender { load.inputs = { __misc__ = { - inherit (super.inputs.outputs) catppuccin-bat; + inherit (super.inputs.inputs) catppuccin-bat; }; }; }).addExporters diff --git a/tests/nixos/__fixture/pops/homeProfiles.nix b/tests/nixos/__fixture/pops/homeProfiles.nix index 0c10529..299d9bd 100644 --- a/tests/nixos/__fixture/pops/homeProfiles.nix +++ b/tests/nixos/__fixture/pops/homeProfiles.nix @@ -2,12 +2,12 @@ let inherit (inputs) dmerge; in (omnibus.pops.homeProfiles.addLoadExtender { - load.inputs = super.inputs.outputs // { + load.inputs = super.inputs.inputs // { omnibus = { homeModules = super.homeModules.layouts.nixosModules; }; inputs = { - inherit (omnibus.__inputs__) nur; + inherit (omnibus.flake.inputs) nur; }; }; }).addExporters diff --git a/tests/nixos/__fixture/pops/inputs.nix b/tests/nixos/__fixture/pops/inputs.nix index ccf4501..b374769 100644 --- a/tests/nixos/__fixture/pops/inputs.nix +++ b/tests/nixos/__fixture/pops/inputs.nix @@ -1,15 +1,15 @@ -(omnibus.pops.loadInputs.addInputsExtender ( +(omnibus.pops.flake.addInputsExtender ( POP.extendPop flops.flake.pops.inputsExtender ( self: super: let - selfInputs = omnibus.pops.loadInputs.setInitInputs ../__lock; - local = omnibus.pops.loadInputs.setInitInputs (inputs.self.outPath + "/local"); + selfInputs = omnibus.pops.flake.setInitInputs ../__lock; + local = omnibus.pops.flake.setInitInputs (inputs.self.outPath + "/local"); in { inputs = { std = local.outputs.std; - nixpkgs = omnibus.pops.loadInputs.outputs.nixpkgs.legacyPackages; - } // selfInputs.outputs; + nixpkgs = omnibus.pops.flake.inputs.nixpkgs.legacyPackages; + } // selfInputs.inputs; } ) )).setSystem diff --git a/tests/nixos/__fixture/pops/nixosModules.nix b/tests/nixos/__fixture/pops/nixosModules.nix index 163ded2..4b9cb1f 100644 --- a/tests/nixos/__fixture/pops/nixosModules.nix +++ b/tests/nixos/__fixture/pops/nixosModules.nix @@ -2,7 +2,7 @@ let inherit (inputs) dmerge; in (omnibus.pops.nixosModules.addLoadExtender { - load.inputs = super.inputs.outputs // { }; + load.inputs = super.inputs.inputs // { }; }).addExporters [ (POP.extendPop flops.haumea.pops.exporter ( diff --git a/tests/nixos/__fixture/pops/nixosProfiles.nix b/tests/nixos/__fixture/pops/nixosProfiles.nix index d652202..646cb0d 100644 --- a/tests/nixos/__fixture/pops/nixosProfiles.nix +++ b/tests/nixos/__fixture/pops/nixosProfiles.nix @@ -3,7 +3,7 @@ let in (omnibus.pops.nixosProfiles.addLoadExtender { load = { - inputs = super.inputs.outputs // { + inputs = super.inputs.inputs // { omnibus = { nixosModules = super.nixosModules.layouts.nixosModules; }; diff --git a/tests/nixos/__fixture/pops/srvos.nix b/tests/nixos/__fixture/pops/srvos.nix index 3bdf8f5..7c0c5a0 100644 --- a/tests/nixos/__fixture/pops/srvos.nix +++ b/tests/nixos/__fixture/pops/srvos.nix @@ -1,5 +1,5 @@ (omnibus.pops.srvos.addLoadExtender { - load.inputs = super.inputs.outputs // { }; + load.inputs = super.inputs.inputs // { }; }).addExporters [ (POP.extendPop flops.haumea.pops.exporter ( diff --git a/tests/nixos/_pops.nix b/tests/nixos/_pops.nix index aa3b617..bc69161 100644 --- a/tests/nixos/_pops.nix +++ b/tests/nixos/_pops.nix @@ -5,7 +5,7 @@ inputs = { data = root.data; inputs = { - inherit (omnibus.__inputs__) darwin nixpkgs home-manager; + inherit (omnibus.flake.inputs) darwin nixpkgs home-manager; }; }; };