Skip to content

Commit

Permalink
feat: WIP add nixos example
Browse files Browse the repository at this point in the history
  • Loading branch information
GTrunSec committed Oct 6, 2023
1 parent 8d318d0 commit b597059
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 24 deletions.
20 changes: 5 additions & 15 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -26,35 +26,25 @@
self' = self;
home-manager = omnibus.pops.loadInputs.outputs.home-manager;
haumea = haumea.lib;
dmerge = inputs.flops.inputs.dmerge;
POP = POP.lib;
inherit omnibus flops;
flops = flops.lib;
inherit omnibus;
};
};

nixosConfigurations =
(self.exporters.addLoadExtender {
(self.pops.exporters.addLoadExtender {
src = ./nixos/nixosConfigurations;
inputs = {
nixpkgs = omnibus.pops.loadInputs.outputs.nixpkgs;
exporters = self.exporters.outputs.default;
exporters = self.pops.exporters.outputs.default;
};
}).outputs.default;
in
{
inherit (lib.outputs.default.exporters) pops;
inherit nixosConfigurations lib;
exporters = flops.lib.haumea.pops.default.setInit {
loader = with haumea.lib; loaders.scoped;
src = ./examples;
inputs = {
lib = flops.inputs.nixlib.lib // builtins;
flops = flops.lib;
haumea = flops.inputs.haumea.lib;
dmerge = flops.inputs.dmerge;
POP = POP.lib;
inherit omnibus;
};
};

templates.default = {
path = ./templates/nixos;
Expand Down
28 changes: 21 additions & 7 deletions lib/exporters/pops.nix
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
{
dotfiles = self'.outPath + "/dotfiles";
# FIXME: needs to fix the logic of loadInputs path
# self'.outPath + "";
loadInputs = flops.lib.flake.pops.default.setInitInputs (
loadInputs = flops.flake.pops.default.setInitInputs (
self'.outPath + "/local/lock"
);
loadData = flops.lib.haumea.pops.default.setInit {
loadData = flops.haumea.pops.default.setInit {
src = self'.outPath + "/examples/__data";
loader = with haumea; [
matchers.json
matchers.toml
];
};
loadNixOSModules = flops.lib.haumea.pops.default.setInit {
loadNixOSModules = flops.haumea.pops.default.setInit {
src = self'.outPath + "/nixos/nixosModules";
type = "nixosModules";
inputs = {
Expand All @@ -21,7 +19,7 @@
omnibus = self;
};
};
loadHomeModules = flops.lib.haumea.pops.default.setInit {
loadHomeModules = flops.haumea.pops.default.setInit {
src = self'.outPath + "/nixos/homeModules";
type = "nixosModules";
inputs = {
Expand All @@ -38,7 +36,7 @@
src = self'.outPath + "/nixos/nixosProfiles";
type = "nixosProfiles";
};
srvos = flops.lib.haumea.pops.default.setInit {
srvos = flops.haumea.pops.default.setInit {
src = builtins.unsafeDiscardStringContext (
self.loadInputs.outputs.srvos + "/nixos"
);
Expand Down Expand Up @@ -73,4 +71,20 @@
};
};
};

exporters = flops.haumea.pops.default.setInit {
loader = with haumea; loaders.scoped;
src = self'.outPath + "/examples";
inputs = {
self' = self;
inherit
omnibus
POP
haumea
flops
lib
dmerge
;
};
};
}
2 changes: 1 addition & 1 deletion templates/nixos/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
in
{
lib =
(inputs.omnibus.exporters.addLoadExtender {
(inputs.omnibus.pops.exporters.addLoadExtender {
src = ./nix/lib;
inputs = {
self' = self;
Expand Down
2 changes: 1 addition & 1 deletion templates/nixos/nix/lib/exporters.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ let
in
{
hosts =
(inputs.omnibus.exporters.addLoadExtender {
(inputs.omnibus.pops.exporters.addLoadExtender {
src = self'.outPath + "/nixos/hosts";
inputs = inputs // {
self'.lib = super;
Expand Down

0 comments on commit b597059

Please sign in to comment.