diff --git a/flake.lock b/flake.lock index 8e76675..ce38be5 100644 --- a/flake.lock +++ b/flake.lock @@ -77,16 +77,15 @@ ] }, "locked": { - "lastModified": 1667712650, - "narHash": "sha256-fvOhYk8ZcvMc7b4bzztqrdm7WfupX73tblmcb54yIB4=", - "owner": "blaggacao", + "lastModified": 1668081890, + "narHash": "sha256-xm7yDuwuQLL/F0tJycutdprQekpETy3DssqfTudM9NI=", + "owner": "nix-community", "repo": "disko", - "rev": "27e6902d2fe2c1a6ff431dc68b30422c9af61398", + "rev": "d7e25ced8a15554e3afb2eb9b1800de271efbd87", "type": "github" }, "original": { - "owner": "blaggacao", - "ref": "module", + "owner": "nix-community", "repo": "disko", "type": "github" } diff --git a/flake.nix b/flake.nix index 0b57219..bde6842 100644 --- a/flake.nix +++ b/flake.nix @@ -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"; }; @@ -60,6 +60,7 @@ (data "nixosConfigurations") (data "colmenaConfigurations") (data "homeConfigurations") + (data "diskoConfigurations") # devshells can be entered (devshells "devshells") @@ -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 ---------------------------- diff --git a/make-shanty.nix b/make-shanty.nix new file mode 100644 index 0000000..5510d61 --- /dev/null +++ b/make-shanty.nix @@ -0,0 +1,8 @@ +{ + nixpkgs, + cellBlock ? "diskoConfigurations", +}: let + l = nixpkgs.lib // builtins; + inherit (import ./pasteurize.nix {inherit nixpkgs cellBlock;}) sing; +in + sing diff --git a/pasteurize.nix b/pasteurize.nix index 83dc7f0..42867d4 100644 --- a/pasteurize.nix +++ b/pasteurize.nix @@ -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); /* @@ -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: @@ -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;}