Files
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

39 lines
944 B
Nix

{ lib, runCommandLocal }:
# On darwin, there are some commands neither opensource nor able to build in nixpkgs.
# We have no choice but to use those system-shipped impure ones.
let
commands = {
ditto = "/usr/bin/ditto"; # ditto is not opensource
sudo = "/usr/bin/sudo"; # sudo must be owned by uid 0 and have the setuid bit set
};
mkImpureDrv =
name: path:
runCommandLocal "${name}-impure-darwin"
{
__impureHostDeps = [ path ];
meta = {
platforms = lib.platforms.darwin;
};
}
''
if ! [ -x ${path} ]; then
echo Cannot find command ${path}
exit 1
fi
mkdir -p $out/bin
ln -s ${path} $out/bin
manpage="/usr/share/man/man1/${name}.1"
if [ -f $manpage ]; then
mkdir -p $out/share/man/man1
ln -s $manpage $out/share/man/man1
fi
'';
in
lib.mapAttrs mkImpureDrv commands