From 90b76ff1b6bf1cdc1c431e1947b230d8fa7dc34e Mon Sep 17 00:00:00 2001 From: guangtao Date: Mon, 16 Oct 2023 23:33:58 -0700 Subject: [PATCH] chore: update flops --- flake.lock | 6 +++--- lib/exporter/flakeOutputs.nix | 2 +- lib/exporter/pops.nix | 4 ++-- lib/mapPopsLayouts'.nix | 4 ++-- lib/mapPopsLayouts.nix | 4 ++-- local/cells/repo/shells.nix | 2 +- templates/nixos/nix/lib/exporter/flakeOutputs.nix | 12 +++++++++--- templates/nixos/nix/lib/exporter/inputs.nix | 6 +++--- tests/devshell/expr.nix | 8 ++++---- tests/flake-parts/expr.nix | 8 ++++---- tests/nixos/__fixture/pops/homeModules.nix | 2 +- tests/nixos/__fixture/pops/homeProfiles.nix | 2 +- tests/nixos/__fixture/pops/inputs.nix | 10 +++++----- tests/nixos/__fixture/pops/nixosModules.nix | 2 +- tests/nixos/__fixture/pops/nixosProfiles.nix | 2 +- tests/nixos/__fixture/pops/srvos.nix | 2 +- 16 files changed, 41 insertions(+), 35 deletions(-) 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..f4586bd 100644 --- a/lib/exporter/flakeOutputs.nix +++ b/lib/exporter/flakeOutputs.nix @@ -36,7 +36,7 @@ in dotfiles = inputs.self.outPath + "/dotfiles"; # aliases - __inputs__ = outputs.loadInputs; + __inputs__ = outputs.flake; 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..e5f4527 100644 --- a/lib/mapPopsLayouts'.nix +++ b/lib/mapPopsLayouts'.nix @@ -1,5 +1,5 @@ { lib }: pops: -lib.mapAttrsRecursiveCond ((as: !(as ? "layouts" || as ? "outputs"))) - (_: v: v.layouts or v.outputs) +lib.mapAttrsRecursiveCond ((as: !(as ? "layouts" || as ? "initInputs"))) + (_: v: v.layouts or v.inputs) pops diff --git a/lib/mapPopsLayouts.nix b/lib/mapPopsLayouts.nix index b7d966f..99a980f 100644 --- a/lib/mapPopsLayouts.nix +++ b/lib/mapPopsLayouts.nix @@ -1,6 +1,6 @@ { lib }: pops: lib.mapAttrsRecursiveCond - ((as: !(as ? "layouts" && as.layouts ? "default" || as ? "outputs"))) - (_: v: v.layouts.default or v.outputs) + ((as: !(as ? "layouts" && as.layouts ? "default" || as ? "initInputs"))) + (_: v: v.layouts.default or v.inputs) 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/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/inputs.nix b/templates/nixos/nix/lib/exporter/inputs.nix index 29aefb8..10ee3f1 100644 --- a/templates/nixos/nix/lib/exporter/inputs.nix +++ b/templates/nixos/nix/lib/exporter/inputs.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/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..c3a959c 100644 --- a/tests/flake-parts/expr.nix +++ b/tests/flake-parts/expr.nix @@ -9,19 +9,19 @@ let system = "x86_64-linux"; __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 { 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..1de2bf8 100644 --- a/tests/nixos/__fixture/pops/homeProfiles.nix +++ b/tests/nixos/__fixture/pops/homeProfiles.nix @@ -2,7 +2,7 @@ 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; }; diff --git a/tests/nixos/__fixture/pops/inputs.nix b/tests/nixos/__fixture/pops/inputs.nix index ccf4501..77513c8 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.outputs.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 (