aboutsummaryrefslogtreecommitdiffhomepage
path: root/nixos.nix
diff options
context:
space:
mode:
authorOphestra Umiker <cat@ophivana.moe>2024-11-08 02:05:47 +0900
committerOphestra Umiker <cat@ophivana.moe>2024-11-08 02:05:47 +0900
commit431aa32291996b59a5c02e293fa8d1351a7111e8 (patch)
tree0fc2d09e3a556e54987605cf0159b44a3e81c5eb /nixos.nix
parent3962705126de0f295638ee30992efcd572615457 (diff)
nix: remove absolute Exec paths
Absolute paths set for Exec causes the program to be launched as the privileged user. Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
Diffstat (limited to 'nixos.nix')
-rw-r--r--nixos.nix12
1 files changed, 8 insertions, 4 deletions
diff --git a/nixos.nix b/nixos.nix
index 9f700c38..b6d72d7b 100644
--- a/nixos.nix
+++ b/nixos.nix
@@ -402,7 +402,7 @@ in
shares: name: launcher:
let
pkg = if launcher.share != null then launcher.share else pkgs.${name};
- link = source: "[ -d '${source}' ] && ln -sv '${source}' $out/share || true";
+ copy = source: "[ -d '${source}' ] && cp -Lrv '${source}' $out/share || true";
in
shares
++
@@ -410,9 +410,13 @@ in
(
pkgs.runCommand "${name}-share" { } ''
mkdir -p $out/share
- ${link "${pkg}/share/applications"}
- ${link "${pkg}/share/icons"}
- ${link "${pkg}/share/man"}
+ ${copy "${pkg}/share/applications"}
+ ${copy "${pkg}/share/icons"}
+ ${copy "${pkg}/share/man"}
+
+ substituteInPlace $out/share/applications/* \
+ --replace-warn '${pkg}/bin/' "" \
+ --replace-warn '${pkg}/libexec/' ""
''
)
) (wrap user target.launchers) target.launchers)