feat: allow to declare disko-config relative to flake

This commit is contained in:
David Arnold 2022-11-06 01:46:48 -05:00 committed by lassulus
parent a023d391a0
commit 0af2a7c206
2 changed files with 26 additions and 4 deletions

View file

@ -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