disko/cli.nix

20 lines
454 B
Nix
Raw Normal View History

2022-10-26 22:02:49 +00:00
{ pkgs ? import <nixpkgs> {}
, mode ? "mount"
, fromFlake ? null
2022-10-26 22:02:49 +00:00
, diskoFile
, ... }@args:
let
disko = import ./. { };
diskFormat =
if fromFlake != null
then (builtins.getFlake fromFlake) + "/${diskoFile}"
else import diskoFile;
2022-10-26 22:02:49 +00:00
diskoEval = if (mode == "create") then
disko.createScript diskFormat pkgs
else if (mode == "mount") then
disko.mountScript diskFormat pkgs
else
builtins.abort "invalid mode"
;
in diskoEval