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; }));
|
||||
in
|
||||
lib.mkForce (
|
||||
if (mergedSystem.mergedValue.vm.name == packageName)
|
||||
then
|
||||
mergedSystem.mergedValue.vm
|
||||
else
|
||||
let
|
||||
prefix = lib.concatStringsSep " " (lib.optional config.virtualisation.runAsRoot "sudo");
|
||||
wrapped = pkgs.writeShellApplication {
|
||||
name = "run-${config.system.name}-vm";
|
||||
text = ''
|
||||
${prefix} ${mergedSystem.mergedValue.vm}/bin/run-${config.system.name}-vm
|
||||
'';
|
||||
};
|
||||
in
|
||||
# Rename package to `nixos-vm`
|
||||
pkgs.symlinkJoin {
|
||||
name = packageName;
|
||||
paths = [ wrapped ];
|
||||
});
|
||||
with { inherit (mergedSystem.mergedValue) vm; };
|
||||
if (vm.name == packageName)
|
||||
then
|
||||
vm
|
||||
else
|
||||
let
|
||||
prefix = lib.concatStringsSep " " (lib.optional config.virtualisation.runAsRoot "sudo");
|
||||
wrapped = pkgs.writeShellApplication {
|
||||
name = "run-${config.system.name}-vm";
|
||||
text = ''
|
||||
${prefix} ${vm}/bin/run-${config.system.name}-vm
|
||||
'';
|
||||
};
|
||||
in
|
||||
# Rename package to `nixos-vm`
|
||||
pkgs.symlinkJoin {
|
||||
name = packageName;
|
||||
paths = [ wrapped ];
|
||||
});
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue