From 7a4c85b53e151f8a189a88336adbadc9305b4873 Mon Sep 17 00:00:00 2001 From: lassulus Date: Wed, 23 Nov 2022 13:29:51 +0100 Subject: [PATCH] module: put disko scripts in system.build for better reference --- module.nix | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/module.nix b/module.nix index 611d681..958e006 100644 --- a/module.nix +++ b/module.nix @@ -36,6 +36,21 @@ in { '') ]) ++ lib.optionals cfg.enableConfig (types.diskoLib.packages cfg.devices pkgs); + system.build.formatScript = pkgs.writers.writeDash "disko-create" '' + export PATH=${lib.makeBinPath (types.diskoLib.packages cfg.devices pkgs)} + ${types.diskoLib.create cfg.devices} + ''; + + system.build.mountScript = pkgs.writers.writeDash "disko-mount" '' + export PATH=${lib.makeBinPath (types.diskoLib.packages cfg.devices pkgs)} + ${types.diskoLib.mount cfg.devices} + ''; + + system.build.disko = pkgs.writers.writeDash "disko" '' + export PATH=${lib.makeBinPath (types.diskoLib.packages cfg.devices pkgs)} + ${types.diskoLib.zapCreateMount cfg.devices} + ''; + # Remember to add config keys here if they are added to types fileSystems = lib.mkIf cfg.enableConfig (lib.mkMerge (lib.catAttrs "fileSystems" (types.diskoLib.config cfg.devices))); boot = lib.mkIf cfg.enableConfig (lib.mkMerge (lib.catAttrs "boot" (types.diskoLib.config cfg.devices)));