Remove redundancies
This commit is contained in:
parent
690b33bd08
commit
467b2036a7
1 changed files with 19 additions and 18 deletions
|
@ -40,24 +40,25 @@
|
||||||
(item: { inherit (item) file value; }));
|
(item: { inherit (item) file value; }));
|
||||||
in
|
in
|
||||||
lib.mkForce (
|
lib.mkForce (
|
||||||
if (mergedSystem.mergedValue.vm.name == packageName)
|
with { inherit (mergedSystem.mergedValue) vm; };
|
||||||
then
|
if (vm.name == packageName)
|
||||||
mergedSystem.mergedValue.vm
|
then
|
||||||
else
|
vm
|
||||||
let
|
else
|
||||||
prefix = lib.concatStringsSep " " (lib.optional config.virtualisation.runAsRoot "sudo");
|
let
|
||||||
wrapped = pkgs.writeShellApplication {
|
prefix = lib.concatStringsSep " " (lib.optional config.virtualisation.runAsRoot "sudo");
|
||||||
name = "run-${config.system.name}-vm";
|
wrapped = pkgs.writeShellApplication {
|
||||||
text = ''
|
name = "run-${config.system.name}-vm";
|
||||||
${prefix} ${mergedSystem.mergedValue.vm}/bin/run-${config.system.name}-vm
|
text = ''
|
||||||
'';
|
${prefix} ${vm}/bin/run-${config.system.name}-vm
|
||||||
};
|
'';
|
||||||
in
|
};
|
||||||
# Rename package to `nixos-vm`
|
in
|
||||||
pkgs.symlinkJoin {
|
# Rename package to `nixos-vm`
|
||||||
name = packageName;
|
pkgs.symlinkJoin {
|
||||||
paths = [ wrapped ];
|
name = packageName;
|
||||||
});
|
paths = [ wrapped ];
|
||||||
|
});
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue