Skip to content

Commit

Permalink
refactor: update flops
Browse files Browse the repository at this point in the history
  • Loading branch information
GTrunSec committed Oct 8, 2023
1 parent b695ff0 commit 516c0ca
Show file tree
Hide file tree
Showing 46 changed files with 387 additions and 238 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- uses: DeterminateSystems/magic-nix-cache-action@main

- name: Build Example/nixos
run: nix -Lv build .#nixosConfigurations.nixos.config.system.build.toplevel --dry-run
run: nix -Lv build ./local#eval.nixos.expr.nixosConfiguration.config.system.build.toplevel --dry-run

- name: Run Eval check
run: nix -Lv eval ./local#checks --override-input namaka github:nix-community/namaka
Expand Down
46 changes: 0 additions & 46 deletions examples/nixos/layouts.nix

This file was deleted.

8 changes: 0 additions & 8 deletions examples/nixos/pops/data.nix

This file was deleted.

12 changes: 0 additions & 12 deletions examples/nixos/pops/selfNixOSProfiles.nix

This file was deleted.

16 changes: 8 additions & 8 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 4 additions & 11 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,12 @@
inherit omnibus;
};
};

nixosConfigurations =
(self.pops.exporters.addLoadExtender {
src = ./nixos/nixosConfigurations;
inputs = {
nixpkgs = omnibus.pops.loadInputs.outputs.nixpkgs;
exporters = self.pops.exporters.outputs.default;
};
}).outputs.default;
in
{
inherit (lib.outputs.default.exporters) pops;
inherit nixosConfigurations lib;
pops = lib.layouts.default.exporter.pops // {
inherit lib;
};
lib = lib.layouts.default;

templates.default = {
path = ./templates/nixos;
Expand Down
46 changes: 27 additions & 19 deletions lib/exporters/pops.nix → lib/exporter/pops.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
self'.outPath + "/local/lock"
);
loadData = flops.haumea.pops.default.setInit {
src = self'.outPath + "/examples/__data";
loader = with haumea; [
matchers.json
matchers.toml
Expand All @@ -28,13 +27,17 @@
};
};
loadHomeProfiles = self.loadHomeModules.addLoadExtender {
src = self'.outPath + "/nixos/homeProfiles";
loader = haumea.loaders.scoped;
type = "nixosProfiles";
load = {
src = self'.outPath + "/nixos/homeProfiles";
loader = haumea.loaders.scoped;
type = "nixosProfiles";
};
};
loadNixOSProfiles = self.loadNixOSModules.addLoadExtender {
src = self'.outPath + "/nixos/nixosProfiles";
type = "nixosProfiles";
load = {
src = self'.outPath + "/nixos/nixosProfiles";
type = "nixosProfiles";
};
};
srvos = flops.haumea.pops.default.setInit {
src = builtins.unsafeDiscardStringContext (
Expand All @@ -47,34 +50,39 @@
evalModules = {
flake-parts = {
loadModules = self.loadNixOSModules.addLoadExtender {
src = self'.outPath + "/evalModules/flake-parts/modules";
load.src = self'.outPath + "/evalModules/flake-parts/modules";
};
loadProfiles = self.loadNixOSProfiles.addLoadExtender {
src = self'.outPath + "/evalModules/flake-parts/profiles";
inputs = {
omnibus.evalModules.flake-parts.modules =
self.evalModules.flake-parts.modules.outputs.default;
load = {
src = self'.outPath + "/evalModules/flake-parts/profiles";
inputs = {
omnibus.evalModules.flake-parts.modules =
self.evalModules.flake-parts.modules.layouts.default;
};
};
};
};
devshell = rec {
loadModules = self.loadNixOSModules.addLoadExtender {
src = self'.outPath + "/evalModules/devshell/modules";
type = "nixosModules";
load = {
src = self'.outPath + "/evalModules/devshell/modules";
type = "nixosModules";
};
};
loadProfiles = self.loadNixOSProfiles.addLoadExtender {
src = self'.outPath + "/evalModules/devshell/profiles";
type = "nixosProfiles";
inputs = {
omnibus.devshellModules = loadModules.outputs.default;
load = {
src = self'.outPath + "/evalModules/devshell/profiles";
type = "nixosProfiles";
inputs = {
omnibus.devshellModules = loadModules.layouts.default;
};
};
};
};
};

exporters = flops.haumea.pops.default.setInit {
exporter = flops.haumea.pops.default.setInit {
loader = with haumea; loaders.scoped;
src = self'.outPath + "/examples";
inputs = {
self' = self;
inherit
Expand Down
14 changes: 8 additions & 6 deletions lib/loadDataAll.nix
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
(omnibus.pops.loadData.addLoadExtender {
loader = with haumea; [
(matchers.regex "^(.+)\\.(yaml|yml)$" (
_: _: path:
super.readYAML path
))
];
load = {
loader = with haumea; [
(matchers.regex "^(.+)\\.(yaml|yml)$" (
_: _: path:
super.readYAML path
))
];
};
})
Loading

0 comments on commit 516c0ca

Please sign in to comment.