mirror of
https://github.com/nix-community/nixos-generators.git
synced 2024-11-22 18:24:59 +03:00
all-formats: fix incorrect symlinks i.e. for sd-image formats
- output $out/$basename instead of $out being a symlink to the resulting file. This works around problem where we cannot predict the file extension of the output reliably, and therefore the direct symlink had the wrong extension in some cases. - fix wrong file symlinked under $out for sd image formats
This commit is contained in:
parent
9a666f144f
commit
b9c5637760
@ -36,11 +36,14 @@
|
|||||||
|
|
||||||
# attrset of formats to be exposed under config.system.formats
|
# attrset of formats to be exposed under config.system.formats
|
||||||
formats = lib.flip lib.mapAttrs allConfigs (
|
formats = lib.flip lib.mapAttrs allConfigs (
|
||||||
formatName: conf: pkgs.runCommand "${conf.config.system.build.${conf.config.formatAttr}.name}${conf.config.fileExtension}" {} ''
|
formatName: conf: exposeConfig conf (
|
||||||
set -efu
|
pkgs.runCommand "${conf.config.system.build.${conf.config.formatAttr}.name}" {} ''
|
||||||
target=$(find '${conf.config.system.build.${conf.config.formatAttr}}' -name '*${conf.config.fileExtension}' -xtype f -print -quit)
|
set -efu
|
||||||
ln -s "$target" "$out"
|
target=$(find '${conf.config.system.build.${conf.config.formatAttr}}' -name '*${conf.config.fileExtension}' -xtype f -print -quit)
|
||||||
''
|
mkdir $out
|
||||||
|
ln -s "$target" "$out/$(basename "$target")"
|
||||||
|
''
|
||||||
|
)
|
||||||
);
|
);
|
||||||
in {
|
in {
|
||||||
_file = ./all-formats.nix;
|
_file = ./all-formats.nix;
|
||||||
@ -54,7 +57,7 @@ in {
|
|||||||
options.formats = lib.mkOption {
|
options.formats = lib.mkOption {
|
||||||
type = lib.types.lazyAttrsOf lib.types.raw;
|
type = lib.types.lazyAttrsOf lib.types.raw;
|
||||||
description = ''
|
description = ''
|
||||||
Different target formats generated for this NixOS configuratation.
|
Different target formats generated for this NixOS configuration.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user