mirror of
https://github.com/nix-community/disko.git
synced 2024-11-04 05:44:29 +03:00
20 lines
454 B
Nix
20 lines
454 B
Nix
{ 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
|