Compare commits
No commits in common. "6e2981cf221ea89e39b3b2b1529eaa113cc368a9" and "c361f1f7edf912cbbefca0149a44a458d794971b" have entirely different histories.
6e2981cf22
...
c361f1f7ed
19 changed files with 260 additions and 458 deletions
|
@ -157,22 +157,7 @@
|
|||
inherit inputs;
|
||||
};
|
||||
|
||||
users = {
|
||||
root = {
|
||||
# Inherit from user
|
||||
programs.home-manager.enable = config.home-manager.users.${config.custom.username}.programs.home-manager.enable;
|
||||
systemd.user.startServices = config.home-manager.users.${config.custom.username}.systemd.user.startServices;
|
||||
nixpkgs.config = config.home-manager.users.${config.custom.username}.nixpkgs.config;
|
||||
nix.gc = config.home-manager.users.${config.custom.username}.nix.gc;
|
||||
|
||||
home = {
|
||||
username = "root";
|
||||
homeDirectory = "/root";
|
||||
stateVersion = config.home-manager.users.${config.custom.username}.home.stateVersion;
|
||||
};
|
||||
};
|
||||
|
||||
${config.custom.username} = {
|
||||
users.${config.custom.username} = {
|
||||
programs.home-manager.enable = true;
|
||||
systemd.user.startServices = "sd-switch"; # Start/stop user services immediately
|
||||
|
||||
|
@ -195,5 +180,4 @@
|
|||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -16,9 +16,8 @@ with lib; let
|
|||
jq = "${pkgs.jq}/bin/jq";
|
||||
kill = "${pkgs.procps}/bin/kill";
|
||||
kitty = "${config.home-manager.users.${config.custom.username}.programs.kitty.package}/bin/kitty";
|
||||
left = config.home-manager.users.${config.custom.username}.home.file.".local/bin/left".source;
|
||||
loginctl = "${pkgs.systemd}/bin/loginctl";
|
||||
menu = config.home-manager.users.${config.custom.username}.home.file.".local/bin/menu".source;
|
||||
menu = "~/.local/bin/menu";
|
||||
nautilus = "${pkgs.nautilus}/bin/nautilus";
|
||||
networkmanager_dmenu = "${pkgs.networkmanager_dmenu}/bin/networkmanager_dmenu";
|
||||
notify-send = "${pkgs.libnotify}/bin/notify-send";
|
||||
|
@ -27,7 +26,6 @@ with lib; let
|
|||
pkill = "${pkgs.procps}/bin/pkill";
|
||||
playerctl = "${pkgs.playerctl}/bin/playerctl";
|
||||
rofi-rbw = "${pkgs.rofi-rbw}/bin/rofi-rbw";
|
||||
rm = "${pkgs.coreutils}/bin/rm";
|
||||
sleep = "${pkgs.coreutils}/bin/sleep";
|
||||
steam = "${config.programs.steam.package}/bin/steam";
|
||||
swayosd-client = "${pkgs.swayosd}/bin/swayosd-client";
|
||||
|
@ -128,7 +126,7 @@ in {
|
|||
# TODO: Toggle trackball hand
|
||||
#// (key "Delete" "Super" "exec" "left")
|
||||
|
||||
(key "Delete" "Super+Shift" "exec" "${left} kensington-orbit-wireless-tb-mouse")
|
||||
(key "Delete" "Super+Shift" "exec" "vrr")
|
||||
(key "Down" "Super" "movewindow" "d")
|
||||
(key "Down" "Super+Shift" "movewindoworgroup" "d")
|
||||
(key "Equal" "Super" "exec" "audio Normalizer")
|
||||
|
@ -230,8 +228,8 @@ in {
|
|||
(key "T" "Super" "togglespecialworkspace" "terminal")
|
||||
(key "T" "Super+Shift" "movetoworkspacesilent" "terminal")
|
||||
(key "T" "Super+Shift" "exec" kitty)
|
||||
(key "V" "Super" "exec" "${menu} --clipboard")
|
||||
(key "V" "Super+Shift" "exec" "${rm} ~/.cache/walker/clipboard.gob; ${notify-send} walker 'Clipboard cleared' --urgency low")
|
||||
(key "V" "Super" "exec" "${kitty} --app-id clipboard --override font_size=12 ${clipse}")
|
||||
(key "V" "Super+Shift" "exec" "${clipse} -clear && ${notify-send} clipse 'Clipboard cleared' --urgency low")
|
||||
(key "W" "Super" "togglespecialworkspace" "vm")
|
||||
(key "W" "Super+Ctrl" "exec" "vm -x ${
|
||||
if config.custom.hidpi
|
||||
|
|
|
@ -9,7 +9,6 @@ with lib; let
|
|||
firefox-esr = "${
|
||||
config.home-manager.users.${config.custom.username}.programs.firefox.finalPackage
|
||||
}/bin/firefox-esr";
|
||||
left = config.home-manager.users.${config.custom.username}.home.file.".local/bin/left".source;
|
||||
pkill = "${pkgs.procps}/bin/pkill";
|
||||
rm = "${pkgs.coreutils}/bin/rm";
|
||||
sleep = "${pkgs.coreutils}/bin/sleep";
|
||||
|
@ -65,9 +64,10 @@ in {
|
|||
# https://wiki.hyprland.org/Configuring/Keywords/#executing
|
||||
exec-once =
|
||||
[
|
||||
"${rm} ~/.cache/walker/clipboard.gob" # Clear clipboard
|
||||
"${rm} ~/.config/qalculate/qalc.dmenu.history" # Clear calc history
|
||||
"${clipse} -clear" # Clear clipboard history
|
||||
"${clipse} -listen" # Monitor clipboard
|
||||
sway-audio-idle-inhibit # Inhibit idle while audio is playing
|
||||
left # Left-handed at boot
|
||||
|
||||
# TODO: Remove when systemd service fixed
|
||||
# https://github.com/Alexays/Waybar/issues/2882
|
||||
|
|
|
@ -14,176 +14,58 @@ in {
|
|||
programs.fish = {
|
||||
enable = true;
|
||||
|
||||
promptInit = ''
|
||||
# Disable greeting
|
||||
set -g fish_greeting
|
||||
|
||||
# Prompt
|
||||
function fish_prompt --description 'Write out the prompt'
|
||||
set -l last_status $status
|
||||
set -l normal (set_color normal)
|
||||
set -l status_color (set_color brgreen)
|
||||
set -l cwd_color (set_color $fish_color_cwd)
|
||||
set -l vcs_color (set_color brpurple)
|
||||
set -l prompt_status ""
|
||||
|
||||
# Since we display the prompt on a new line allow the directory names to be longer.
|
||||
set -q fish_prompt_pwd_dir_length
|
||||
or set -lx fish_prompt_pwd_dir_length 0
|
||||
|
||||
# Color the prompt differently when we're root
|
||||
set -l suffix '❯'
|
||||
if functions -q fish_is_root_user; and fish_is_root_user
|
||||
if set -q fish_color_cwd_root
|
||||
set cwd_color (set_color $fish_color_cwd_root)
|
||||
end
|
||||
set suffix '#'
|
||||
end
|
||||
|
||||
# Color the prompt in red on error
|
||||
if test $last_status -ne 0
|
||||
set status_color (set_color $fish_color_error)
|
||||
set prompt_status $status_color "[" $last_status "]" $normal
|
||||
end
|
||||
|
||||
echo -s (prompt_login) ' ' $cwd_color (prompt_pwd) $vcs_color (fish_vcs_prompt) $normal ' ' $prompt_status
|
||||
echo -n -s $status_color $suffix ' ' $normal
|
||||
end
|
||||
'';
|
||||
};
|
||||
|
||||
home-manager.users = {
|
||||
# Inherit root abbreviations from user
|
||||
root.programs.fish = {
|
||||
enable = true;
|
||||
shellAbbrs = config.home-manager.users.${config.custom.username}.programs.fish.shellAbbrs;
|
||||
};
|
||||
|
||||
${config.custom.username}.programs.fish = let
|
||||
any = expansion: {
|
||||
inherit expansion;
|
||||
position = "anywhere";
|
||||
};
|
||||
in {
|
||||
enable = true;
|
||||
|
||||
shellAbbrs = {
|
||||
# Expand abbreviations anywhere in the shell
|
||||
#?? sudo ABBREVIATION
|
||||
"/e" = any "/etc";
|
||||
"/en" = any "/etc/nixos";
|
||||
"/h" = any "~";
|
||||
"/hd" = any "~/.dev";
|
||||
"/n" = any "/nix";
|
||||
"/nv" = any "/nix/var";
|
||||
"/nvn" = any "/nix/var/nix";
|
||||
"/nvnp" = any "/nix/var/nix/profiles";
|
||||
"/nvnps" = any "/nix/var/nix/profiles/system";
|
||||
"/r" = any "/run";
|
||||
"/rc" = any "/run/current-system";
|
||||
|
||||
reboot = any "systemctl reboot";
|
||||
restart = any "systemctl reboot";
|
||||
poweroff = any "systemctl poweroff";
|
||||
shutdown = any "systemctl poweroff";
|
||||
|
||||
backup = any "borgmatic -v 1 create --progress --stats";
|
||||
extract = any "borgmatic -v 1 extract --progress";
|
||||
init = any "borgmatic init -e repokey-blake2";
|
||||
key = any "borgmatic key export";
|
||||
list = any "borgmatic -v 1 list";
|
||||
restore = any "borgmatic -v 1 restore";
|
||||
|
||||
rsync = any "rsync --info=progress2";
|
||||
|
||||
jc = any "journalctl";
|
||||
jcs = any "journalctl --system";
|
||||
jcse = any "journalctl --system --pager-end";
|
||||
jcseu = any "journalctl --system --pager-end --unit";
|
||||
jcsf = any "journalctl --system --follow";
|
||||
jcsfu = any "journalctl --system --follow --unit";
|
||||
jcsi = any "journalctl --system --identifier";
|
||||
jcst = any "journalctl --system --target";
|
||||
jcsu = any "journalctl --system --unit";
|
||||
jcu = any "journalctl --user";
|
||||
jcue = any "journalctl --user --pager-end";
|
||||
jcueu = any "journalctl --user --pager-end --unit";
|
||||
jcuf = any "journalctl --user --follow";
|
||||
jcufu = any "journalctl --user --follow --unit";
|
||||
jcui = any "journalctl --user --identifier";
|
||||
jcut = any "journalctl --user --target";
|
||||
jcuu = any "journalctl --user --unit";
|
||||
|
||||
sc = any "systemctl";
|
||||
scp = any "systemctl poweroff";
|
||||
scr = any "systemctl reboot";
|
||||
scs = any "systemctl --system";
|
||||
scsd = any "systemctl --system disable";
|
||||
scsdn = any "systemctl --system disable --now";
|
||||
scse = any "systemctl --system reenable";
|
||||
scsen = any "systemctl --system reenable --now";
|
||||
scsh = any "systemctl --system show";
|
||||
scsl = any "systemctl --system list-unit-files";
|
||||
scsm = any "systemctl --system mask";
|
||||
scsr = any "systemctl --system restart";
|
||||
scsrr = any "systemctl --system reload-or-restart";
|
||||
scss = any "systemctl --system status";
|
||||
scst = any "systemctl --system stop";
|
||||
scsu = any "systemctl --system unmask";
|
||||
scu = any "systemctl --user";
|
||||
scud = any "systemctl --user disable";
|
||||
scudn = any "systemctl --user disable --now";
|
||||
scue = any "systemctl --user reenable";
|
||||
scuen = any "systemctl --user reenable --now";
|
||||
scuh = any "systemctl --user show";
|
||||
scul = any "systemctl --user list-unit-files";
|
||||
scum = any "systemctl --user mask";
|
||||
scur = any "systemctl --user restart";
|
||||
scurr = any "systemctl --user reload-or-restart";
|
||||
scus = any "systemctl --user status";
|
||||
scut = any "systemctl --user stop";
|
||||
scuu = any "systemctl --user unmask";
|
||||
|
||||
d = any "docker";
|
||||
dc = any "docker compose";
|
||||
dcd = any "docker compose down";
|
||||
dce = any "docker compose exec";
|
||||
dcl = any "docker compose logs";
|
||||
dcp = any "docker compose pull";
|
||||
dcu = any "docker compose up";
|
||||
dcuf = any "docker compose up --force-recreate";
|
||||
de = any "docker exec";
|
||||
dei = any "docker exec --interactive";
|
||||
deit = any "docker exec --interactive --tty";
|
||||
det = any "docker exec --tty";
|
||||
di = any "docker images";
|
||||
dk = any "docker kill";
|
||||
dn = any "docker network";
|
||||
dnl = any "docker network ls";
|
||||
dp = any "docker pull";
|
||||
dps = any "docker ps";
|
||||
dpsa = any "docker ps --all --size";
|
||||
dr = any "docker rm";
|
||||
ds = any "docker system";
|
||||
dsp = any "docker system prune";
|
||||
dspav = any "docker system prune --all --volumes";
|
||||
|
||||
c = "clear";
|
||||
e = "exit";
|
||||
m = "mosh";
|
||||
s = "ssh";
|
||||
i = "tailscale ip --4";
|
||||
|
||||
ip = "tailscale ip --4";
|
||||
"/h" = "cd ~";
|
||||
"/hd" = "cd ~/.dev";
|
||||
"/e" = "cd /etc";
|
||||
"/en" = "cd /etc/nixos";
|
||||
"/n" = "cd /nix";
|
||||
"/nv" = "cd /nix/var";
|
||||
"/nvn" = "cd /nix/var/nix";
|
||||
"/nvnp" = "cd /nix/var/nix/profiles";
|
||||
"/nvnps" = "cd /nix/var/nix/profiles/system";
|
||||
"/r" = "cd /run";
|
||||
"/rc" = "cd /run/current-system";
|
||||
|
||||
n = "nixos";
|
||||
nb = "nixos build";
|
||||
nbb = "nixos build boot";
|
||||
nbs = "nixos build switch";
|
||||
nbt = "nixos build test";
|
||||
nd = "nixos diff";
|
||||
ng = "nixos generate";
|
||||
nl = "nixos list";
|
||||
nr = "nixos repl";
|
||||
f = "flakegen";
|
||||
r = "rebuild";
|
||||
rb = "rebuild boot";
|
||||
rbp = "rebuild boot && poweroff";
|
||||
rbr = "rebuild boot && reboot";
|
||||
rs = "rebuild switch";
|
||||
rt = "rebuild test";
|
||||
t = "target";
|
||||
u = "upgrade";
|
||||
ub = "upgrade boot";
|
||||
ubp = "upgrade boot && poweroff";
|
||||
ubr = "upgrade boot && reboot";
|
||||
|
||||
nd = "nvd diff /run/current-system /nix/var/nix/profiles/system";
|
||||
no = "nh os";
|
||||
nb = "flakegen && nh os boot";
|
||||
nbr = "flakegen && nh os boot && reboot";
|
||||
nbp = "flakegen && nh os boot && poweroff";
|
||||
ns = "flakegen && nh os switch";
|
||||
nt = "flakegen && nh os test";
|
||||
|
||||
jc = "journalctl";
|
||||
sc = "systemctl";
|
||||
|
||||
d = "docker";
|
||||
dc = "docker compose";
|
||||
dcd = "docker compose down";
|
||||
dce = "docker compose exec";
|
||||
dcl = "docker compose logs";
|
||||
dcp = "docker compose pull";
|
||||
dcu = "docker compose up";
|
||||
dcuf = "docker compose up --force-recreate";
|
||||
ds = "docker system";
|
||||
|
||||
g = "git";
|
||||
gb = "git bisect";
|
||||
|
@ -237,7 +119,43 @@ in {
|
|||
waydroid app launch com.YoStarEN.Arknights
|
||||
end
|
||||
'';
|
||||
};
|
||||
|
||||
promptInit = ''
|
||||
# Disable greeting
|
||||
set -g fish_greeting
|
||||
|
||||
# Prompt
|
||||
function fish_prompt --description 'Write out the prompt'
|
||||
set -l last_status $status
|
||||
set -l normal (set_color normal)
|
||||
set -l status_color (set_color brgreen)
|
||||
set -l cwd_color (set_color $fish_color_cwd)
|
||||
set -l vcs_color (set_color brpurple)
|
||||
set -l prompt_status ""
|
||||
|
||||
# Since we display the prompt on a new line allow the directory names to be longer.
|
||||
set -q fish_prompt_pwd_dir_length
|
||||
or set -lx fish_prompt_pwd_dir_length 0
|
||||
|
||||
# Color the prompt differently when we're root
|
||||
set -l suffix '❯'
|
||||
if functions -q fish_is_root_user; and fish_is_root_user
|
||||
if set -q fish_color_cwd_root
|
||||
set cwd_color (set_color $fish_color_cwd_root)
|
||||
end
|
||||
set suffix '#'
|
||||
end
|
||||
|
||||
# Color the prompt in red on error
|
||||
if test $last_status -ne 0
|
||||
set status_color (set_color $fish_color_error)
|
||||
set prompt_status $status_color "[" $last_status "]" $normal
|
||||
end
|
||||
|
||||
echo -s (prompt_login) ' ' $cwd_color (prompt_pwd) $vcs_color (fish_vcs_prompt) $normal ' ' $prompt_status
|
||||
echo -n -s $status_color $suffix ' ' $normal
|
||||
end
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -26,8 +26,6 @@ in {
|
|||
inactive_tab_font_style = "normal";
|
||||
confirm_os_window_close = 0;
|
||||
cursor_blink_interval = 0;
|
||||
cursor_shape = "beam";
|
||||
cursor_shape_unfocused = "underline";
|
||||
placement_strategy = "top-left"; # Partially fix padding
|
||||
scrollback_lines = -1;
|
||||
strip_trailing_spaces = "smart";
|
||||
|
|
|
@ -4,8 +4,6 @@
|
|||
...
|
||||
}:
|
||||
with lib; let
|
||||
menu = config.home-manager.users.${config.custom.username}.home.file.".local/bin/menu".source;
|
||||
|
||||
cfg = config.custom.programs.networkmanager-dmenu;
|
||||
in {
|
||||
options.custom.programs.networkmanager-dmenu.enable = mkOption {default = false;};
|
||||
|
@ -15,9 +13,11 @@ in {
|
|||
# https://github.com/firecat53/networkmanager-dmenu/blob/main/config.ini.example
|
||||
#!! Option not available, files written directly
|
||||
# FIXME: active_chars does not take effect
|
||||
home.file.".config/networkmanager-dmenu/config.ini".text = ''
|
||||
home.file.".config/networkmanager-dmenu/config.ini".text = let
|
||||
wofi = "${config.home-manager.users.${config.custom.username}.programs.wofi.package}/bin/wofi";
|
||||
in ''
|
||||
[dmenu]
|
||||
dmenu_command = ${menu} --input
|
||||
dmenu_command = ${wofi} --dmenu --lines 11
|
||||
active_chars = >
|
||||
wifi_icons =
|
||||
format = {icon} {name}
|
||||
|
|
|
@ -24,51 +24,16 @@ in {
|
|||
#?? systemctl --user restart walker.service
|
||||
runAsService = true;
|
||||
|
||||
# https://github.com/abenz1267/walker/wiki/Basic-Configuration
|
||||
# https://github.com/abenz1267/walker/blob/master/internal/config/config.default.json
|
||||
config = {
|
||||
activation_mode.disabled = true; # Key chords
|
||||
ignore_mouse = true; # Hover interrupts keyboard selections
|
||||
activation_mode.labels = ""; # Chord indicators
|
||||
search.placeholder = "";
|
||||
|
||||
# https://github.com/abenz1267/walker/wiki/Modules
|
||||
# https://www.nerdfonts.com/cheat-sheet
|
||||
builtins = {
|
||||
calculator.switcher_only = false;
|
||||
clipboard.switcher_only = true;
|
||||
commands.switcher_only = true;
|
||||
custom_commands.switcher_only = true;
|
||||
runner.switcher_only = true;
|
||||
ssh.switcher_only = true;
|
||||
windows.switcher_only = true;
|
||||
|
||||
applications = {
|
||||
# BUG: Ghost entries are still visible
|
||||
#// actions = false; # Desktop file actions
|
||||
|
||||
switcher_only = false;
|
||||
weight = 10;
|
||||
};
|
||||
|
||||
dmenu = {
|
||||
keep_sort = true; # Disable sorting entries
|
||||
placeholder = "Input";
|
||||
switcher_only = true;
|
||||
};
|
||||
|
||||
emojis = {
|
||||
placeholder = "Unicode";
|
||||
switcher_only = false;
|
||||
};
|
||||
|
||||
finder = {
|
||||
placeholder = "Files";
|
||||
switcher_only = true;
|
||||
};
|
||||
|
||||
websearch = {
|
||||
placeholder = "Search";
|
||||
switcher_only = true;
|
||||
actions = false; # Desktop file actions
|
||||
prioritize_new = false;
|
||||
show_sub_when_single = false; # Subtext with one module
|
||||
};
|
||||
};
|
||||
};
|
||||
|
@ -77,24 +42,21 @@ in {
|
|||
theme = {
|
||||
style = builtins.readFile ./style.css;
|
||||
|
||||
# https://github.com/abenz1267/walker/blob/master/internal/config/layout.default.json
|
||||
# https://github.com/abenz1267/walker/blob/master/internal/config/themes/bare.json
|
||||
layout.ui.window.box = rec {
|
||||
height = 250 / config.custom.scale;
|
||||
height = 500 / config.custom.scale;
|
||||
width = 1000 / config.custom.scale;
|
||||
|
||||
scroll.list = {
|
||||
min_height = height;
|
||||
max_height = height;
|
||||
max_width = width;
|
||||
min_width = width;
|
||||
|
||||
# Icon resolution
|
||||
item = {
|
||||
text.sub.hide = true; # Subtext
|
||||
|
||||
icon = {
|
||||
item.icon = {
|
||||
icon_size = "largest"; # 128px
|
||||
pixel_size = 32; # Downscale
|
||||
};
|
||||
pixel_size = 32;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
@ -21,7 +21,6 @@ https://docs.gtk.org/gtk4/css-properties.html
|
|||
/* Input box */
|
||||
#search entry {
|
||||
border-radius: 25px;
|
||||
margin-bottom: 4px;
|
||||
padding: 4px;
|
||||
}
|
||||
|
||||
|
@ -38,7 +37,7 @@ https://docs.gtk.org/gtk4/css-properties.html
|
|||
/* List entry */
|
||||
#list child {
|
||||
border-radius: 25px;
|
||||
margin: 2px 8px;
|
||||
margin: 4px 0;
|
||||
padding: 8px;
|
||||
}
|
||||
|
||||
|
|
|
@ -13,16 +13,13 @@ with lib; let
|
|||
hyprctl = "${
|
||||
config.home-manager.users.${config.custom.username}.wayland.windowManager.hyprland.finalPackage
|
||||
}/bin/hyprctl";
|
||||
inhibit = config.home-manager.users.${config.custom.username}.home.file.".local/bin/inhibit".source;
|
||||
jq = "${pkgs.jq}/bin/jq";
|
||||
loginctl = "${pkgs.systemd}/bin/loginctl";
|
||||
network = config.home-manager.users.${config.custom.username}.home.file.".local/bin/network".source;
|
||||
nm-connection-editor = "${pkgs.networkmanagerapplet}/bin/nm-connection-editor";
|
||||
pgrep = "${pkgs.procps}/bin/pgrep";
|
||||
ping = "${pkgs.iputils}/bin/ping";
|
||||
pkill = "${pkgs.procps}/bin/pkill";
|
||||
playerctl = "${pkgs.playerctl}/bin/playerctl";
|
||||
power = config.home-manager.users.${config.custom.username}.home.file.".local/bin/power".source;
|
||||
rfkill = "${pkgs.util-linux}/bin/rfkill";
|
||||
sleep = "${pkgs.coreutils}/bin/sleep";
|
||||
swaync-client = "${
|
||||
|
@ -32,8 +29,6 @@ with lib; let
|
|||
systemctl = "${pkgs.systemd}/bin/systemctl";
|
||||
systemd-inhibit = "${pkgs.systemd}/bin/systemd-inhibit";
|
||||
tailscale = "${pkgs.tailscale}/bin/tailscale";
|
||||
vm = config.home-manager.users.${config.custom.username}.home.file.".local/bin/vm".source;
|
||||
vpn = config.home-manager.users.${config.custom.username}.home.file.".local/bin/vpn".source;
|
||||
wttrbar = "${pkgs.wttrbar}/bin/wttrbar";
|
||||
|
||||
cfg = config.custom.programs.waybar;
|
||||
|
@ -131,13 +126,13 @@ in {
|
|||
"custom/inhibitor" = {
|
||||
interval = 5;
|
||||
exec = "~/.config/waybar/scripts/inhibitor.sh";
|
||||
on-click = inhibit;
|
||||
on-click = "~/.local/bin/inhibit";
|
||||
};
|
||||
|
||||
"custom/vm" = {
|
||||
interval = 5;
|
||||
exec = "~/.config/waybar/scripts/vm.sh";
|
||||
on-click = "${vm} -x ${
|
||||
on-click = "~/.local/bin/vm -x ${
|
||||
if config.custom.hidpi
|
||||
then "/scale:140"
|
||||
else ""
|
||||
|
@ -147,7 +142,7 @@ in {
|
|||
"custom/vpn" = {
|
||||
interval = 5;
|
||||
exec = "~/.config/waybar/scripts/vpn.sh";
|
||||
on-click = "${vpn} mypi3";
|
||||
on-click = "~/.local/bin/vpn mypi3";
|
||||
};
|
||||
|
||||
# https://github.com/Alexays/Waybar/wiki/Module:-Idle-Inhibitor
|
||||
|
@ -286,7 +281,7 @@ in {
|
|||
};
|
||||
|
||||
on-click = nm-connection-editor;
|
||||
on-click-right = network; # Toggle networking on/off
|
||||
on-click-right = "~/.local/bin/network"; # Toggle networking on/off
|
||||
};
|
||||
|
||||
# https://github.com/Alexays/Waybar/wiki/Module:-Battery
|
||||
|
@ -311,7 +306,7 @@ in {
|
|||
warning = 30;
|
||||
};
|
||||
|
||||
on-click = power; # Toggle power-saver mode
|
||||
on-click = "~/.local/bin/power"; # Toggle power-saver mode
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
@ -20,10 +20,6 @@ in {
|
|||
".local/bin/${name}".source =
|
||||
pkgs.writeShellApplication {
|
||||
inherit name;
|
||||
|
||||
# https://github.com/NixOS/nixpkgs/pull/261115
|
||||
#// excludeShellChecks = ["SC2154"]; # argc evaluates variables at runtime
|
||||
|
||||
runtimeInputs = dependencies;
|
||||
text = builtins.readFile ./${name}.sh;
|
||||
}
|
||||
|
@ -86,6 +82,11 @@ in {
|
|||
fprintd
|
||||
libnotify
|
||||
])
|
||||
(bash "flakegen" [
|
||||
git
|
||||
libnotify
|
||||
nix
|
||||
])
|
||||
(bash "inhibit" [
|
||||
coreutils
|
||||
libnotify
|
||||
|
@ -110,20 +111,18 @@ in {
|
|||
libnotify
|
||||
networkmanager
|
||||
])
|
||||
(bash "nixos" [
|
||||
argc
|
||||
coreutils
|
||||
git
|
||||
nh
|
||||
nix
|
||||
nixos-rebuild
|
||||
nvd
|
||||
systemd
|
||||
])
|
||||
(bash "power" [
|
||||
libnotify
|
||||
power-profiles-daemon
|
||||
])
|
||||
(bash "rebuild" [
|
||||
libnotify
|
||||
nixos-rebuild
|
||||
])
|
||||
(bash "repl" [
|
||||
libnotify
|
||||
nixos-rebuild
|
||||
])
|
||||
(bash "screenshot" [
|
||||
coreutils
|
||||
grimblast
|
||||
|
@ -131,12 +130,21 @@ in {
|
|||
libnotify
|
||||
swappy
|
||||
])
|
||||
(bash "target" [
|
||||
libnotify
|
||||
nixos-rebuild
|
||||
])
|
||||
(bash "toggle" [
|
||||
gnugrep
|
||||
hyprland
|
||||
jq
|
||||
libnotify
|
||||
])
|
||||
(bash "upgrade" [
|
||||
libnotify
|
||||
nix
|
||||
nixos-rebuild
|
||||
])
|
||||
(bash "vm" [
|
||||
coreutils
|
||||
freerdp3
|
||||
|
|
16
options/custom/scripts/flakegen.sh
Normal file
16
options/custom/scripts/flakegen.sh
Normal file
|
@ -0,0 +1,16 @@
|
|||
#! /usr/bin/env bash
|
||||
|
||||
# Generate flake.nix via flakegen
|
||||
# https://github.com/jorsn/flakegen
|
||||
|
||||
cd /etc/nixos || exit 1
|
||||
|
||||
if [[ "${1-}" == '-r' ]]; then
|
||||
# Nuke and reinitialize
|
||||
rm flake.nix
|
||||
nix flake init --template github:jorsn/flakegen
|
||||
else
|
||||
# Generate and track all files
|
||||
nix run .#genflake flake.nix
|
||||
git add .
|
||||
fi
|
|
@ -1,27 +1,15 @@
|
|||
#! /usr/bin/env bash
|
||||
|
||||
# Toggle left-handed mouse
|
||||
#?? left DEVICE
|
||||
# TODO: Make device-specific when commit released
|
||||
# https://github.com/hyprwm/hyprlang/commit/95471ec86f37acb8281062e54e2be99b24b50cd0
|
||||
|
||||
# BUG: New hyprctl syntax does not support per-device getoption
|
||||
# https://github.com/hyprwm/hyprlang/issues/43
|
||||
# HACK: Condition based on file presence, requires creation at login to set state
|
||||
#?? exec-once = left
|
||||
FILE=/tmp/left
|
||||
left=$(("$(hyprctl getoption input:left_handed -j | jq '.int')" - 1))
|
||||
|
||||
if (("$#" == 0)); then
|
||||
touch "$FILE"
|
||||
exit
|
||||
fi
|
||||
hyprctl keyword input:left_handed ${left#-}
|
||||
|
||||
if [[ -f "$FILE" ]]; then
|
||||
hyprctl keyword "device[$1]:left_handed" false
|
||||
hyprctl keyword "device[$1]:natural_scroll" false
|
||||
rm --force "$FILE"
|
||||
notify-send "> left" "Right-handed" --urgency low
|
||||
if [[ "$(hyprctl getoption input:left_handed -j | jq '.int')" == 1 ]]; then
|
||||
notify-send '> left' 'Left-handed' --urgency low
|
||||
else
|
||||
hyprctl keyword "device[$1]:left_handed" true
|
||||
hyprctl keyword "device[$1]:natural_scroll" true
|
||||
touch "$FILE"
|
||||
notify-send "> left" "Left-handed" --urgency low
|
||||
notify-send '> left' 'Right-handed' --urgency low
|
||||
fi
|
||||
|
|
|
@ -7,41 +7,35 @@ command=walker
|
|||
|
||||
while (("$#" > 0)); do
|
||||
case "$1" in
|
||||
--applications)
|
||||
-a | --applications)
|
||||
command="walker --modules applications"
|
||||
;;
|
||||
--calculator)
|
||||
-c | --calculator)
|
||||
command="walker --modules calc"
|
||||
;;
|
||||
--clipboard)
|
||||
command="walker --modules clipboard"
|
||||
;;
|
||||
--files)
|
||||
-f | --files)
|
||||
command="walker --modules finder"
|
||||
;;
|
||||
--input)
|
||||
-i | --input)
|
||||
command="walker --dmenu"
|
||||
;;
|
||||
--networks)
|
||||
-n | --networks)
|
||||
command="networkmanager_dmenu"
|
||||
;;
|
||||
--passwords)
|
||||
-p | --passwords)
|
||||
command="rofi-rbw"
|
||||
;;
|
||||
--runner)
|
||||
-r | --runner)
|
||||
command="walker --modules runner"
|
||||
;;
|
||||
--search)
|
||||
command="walker --modules websearch"
|
||||
;;
|
||||
--ssh)
|
||||
-s | --ssh)
|
||||
command="walker --modules ssh"
|
||||
;;
|
||||
--unicode)
|
||||
-u | --unicode)
|
||||
command="walker --modules emojis"
|
||||
;;
|
||||
--windows)
|
||||
command="walker --modules windows"
|
||||
-w | --web)
|
||||
command="walker --modules websearch"
|
||||
;;
|
||||
--)
|
||||
shift
|
||||
|
|
|
@ -1,113 +0,0 @@
|
|||
#! /usr/bin/env bash
|
||||
|
||||
cd /etc/nixos || exit 1
|
||||
|
||||
# @describe Wrapper for NixOS tools
|
||||
# Assumes flakes and configuration in /etc/nixos/
|
||||
#
|
||||
# https://github.com/sigoden/argc
|
||||
# https://github.com/jorsn/flakegen
|
||||
# https://github.com/viperML/nh
|
||||
|
||||
# @meta combine-shorts
|
||||
# @meta inherit-flag-options
|
||||
|
||||
# @cmd Build NixOS configuration
|
||||
# @alias b,bu,bui,buil
|
||||
# @option -b --builder[=nh|nixos] Use nh os (default) or nixos-rebuild to build
|
||||
# @option -t --target Remote machine to build with root, only nixos-rebuild is supported
|
||||
# @flag -n --no-generate Do not regenerate flake.nix before building
|
||||
# @flag -p --poweroff Gracefully poweroff system after a successful build
|
||||
# @flag -r --reboot Gracefully reboot system after a successful build
|
||||
# @flag -u --update Update flake.lock before building
|
||||
# @arg extra~ Pass extra arguments to builder
|
||||
build() { :; }
|
||||
|
||||
# Internal wrapper for subcommands
|
||||
_build() {
|
||||
# Regenerate flake.nix and stage git files by default
|
||||
if [[ ! "${argc_no_generate:-}" ]]; then
|
||||
nix run .#genflake flake.nix
|
||||
git add .
|
||||
fi
|
||||
|
||||
# Update flake.lock
|
||||
if [[ "${argc_update:-}" ]]; then
|
||||
nix flake update
|
||||
fi
|
||||
|
||||
# Build and send closures to remote machine
|
||||
if [[ "${argc_target:-}" ]]; then
|
||||
nixos-rebuild --flake ".#${argc_target}" --target-host "root@${argc_target}" "$1" ${argc_extra:+"${argc_extra[@]}"}
|
||||
else
|
||||
# Build current system
|
||||
if [[ "${argc_builder:-}" == nh ]]; then
|
||||
nh os "$1" ${argc_extra:+"${argc_extra[@]}"}
|
||||
elif [[ "${argc_builder:-}" == nixos ]]; then
|
||||
sudo nixos-rebuild "$1" ${argc_extra:+"${argc_extra[@]}"}
|
||||
fi
|
||||
fi
|
||||
|
||||
# Invoke systemd to shutdown system
|
||||
# Assumes errexit shell option is set
|
||||
if [[ "${argc_poweroff:-}" ]]; then
|
||||
sudo systemctl poweroff
|
||||
elif [[ "${argc_reboot:-}" ]]; then
|
||||
sudo systemctl reboot
|
||||
fi
|
||||
}
|
||||
|
||||
# @cmd Build and boot NixOS configuration
|
||||
# @alias b,bo,boo
|
||||
build::boot() { _build boot; }
|
||||
|
||||
# @cmd Build and switch NixOS configuration
|
||||
# @alias s,sw,swi,swit,switc
|
||||
build::switch() { _build switch; }
|
||||
|
||||
# @cmd Build and test NixOS configuration
|
||||
# @alias t,te,tes
|
||||
build::test() { _build test; }
|
||||
|
||||
# @cmd Compare NixOS system generations
|
||||
# @alias d,di,dif
|
||||
# @arg path1=/run/current-system Store path to compare with (current system by default)
|
||||
# @arg path2=/nix/var/nix/profiles/system Store path to compare against (built system by default)
|
||||
diff() {
|
||||
nvd diff "${argc_path1:-}" "${argc_path2:-}"
|
||||
}
|
||||
|
||||
# @cmd Generate flake.nix from flake.in.nix with flakegen
|
||||
# @alias g,ge,gen,gene,gener,genera,generat
|
||||
# @flag -n --nuke Delete flake.nix and reinitialize
|
||||
generate() {
|
||||
if [[ "${argc_nuke:-}" ]]; then
|
||||
rm --force flake.nix
|
||||
nix flake init --template github:jorsn/flakegen
|
||||
else
|
||||
nix run .#genflake flake.nix
|
||||
git add .
|
||||
fi
|
||||
}
|
||||
|
||||
# @cmd List NixOS generations
|
||||
# @alias l,li,lis
|
||||
# @arg extra~ Pass extra arguments to nixos-rebuild
|
||||
list() {
|
||||
nixos-rebuild list-generations ${argc_extra:+"${argc_extra[@]}"}
|
||||
}
|
||||
|
||||
# @cmd Enter an interactive NixOS read-eval-print loop with the current configuration
|
||||
# @alias r,re,rep
|
||||
# @flag -n --no-generate Do not regenerate flake.nix before entering loop
|
||||
# @arg extra~ Pass extra arguments to nixos-rebuild
|
||||
repl() {
|
||||
if [[ ! "${argc_no_generate:-}" ]]; then
|
||||
nix run .#genflake flake.nix
|
||||
git add .
|
||||
fi
|
||||
|
||||
nixos-rebuild repl ${argc_extra:+"${argc_extra[@]}"}
|
||||
}
|
||||
|
||||
eval "$(argc --argc-eval "$0" "$@")"
|
10
options/custom/scripts/rebuild.sh
Normal file
10
options/custom/scripts/rebuild.sh
Normal file
|
@ -0,0 +1,10 @@
|
|||
#! /usr/bin/env bash
|
||||
|
||||
# Rebuild local flake configuration
|
||||
|
||||
cd /etc/nixos || exit 1
|
||||
|
||||
nix run .#genflake flake.nix &&
|
||||
sleep 0.1 &&
|
||||
git add . &&
|
||||
sudo nixos-rebuild --show-trace "$@"
|
10
options/custom/scripts/repl.sh
Normal file
10
options/custom/scripts/repl.sh
Normal file
|
@ -0,0 +1,10 @@
|
|||
#! /usr/bin/env bash
|
||||
|
||||
# Nix repl with loaded configuration
|
||||
|
||||
cd /etc/nixos || exit 1
|
||||
|
||||
nix run .#genflake flake.nix &&
|
||||
sleep 0.1 &&
|
||||
git add . &&
|
||||
nixos-rebuild repl "$@"
|
10
options/custom/scripts/target.sh
Normal file
10
options/custom/scripts/target.sh
Normal file
|
@ -0,0 +1,10 @@
|
|||
#! /usr/bin/env bash
|
||||
|
||||
# Rebuild and send closures to remote machine
|
||||
|
||||
cd /etc/nixos || exit 1
|
||||
|
||||
nix run .#genflake flake.nix &&
|
||||
sleep 0.1 &&
|
||||
git add . &&
|
||||
nixos-rebuild --flake .#"$1" --target-host root@"$1" "$2" --show-trace "${@:3}"
|
11
options/custom/scripts/upgrade.sh
Normal file
11
options/custom/scripts/upgrade.sh
Normal file
|
@ -0,0 +1,11 @@
|
|||
#! /usr/bin/env bash
|
||||
|
||||
# Update flake.lock and rebuild
|
||||
|
||||
cd /etc/nixos || exit 1
|
||||
|
||||
nix run .#genflake flake.nix &&
|
||||
sleep 0.1 &&
|
||||
git add . &&
|
||||
sudo nix flake update &&
|
||||
sudo nixos-rebuild --show-trace "$@"
|
|
@ -35,6 +35,20 @@ in {
|
|||
};
|
||||
|
||||
shellAliases = {
|
||||
backup = "sudo borgmatic -v 1 create --progress --stats";
|
||||
extract = "sudo borgmatic -v 1 extract --progress";
|
||||
restore = "sudo borgmatic -v 1 restore";
|
||||
list = "sudo borgmatic -v 1 list";
|
||||
init = "sudo borgmatic init -e repokey-blake2";
|
||||
key = "sudo borgmatic key export";
|
||||
|
||||
reboot = "sudo systemctl reboot";
|
||||
restart = "sudo systemctl reboot";
|
||||
poweroff = "sudo systemctl poweroff";
|
||||
shutdown = "sudo systemctl poweroff";
|
||||
|
||||
rsync = "rsync --info=progress2";
|
||||
|
||||
# https://github.com/aksiksi/compose2nix?tab=readme-ov-file#usage
|
||||
# https://github.com/aksiksi/compose2nix?tab=readme-ov-file#agenix
|
||||
compose2nix = concatStringsSep " " [
|
||||
|
|
Loading…
Add table
Reference in a new issue