nixos/modules/scripts/default.nix

37 lines
707 B
Nix
Raw Normal View History

2026-01-20 01:02:28 +01:00
{
pkgs,
lib,
2026-01-20 23:45:33 +01:00
config,
2026-01-20 01:02:28 +01:00
...
}: let
makeScript = {
path,
name ? lib.removeSuffix ".bash" (builtins.baseNameOf path),
runtimeInputs ? [],
}:
pkgs.writeShellApplication {
inherit name runtimeInputs;
text = builtins.readFile path;
};
in {
2026-01-20 23:45:33 +01:00
environment.systemPackages =
[
(makeScript {
path = ./reboot-windows.bash;
runtimeInputs = with pkgs; [
jq
systemd # for bootctl and systemctl
];
})
]
++ lib.optional config.fireproof.desktop.enable (makeScript {
path = ./screenshot.bash;
2026-01-20 01:02:28 +01:00
runtimeInputs = with pkgs; [
2026-01-20 23:45:33 +01:00
slurp
grim
satty
wl-clipboard
2026-01-20 01:02:28 +01:00
];
2026-01-20 23:45:33 +01:00
});
2026-01-20 01:02:28 +01:00
}