diff --git a/lib/__init.nix b/lib/__init.nix index b17628c..d2cb439 100644 --- a/lib/__init.nix +++ b/lib/__init.nix @@ -18,7 +18,6 @@ flops.lib.haumea.pops.default.setInit { inherit omnibus; inputs = inputs // { dmerge = flops.inputs.dmerge; - home-manager = omnibus.pops.loadInputs.outputs.home-manager; }; }; } diff --git a/lib/mapPopsLayouts'.nix b/lib/mapPopsLayouts'.nix new file mode 100644 index 0000000..7c24bdf --- /dev/null +++ b/lib/mapPopsLayouts'.nix @@ -0,0 +1,5 @@ +{ lib }: +pops: +lib.mapAttrsRecursiveCond ((as: !(as ? "layouts" || as ? "outputs"))) + (_: v: v.layouts or v.outputs) + pops diff --git a/templates/nixos/flake.lock b/templates/nixos/flake.lock index 27b3332..34d19ed 100644 --- a/templates/nixos/flake.lock +++ b/templates/nixos/flake.lock @@ -403,11 +403,11 @@ ] }, "locked": { - "lastModified": 1697190114, - "narHash": "sha256-5Nqz7gk2pE6Wfi3pZvIT2hnixc+O6/is4J0+T7B54c8=", + "lastModified": 1697282052, + "narHash": "sha256-5zgxmgqWbe7iZn4EGM4fGT1u6+yw0Fh7aoiOXecPRHA=", "owner": "gtrunsec", "repo": "omnibus", - "rev": "47fd9ad0d16107f1b6bfd4fe0a03c68223fad32b", + "rev": "e120bc53d46b942681335b21d0ef69a740d189d2", "type": "github" }, "original": { diff --git a/templates/nixos/nix/lib/exporter/pops/_hostsFun/darwinModules.nix b/templates/nixos/nix/lib/exporter/pops/__hostsFun/darwinModules.nix similarity index 100% rename from templates/nixos/nix/lib/exporter/pops/_hostsFun/darwinModules.nix rename to templates/nixos/nix/lib/exporter/pops/__hostsFun/darwinModules.nix diff --git a/templates/nixos/nix/lib/exporter/pops/_hostsFun/darwinProfiles.nix b/templates/nixos/nix/lib/exporter/pops/__hostsFun/darwinProfiles.nix similarity index 100% rename from templates/nixos/nix/lib/exporter/pops/_hostsFun/darwinProfiles.nix rename to templates/nixos/nix/lib/exporter/pops/__hostsFun/darwinProfiles.nix diff --git a/templates/nixos/nix/lib/exporter/pops/_hostsFun/homeModules.nix b/templates/nixos/nix/lib/exporter/pops/__hostsFun/homeModules.nix similarity index 100% rename from templates/nixos/nix/lib/exporter/pops/_hostsFun/homeModules.nix rename to templates/nixos/nix/lib/exporter/pops/__hostsFun/homeModules.nix diff --git a/templates/nixos/nix/lib/exporter/pops/_hostsFun/homeProfiles.nix b/templates/nixos/nix/lib/exporter/pops/__hostsFun/homeProfiles.nix similarity index 100% rename from templates/nixos/nix/lib/exporter/pops/_hostsFun/homeProfiles.nix rename to templates/nixos/nix/lib/exporter/pops/__hostsFun/homeProfiles.nix diff --git a/templates/nixos/nix/lib/exporter/pops/_hostsFun/nixosModules.nix b/templates/nixos/nix/lib/exporter/pops/__hostsFun/nixosModules.nix similarity index 100% rename from templates/nixos/nix/lib/exporter/pops/_hostsFun/nixosModules.nix rename to templates/nixos/nix/lib/exporter/pops/__hostsFun/nixosModules.nix diff --git a/templates/nixos/nix/lib/exporter/pops/_hostsFun/nixosProfiles.nix b/templates/nixos/nix/lib/exporter/pops/__hostsFun/nixosProfiles.nix similarity index 100% rename from templates/nixos/nix/lib/exporter/pops/_hostsFun/nixosProfiles.nix rename to templates/nixos/nix/lib/exporter/pops/__hostsFun/nixosProfiles.nix diff --git a/templates/nixos/nix/lib/exporter/pops/omnibus/lib.nix b/templates/nixos/nix/lib/exporter/pops/omnibus/lib.nix index 6ce0d56..e3c8d15 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 = root.exporter.inputs.outputs; + inputs = inputs // root.exporter.inputs.outputs; }; } diff --git a/templates/nixos/nixos/hosts/nixos/layouts.nix b/templates/nixos/nixos/hosts/nixos/layouts.nix index 4728151..aacafc6 100644 --- a/templates/nixos/nixos/hosts/nixos/layouts.nix +++ b/templates/nixos/nixos/hosts/nixos/layouts.nix @@ -19,7 +19,7 @@ in # outputs.nixosModules.customModules.boot # outputs.srvos.default.common.nix - (omnibus.lib.mkHome + (outputs.omnibus.lib.mkHome { admin = { uid = 1000; diff --git a/tests/nixos/__fixture/layouts.nix b/tests/nixos/__fixture/layouts.nix index 789f2fc..f5b6e97 100644 --- a/tests/nixos/__fixture/layouts.nix +++ b/tests/nixos/__fixture/layouts.nix @@ -1,28 +1,29 @@ let inherit (inputs) nixpkgs darwin; - exporter = lib.mapAttrs (_: v: v.layouts) ( - lib.removeAttrs super.pops [ "inputs" ] - ); + # layouts.default to be default + outputs = omnibus.lib.mapPopsLayouts' super.pops; + # with multi-layout + outputs' = omnibus.lib.mapPopsLayouts super.pops; in { system = "x86_64-linux"; - inherit data exporter; + inherit data outputs outputs'; nixosSuites = lib.flatten [ - exporter.selfNixOSProfiles.default.bootstrap + outputs.selfNixOSProfiles.default.bootstrap # self.nixosProfiles.default.presets.boot - exporter.nixosModules.default.programs.git + outputs.nixosModules.default.programs.git # load a suite profile from audio # (outputs.nixosProfiles.default.audio {}).default # # --custom profiles - exporter.nixosProfiles.customProfiles.presets.nix - # exporter.nixosProfiles.customProfiles.presets.boot - exporter.srvos.default.common.nix + outputs.nixosProfiles.customProfiles.presets.nix + # # exporter.nixosProfiles.customProfiles.presets.boot + # outputs.srvos.default.common.nix - (omnibus.lib.mkHome + (outputs'.omnibus.lib.mkHome { admin = { uid = 1000; diff --git a/tests/nixos/__fixture/pops/omnibus.nix b/tests/nixos/__fixture/pops/omnibus.nix new file mode 100644 index 0000000..adc72ac --- /dev/null +++ b/tests/nixos/__fixture/pops/omnibus.nix @@ -0,0 +1,13 @@ +{ + lib = + (omnibus.pops.lib.addLoadExtender { + load.inputs = { + inputs = inputs; + }; + }).addExporters + [ + (POP.extendPop flops.haumea.pops.exporter ( + self: super: { exports.customProfiles = { }; } + )) + ]; +} diff --git a/tests/nixos/_pops.nix b/tests/nixos/_pops.nix index d82ef74..aa3b617 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; + inherit (omnibus.__inputs__) darwin nixpkgs home-manager; }; }; }; diff --git a/tests/nixos/expr.nix b/tests/nixos/expr.nix index 63ca1ab..ebe88d8 100644 --- a/tests/nixos/expr.nix +++ b/tests/nixos/expr.nix @@ -14,12 +14,12 @@ in { bootProfile = (out.nixosConfiguration [ - out.exporter.nixosProfiles.customProfiles.presets.boot + out.outputs.nixosProfiles.customProfiles.presets.boot ]).config.boot.__profiles__; customModuleBootTimeOut = (out.nixosConfiguration [ - out.exporter.nixosModules.customModules.boot + out.outputs.nixosModules.customModules.boot { config.boot.__profiles__.speedup = true; config.boot.__profiles__.systemd-boot.enable = true; @@ -28,25 +28,25 @@ in hyprland = (out.nixosConfiguration [ - out.exporter.nixosModules.customModules.boot + out.outputs.nixosModules.customModules.boot (extraHomeModule [ - out.exporter.homeProfiles.customProfiles.presets.hyprland.default - out.exporter.homeProfiles.default.presets.firefox + out.outputs.homeProfiles.customProfiles.presets.hyprland.default + out.outputs.homeProfiles.default.presets.firefox ]) ]) .config.home-manager.users.admin.wayland.windowManager.hyprland.__profiles__; } // lib.optionalAttrs trace { nixosConfiguration = out.nixosConfiguration [ - out.exporter.nixosProfiles.default.presets.boot + out.outputs.nixosProfiles.default.presets.boot ]; homeConfiguration = (out.nixosConfiguration [ - out.exporter.nixosProfiles.default.presets.boot - (extraHomeModule [ - out.exporter.homeProfiles.customProfiles.presets.hyprland.default - out.exporter.homeProfiles.default.presets.firefox - ]) + out.outputs.nixosProfiles.default.presets.boot + # (extraHomeModule [ + # out.outputs.homeProfiles.customProfiles.presets.hyprland.default + # out.outputs.homeProfiles.default.presets.firefox + # ]) ]).config.home-manager.users.admin; } diff --git a/tests/srvos/expr.nix b/tests/srvos/expr.nix index 175c19b..bd1348e 100644 --- a/tests/srvos/expr.nix +++ b/tests/srvos/expr.nix @@ -10,10 +10,10 @@ in { srvosCommonOpenssh = (exporter.layouts.nixosConfiguration [ - exporter.layouts.exporter.nixosProfiles.default.presets.boot - exporter.layouts.exporter.nixosProfiles.default.presets.openssh + exporter.layouts.outputs.nixosProfiles.default.presets.boot + exporter.layouts.outputs.nixosProfiles.default.presets.openssh # -- suites profile -- - (exporter.layouts.exporter.nixosProfiles.default.cloud { }).default + (exporter.layouts.outputs.nixosProfiles.default.cloud { }).default ]).config.services.openssh.settings.KexAlgorithms; } // lib.optionalAttrs trace { }