diff options
Diffstat (limited to 'cli.nix')
-rw-r--r-- | cli.nix | 19 |
1 files changed, 19 insertions, 0 deletions
@@ -0,0 +1,19 @@ +{ pkgs ? import <nixpkgs> {} +, mode ? "mount" +, fromFlake ? null +, diskoFile +, ... }@args: +let + 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 + disko.mountScript diskFormat pkgs + else + builtins.abort "invalid mode" + ; +in diskoEval |