nixos-config/scripts/default.nix
2024-08-20 19:21:57 -03:00

40 lines
832 B
Nix

(
final: prev:
let
lib = prev.lib;
importScript = (_: path: import (path) { inherit (final) pkgs lib; });
wrapScript =
name: text: runtimeInputs:
final.runCommand name
{
nativeBuildInputs = [ final.makeWrapper ];
meta.mainProgram = name;
}
''
mkdir -p $out/bin
cp ${text} $out/bin/${name}
wrapProgram $out/bin/${name} \
--suffix PATH : ${lib.makeBinPath runtimeInputs}
'';
createScripts = lib.mapAttrs (name: deps: wrapScript name ./${name} deps);
in
with final;
createScripts {
wl-copy-file = [
wl-clipboard
fish
];
auto_connect_gamepad = [
bluez
coreutils
gnugrep
];
powerplay-led-idle = [
bash
libinput
libratbag
];
}
)