mirror of
https://github.com/TECHNOFAB11/disko.git
synced 2025-12-11 23:50:05 +01:00
disko: support nixos-install style flake syntax
This commit is contained in:
parent
7e52500078
commit
5fd29dfeb3
2 changed files with 37 additions and 14 deletions
15
cli.nix
15
cli.nix
|
|
@ -1,14 +1,17 @@
|
|||
{ pkgs ? import <nixpkgs> {}
|
||||
, mode ? "mount"
|
||||
, fromFlake ? null
|
||||
, diskoFile
|
||||
, flake ? null
|
||||
, flakeAttr ? null
|
||||
, diskoFile ? null
|
||||
, ... }@args:
|
||||
let
|
||||
disko = import ./. { };
|
||||
diskFormat =
|
||||
if fromFlake != null
|
||||
then (builtins.getFlake fromFlake) + "/${diskoFile}"
|
||||
else import diskoFile;
|
||||
|
||||
diskFormat = if flake != null then
|
||||
(pkgs.lib.attrByPath [ "diskoConfigurations" flakeAttr ] (builtins.abort "${flakeAttr} does not exist") (builtins.getFlake flake)) args
|
||||
else
|
||||
import diskoFile args;
|
||||
|
||||
diskoEval = if (mode == "create") then
|
||||
disko.createScript diskFormat pkgs
|
||||
else if (mode == "mount") then
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue