nixos-config/scripts/default.nix
2024-08-28 19:56:54 -03:00

35 lines
754 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
];
powerplay-led-idle = [
bash
libinput
libratbag
];
}
)