summaryrefslogtreecommitdiffstats
path: root/cli.nix
diff options
context:
space:
mode:
authorDavid Arnold <david.arnold@iohk.io>2022-11-06 01:46:48 -0500
committerlassulus <lassulus@lassul.us>2022-11-09 12:30:06 +0100
commit0af2a7c206bd69ecdc01361e12c7cb0ec9820911 (patch)
treed4efbdf4713aa4428a4922c0389ca4c61c808b9e /cli.nix
parenta023d391a08f8c8b1b7c26fcbb8d06edd5ceb203 (diff)
feat: allow to declare disko-config relative to flake
Diffstat (limited to 'cli.nix')
-rw-r--r--cli.nix8
1 files changed, 6 insertions, 2 deletions
diff --git a/cli.nix b/cli.nix
index f99ad61..ed80160 100644
--- a/cli.nix
+++ b/cli.nix
@@ -1,10 +1,14 @@
{ pkgs ? import <nixpkgs> {}
, mode ? "mount"
+, fromFlake ? null
, diskoFile
, ... }@args:
let
- disko = import ./. { inherit (pkgs) lib; };
- diskFormat = import diskoFile;
+ disko = import ./. { };
+ diskFormat =
+ if fromFlake != null
+ then (builtins.getFlake fromFlake) + "/${diskoFile}"
+ else import diskoFile;
diskoEval = if (mode == "create") then
disko.createScript diskFormat pkgs
else if (mode == "mount") then