mirror of
https://github.com/nix-community/disko.git
synced 2026-11-30 13:03:28 +01:00
disko: support nixos-install style flake syntax
This commit is contained in:
1 parent
7e52500078
commit
5fd29dfeb3
2 files changed
+37
-14
No files matched your search
@@ -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
|
||||
|
||||
Reference in new issue
Block a user