mirror of
https://github.com/lightly-toasted/nix-config.git
synced 2025-10-04 03:15:41 +00:00
refactor: migrate powermenu.sh to writeShellScriptBin
This commit is contained in:
parent
1f045e291d
commit
19ee0fc14e
6 changed files with 28 additions and 22 deletions
|
@ -1,16 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
choice=$(printf """
|
||||
Logout
|
||||
⏻ Shutdown
|
||||
Reboot
|
||||
Suspend
|
||||
Hibernate
|
||||
""" | tofi)
|
||||
|
||||
case "$choice" in
|
||||
" Logout") uwsm stop ;;
|
||||
"⏻ Shutdown") systemctl poweroff ;;
|
||||
" Reboot") systemctl reboot ;;
|
||||
" Suspend") systemctl suspend ;;
|
||||
" Hibernate") systemctl hibernate ;;
|
||||
esac
|
|
@ -17,11 +17,8 @@
|
|||
username = "toast";
|
||||
homeDirectory = "/home/toast";
|
||||
stateVersion = "24.11";
|
||||
file = {
|
||||
"bin" = { source = ./bin; recursive = true; };
|
||||
};
|
||||
};
|
||||
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
systemd.user.startServices = "sd-switch";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -71,7 +71,7 @@
|
|||
"$mod SHIFT, 0, movetoworkspace, 10"
|
||||
|
||||
"$mod SHIFT, S, exec, env HYPRSHOT_DIR=/data/Backup/Screenshots hyprshot -m region"
|
||||
"$mod SHIFT, E, exec, ~/bin/powermenu.sh"
|
||||
"$mod SHIFT, E, exec, powermenu"
|
||||
|
||||
"$mod, mouse:277, exec, cycle-mouse-action"
|
||||
", mouse:277, exec, run-mouse-action"
|
||||
|
|
24
home/toast/modules/powermenu.nix
Executable file
24
home/toast/modules/powermenu.nix
Executable file
|
@ -0,0 +1,24 @@
|
|||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
home.packages = [
|
||||
(pkgs.writeShellScriptBin "powermenu" ''
|
||||
choice=$(printf """
|
||||
Logout
|
||||
⏻ Shutdown
|
||||
Reboot
|
||||
Suspend
|
||||
Hibernate
|
||||
""" | ${pkgs.tofi}/bin/tofi)
|
||||
|
||||
case "$choice" in
|
||||
" Logout") ${pkgs.uwsm}/bin/uwsm stop ;;
|
||||
"⏻ Shutdown") ${pkgs.systemd}/bin/systemctl poweroff ;;
|
||||
" Reboot") ${pkgs.systemd}/bin/systemctl reboot ;;
|
||||
" Suspend") ${pkgs.systemd}/bin/systemctl suspend ;;
|
||||
" Hibernate") ${pkgs.systemd}/bin/systemctl hibernate ;;
|
||||
esac
|
||||
'')
|
||||
];
|
||||
}
|
||||
|
|
@ -6,5 +6,6 @@
|
|||
./greetd.nix
|
||||
./tailscale.nix
|
||||
./flatpak.nix
|
||||
./restic.nix
|
||||
];
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
"/data/Backup"
|
||||
"/home/toast/workspace"
|
||||
];
|
||||
repository = "rclone:gdrive/restic";
|
||||
repository = "rclone:gdrive:restic";
|
||||
rcloneConfigFile = config.sops.secrets."restic/rclone-config".path;
|
||||
pruneOpts = [
|
||||
"--keep-daily 7"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue