Skip to content

Commit

Permalink
feat: add disko soil
Browse files Browse the repository at this point in the history
  • Loading branch information
blaggacao committed Nov 12, 2022
1 parent 8534802 commit aae2ded
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 13 deletions.
11 changes: 5 additions & 6 deletions flake.lock

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

12 changes: 11 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
nixgl.url = "github:guibou/nixGL";
nixgl.inputs.nixpkgs.follows = "nixpkgs";
nixgl.inputs.flake-utils.follows = "std/flake-utils";
disko.url = "github:blaggacao/disko/module";
disko.url = "github:nix-community/disko";
disko.inputs.nixpkgs.follows = "nixpkgs";
nixos-hardware.url = "github:nixos/nixos-hardware";
};
Expand Down Expand Up @@ -60,6 +60,7 @@
(data "nixosConfigurations")
(data "colmenaConfigurations")
(data "homeConfigurations")
(data "diskoConfigurations")

# devshells can be entered
(devshells "devshells")
Expand Down Expand Up @@ -106,6 +107,15 @@
};
in
makeMoonshineFrom self;

# tool: disko -- "Tiganizatia, tiganizatia - disko, disko partizani."
diskoConfigurations = let
makeShantyFrom = import ./make-shanty.nix {
inherit (inputs) nixpkgs;
cellBlock = "diskoConfigurations";
};
in
makeShantyFrom self;
};

# --- Flake Local Nix Configuration ----------------------------
Expand Down
8 changes: 8 additions & 0 deletions make-shanty.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
nixpkgs,
cellBlock ? "diskoConfigurations",
}: let
l = nixpkgs.lib // builtins;
inherit (import ./pasteurize.nix {inherit nixpkgs cellBlock;}) sing;
in
sing
26 changes: 20 additions & 6 deletions pasteurize.nix
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,7 @@
then throw "\nFailed assertions:\n${l.concatStringsSep "\n" (map (x: "- ${x}") failedAsserts)}"
else checked;
in
(l.removeAttrs config ["_hive_erased" "bee"])
// {
inherit _file;
}
// (out asserted);
locatedConfig // (out asserted);

/*
Expand Down Expand Up @@ -197,6 +193,24 @@
# system = config.bee.system; # not actually used
};

# same as pasteurize, but for disko where the system doesn't matter
sing = self:
l.pipe
(
l.mapAttrs (system:
l.mapAttrs (user: blocks: (
l.pipe blocks [
(l.attrByPath [cellBlock] {})
(l.filterAttrs (_: _: "x86_64-linux" == system)) # pick one
(l.mapAttrs (disko: l.nameValuePair "${user}-o-${disko}"))
]
)))
(l.intersectAttrs (l.genAttrs l.systems.doubles.all (_: null)) self)
) [
(l.collect (x: x ? name && x ? value))
l.listToAttrs
];

# Error reporting
showAssertions = let
collectFailed = cfg:
Expand All @@ -216,4 +230,4 @@
then evaled
else throw "\nFailed assertions:\n${failedStr}"
);
in {inherit pasteurize stir cure shake showAssertions beeOptions;}
in {inherit pasteurize stir cure shake sing showAssertions beeOptions;}

0 comments on commit aae2ded

Please sign in to comment.