mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-23 15:33:13 +00:00
nixos/firejail: use local runCommand
Also: - use `runtimeShell`; and - remove unused `makeWrapper` input; and - `exec()` to shed wrapping shell
This commit is contained in:
parent
991bbef683
commit
1b575dbd79
@ -5,20 +5,20 @@ with lib;
|
||||
let
|
||||
cfg = config.programs.firejail;
|
||||
|
||||
wrappedBins = pkgs.stdenv.mkDerivation {
|
||||
name = "firejail-wrapped-binaries";
|
||||
nativeBuildInputs = with pkgs; [ makeWrapper ];
|
||||
buildCommand = ''
|
||||
wrappedBins = pkgs.runCommand "firejail-wrapped-binaries"
|
||||
{ preferLocalBuild = true;
|
||||
allowSubstitutes = false;
|
||||
}
|
||||
''
|
||||
mkdir -p $out/bin
|
||||
${lib.concatStringsSep "\n" (lib.mapAttrsToList (command: binary: ''
|
||||
cat <<_EOF >$out/bin/${command}
|
||||
#!${pkgs.stdenv.shell} -e
|
||||
/run/wrappers/bin/firejail ${binary} "\$@"
|
||||
_EOF
|
||||
chmod 0755 $out/bin/${command}
|
||||
cat <<_EOF >$out/bin/${command}
|
||||
#! ${pkgs.runtimeShell} -e
|
||||
exec /run/wrappers/bin/firejail ${binary} "\$@"
|
||||
_EOF
|
||||
chmod 0755 $out/bin/${command}
|
||||
'') cfg.wrappedBinaries)}
|
||||
'';
|
||||
};
|
||||
|
||||
in {
|
||||
options.programs.firejail = {
|
||||
|
Loading…
Reference in New Issue
Block a user