This commit is contained in:
Hadi
2024-06-24 11:05:38 +02:00
committed by GitHub
parent 282c04af67
commit 5d47643320
9 changed files with 64 additions and 55 deletions

View File

@@ -10,6 +10,7 @@ let
${pkgs.libnotify}/bin/notify-send "$message" \
--replace-id="$(cat "/tmp/nixy-notification" 2>/dev/null || echo 0)" --print-id > "/tmp/nixy-notification"
'';
night-shift-off = pkgs.writeShellScriptBin "night-shift-off" ''
pkill wlsunset
message="󰖔 Night-Shift Deactivated"

View File

@@ -5,7 +5,6 @@ let
nixy = pkgs.writeShellScriptBin "nixy" ''
function exec() {
$@
# hyprctl dispatch exec $@
}
function ui(){
@@ -38,39 +37,24 @@ let
[[ $1 == "" ]] && ui
if [[ $1 == "rebuild" ]];then
nixy-rebuild
sudo nixos-rebuild switch --flake ${config.var.configDirectory}#${config.var.hostname}
elif [[ $1 == "upgrade" ]];then
nixy-upgrade
sudo nixos-rebuild switch --upgrade --flake ${config.var.configDirectory}#${config.var.hostname}
elif [[ $1 == "update" ]];then
nixy-update
cd ${config.var.configDirectory} && sudo nix flake update
elif [[ $1 == "gc" ]];then
nixy-gc
cd ${config.var.configDirectory} && sudo nix-collect-garbage -d
elif [[ $1 == "cb" ]];then
nixy-cb
sudo /run/current-system/bin/switch-to-configuration boot
elif [[ $1 == "remote" ]];then
cd ~/.config/nixos && git add . && git commit -m "update" && git push
ssh jack -S -C "cd /home/hadi/.config/nixos && git pull && sudo -S nixos-rebuild switch --flake ~/.config/nixos#jack"
else
echo "Unknown argument"
fi
'';
nixy-rebuild = pkgs.writeShellScriptBin "nixy-rebuild" ''
sudo nixos-rebuild switch --flake ${config.var.configDirectory}#${config.var.hostname}
'';
nixy-upgrade = pkgs.writeShellScriptBin "nixy-upgrade" ''
sudo nixos-rebuild switch --upgrade --flake ${config.var.configDirectory}#${config.var.hostname}
'';
nixy-update = pkgs.writeShellScriptBin "nixy-update" ''
cd ${config.var.configDirectory} && sudo nix flake update
'';
nixy-gc = pkgs.writeShellScriptBin "nixy-gc" ''
cd ${config.var.configDirectory} && sudo nix-collect-garbage -d
'';
nixy-cb = pkgs.writeShellScriptBin "nixy-cb" ''
sudo /run/current-system/bin/switch-to-configuration boot
'';
in {
home.packages =
[ nixy nixy-rebuild nixy-upgrade nixy-update nixy-gc nixy-cb ];
[ nixy ];
}

View File

@@ -1,14 +0,0 @@
{ pkgs, config, ... }:
let
remote-rebuild = pkgs.writeShellScriptBin "remote-rebuild" ''
ssh jack -S -C "cd /home/hadi/.config/nixos && git pull && sudo -S nixos-rebuild switch --flake ~/.config/nixos#jack"
'';
remote-push = pkgs.writeShellScriptBin "remote-push" ''
cd ~/.config/nixos && git add . && git commit -m "update" && git push
remote-rebuild
'';
in { home.packages = [ remote-rebuild remote-push ]; }

View File

@@ -2,6 +2,7 @@
{ pkgs, config, ... }:
let
startup = pkgs.writeShellScriptBin "startup" ''
# Startup is a script called by Hyprland on startup
# Because HM enabling services suck.
[[ ${toString config.var.sops} == "1" ]] && systemctl --user start sops-nix

View File

@@ -3,9 +3,9 @@
let
tofi = pkgs.writeShellScriptBin "tofi" ''
hyprexec="hyprctl dispatch exec"
function exec() {
$@
# hyprctl dispatch exec $@
}
function ui(){
@@ -14,7 +14,31 @@ let
# "icon;name;command"[]
apps=(
";Nixy;nixy"
";Nerdfont;nerdfont-fzf"
";Nerdfont FZF;nerdfont-fzf"
";Brightness Up;brightness-up"
";Brightness Down;brightness-down"
";Sound Up;sound-up"
";Sound Down;sound-down"
";Sound Toggle Mute;sound-toggle"
";Sound Change Output;sound-output"
";Caffeine;caffeine"
";Night Shift Toggle;night-shift-toggle"
";Firefox;$hyprexec firefox"
";Qutebrowser;$hyprexec qutebrowser"
";Kitty;$hyprexec kitty"
";Thunar;$hyprexec thunar"
";Powermenu;powermenu"
";Wofi;menu"
";Lock;lock"
";Bitwarden;$hyprexec bitwarden"
";Clock; peaclock"
";Nextcloud;$hyprexec nextcloud"
";Spotify;$hyprexec spotify"
";Btop;btop"
";Cava;cava"
";Discord;$hyprexec discord"
";Vlc;$hyprexec vlc"
";Obsidian;$hyprexec obsidian"
)
# Apply default icons if empty: