2022-10-27 01:02:49 +03:00
|
|
|
{ pkgs ? import <nixpkgs> {}
|
|
|
|
, mode ? "mount"
|
2022-11-10 01:36:40 +03:00
|
|
|
, flake ? null
|
|
|
|
, flakeAttr ? null
|
|
|
|
, diskoFile ? null
|
2022-10-27 01:02:49 +03:00
|
|
|
, ... }@args:
|
|
|
|
let
|
2022-11-06 09:46:48 +03:00
|
|
|
disko = import ./. { };
|
2022-11-10 01:36:40 +03:00
|
|
|
|
|
|
|
diskFormat = if flake != null then
|
|
|
|
(pkgs.lib.attrByPath [ "diskoConfigurations" flakeAttr ] (builtins.abort "${flakeAttr} does not exist") (builtins.getFlake flake)) args
|
|
|
|
else
|
|
|
|
import diskoFile args;
|
|
|
|
|
2022-10-27 01:02:49 +03: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
|