From 0af2a7c206bd69ecdc01361e12c7cb0ec9820911 Mon Sep 17 00:00:00 2001 From: David Arnold Date: Sun, 6 Nov 2022 01:46:48 -0500 Subject: feat: allow to declare disko-config relative to flake --- cli.nix | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'cli.nix') diff --git a/cli.nix b/cli.nix index f99ad61..ed80160 100644 --- a/cli.nix +++ b/cli.nix @@ -1,10 +1,14 @@ { pkgs ? import {} , 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 -- cgit v1.2.3