mirror of
https://github.com/nix-community/nixos-generators.git
synced 2024-11-22 01:52:05 +03:00
add filename option
This commit is contained in:
parent
ca2b26afab
commit
90c20db183
@ -5,4 +5,5 @@
|
||||
];
|
||||
|
||||
formatAttr = "hypervImage";
|
||||
filename = "*.vhdx";
|
||||
}
|
||||
|
@ -9,4 +9,5 @@
|
||||
virtualisation.hypervGuest.enable = true;
|
||||
|
||||
formatAttr = "isoImage";
|
||||
filename = "*.iso";
|
||||
}
|
||||
|
@ -12,4 +12,5 @@
|
||||
systemd.services.sshd.wantedBy = lib.mkForce [ "multi-user.target" ];
|
||||
|
||||
formatAttr = "isoImage";
|
||||
filename = "*.iso";
|
||||
}
|
||||
|
@ -11,4 +11,5 @@
|
||||
isoImage.makeUsbBootable = true;
|
||||
|
||||
formatAttr = "isoImage";
|
||||
filename = "*.iso";
|
||||
}
|
||||
|
@ -55,4 +55,5 @@ in {
|
||||
networking.hostName = lib.mkDefault "kexec";
|
||||
|
||||
formatAttr = "kexec_tarball";
|
||||
filename = "*/tarball/*.tar.xz";
|
||||
}
|
||||
|
@ -13,6 +13,8 @@
|
||||
target = "/metadata.yaml";
|
||||
}];
|
||||
};
|
||||
|
||||
formatAttr = "metadata";
|
||||
filename = "*/tarball/*.tar.xz";
|
||||
}
|
||||
|
||||
|
@ -19,4 +19,5 @@ in {
|
||||
});
|
||||
|
||||
formatAttr = "tarball";
|
||||
filename = "*/tarball/*.tar.xz";
|
||||
}
|
||||
|
@ -19,4 +19,5 @@
|
||||
};
|
||||
|
||||
formatAttr = "raw";
|
||||
filename = "*.img";
|
||||
}
|
||||
|
@ -5,4 +5,5 @@
|
||||
];
|
||||
|
||||
formatAttr = "virtualBoxOVA";
|
||||
filename = "*.ova";
|
||||
}
|
||||
|
@ -121,12 +121,13 @@ if [[ -n $cores ]]; then
|
||||
fi
|
||||
|
||||
formatAttr=$(nix-instantiate "${nix_args[@]}" --eval --json -A config.formatAttr | jq -r .)
|
||||
filename=$(nix-instantiate "${nix_args[@]}" --eval --json -A config.filename | jq -r .)
|
||||
|
||||
out=$(nix-build "${nix_args[@]}" --no-out-link -A "config.system.build.$formatAttr")
|
||||
|
||||
if [[ -z $run ]]; then
|
||||
# show the first file, ignoring nix-support
|
||||
find "$out" -path "$out/nix-support" -prune -o -type f -print -quit
|
||||
find "$out" -wholename "$filename" -type f -print -quit
|
||||
else
|
||||
runner=$(find "$out"/bin -type l -print -quit)
|
||||
exec "$runner"
|
||||
|
@ -6,6 +6,11 @@
|
||||
let
|
||||
module = { lib, ... }: {
|
||||
options = {
|
||||
filename = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
description = "Declare the path of the wanted file in the output directory";
|
||||
default = "*";
|
||||
};
|
||||
formatAttr = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
description = "Declare the default attribute to build";
|
||||
|
Loading…
Reference in New Issue
Block a user