From a8056c5575e22c814fce2a87f5b1b0d71c8fc402 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Thu, 15 Aug 2024 13:08:00 +0200 Subject: ... --- accounts/gkleen@sif/default.nix | 172 +++----------------------------------- accounts/gkleen@sif/hyprland.nix | 26 ++++-- accounts/gkleen@sif/systemd.nix | 20 +---- accounts/gkleen@sif/zshrc | 175 +-------------------------------------- 4 files changed, 35 insertions(+), 358 deletions(-) diff --git a/accounts/gkleen@sif/default.nix b/accounts/gkleen@sif/default.nix index 3a051a7a..231913d9 100644 --- a/accounts/gkleen@sif/default.nix +++ b/accounts/gkleen@sif/default.nix @@ -4,13 +4,6 @@ with lib; let cfg = config.home-manager.users.${userName}; - deHaskell = flakeInputs.nixpkgs-stable.legacyPackages.x86_64-linux.haskell.packages.ghc92.override (oldAttrs: { - overrides = pkgs.lib.composeExtensions (oldAttrs.overrides or (_: _: {})) - (hself: hsuper: { - dbus = pkgs.haskell.lib.doJailbreak hsuper.dbus; - }); - }); - xmonad = import ./xmonad deHaskell; emacsScratch = pkgs.stdenv.mkDerivation (sources.emacs-scratch_el // rec { phases = [ "installPhase" ]; @@ -151,15 +144,6 @@ in { config = { services.displayManager.defaultSession = "Hyprland"; # "none+xmonad"; - services.xserver = { - windowManager.session = [{ - name = "xmonad"; - start = '' - ${pkgs.systemd}/bin/systemd-cat -t xmonad -- ${pkgs.coreutils}/bin/env -u SHLVL -- ${xmonad}/bin/xmonad & - waitPID=$! - ''; - }]; - }; home-manager.users.${userName} = { imports = [ @@ -254,12 +238,8 @@ in { }; }; - alacritty = { - enable = true; - settings = import ./alacritty.nix; - }; - zathura.enable = true; + imv.enable = true; mpv.config = { demuxer-max-bytes = 1073741824; @@ -267,24 +247,6 @@ in { # gpu-api = "vulkan"; }; - autorandr = { - enable = true; - hooks = { - preswitch = { - "stop-tray" = '' - ${pkgs.systemd}/bin/systemctl --user try-restart tray.target - ''; - }; - postswitch = { - # "restart-compton" = "${pkgs.systemd}/bin/systemctl --user try-restart picom"; - "restart-tray" = '' - ${pkgs.systemd}/bin/systemctl --user try-restart tray.target - ''; - }; - }; - profiles = customUtils.nixImport rec { dir = ./autorandr-profiles; _import = name: _base: import "${toString dir}/${name}" inputs; }; - }; - zsh.initExtra = "source ${./zshrc}"; zsh.dirHashes = let flakeHashes = mapAttrs' (n: v: nameValuePair (inputNames.${n} or n) (toString v)) flakeInputs; @@ -333,14 +295,6 @@ in { # notify_on_cmd_finish = "invisible 120"; }; }; - wofi = { - enable = true; - settings = { - location = "top"; - run-always_parse_args = true; - run-show_all = false; - }; - }; waybar = { enable = true; systemd = { @@ -605,41 +559,6 @@ in { mode = "center"; }; }; - hyprlock = { - enable = false; - settings = { - general = { - disable_loading_bar = false; - grace = 60; - hide_cursor = true; - no_fade_in = false; - }; - - background = [ - { - path = "screenshot"; - blur_passes = 3; - blur_size = 8; - } - ]; - - input-field = [ - { - size = "200, 50"; - position = "0, -80"; - monitor = ""; - dots_center = true; - fade_on_empty = false; - font_color = "rgb(202, 211, 245)"; - inner_color = "rgb(91, 96, 120)"; - outer_color = "rgb(24, 25, 38)"; - outline_thickness = 5; - placeholder_text = "'Password...'"; - shadow_passes = 2; - } - ]; - }; - }; fuzzel = { enable = true; settings = { @@ -690,13 +609,7 @@ in { grab ''; }; - taffybar = { - enable = false; - package = import ./taffybar { haskellPackages = deHaskell; }; - }; - # status-notifier-watcher.enable = true; xembed-sni-proxy.enable = true; - pasystray.enable = false; udiskie = { enable = true; automount = false; @@ -709,23 +622,9 @@ in { }; }; }; - unclutter = { - enable = false; - timeout = 5; - }; network-manager-applet.enable = true; blueman-applet.enable = true; - sxhkd = { - enable = true; - keybindings = { - "button8" = "${muteScript}/bin/mute unmute"; - "@button8" = "${muteScript}/bin/mute mute"; - "button9" = "${pkgs.pulseaudio}/bin/pacmd set-sink-mute @DEFAULT_SINK@ 1"; - "@button9" = "${pkgs.pulseaudio}/bin/pacmd set-sink-mute @DEFAULT_SINK@ 0"; - }; - }; - unison = { enable = true; pairs = { @@ -746,24 +645,6 @@ in { easyeffects = { enable = true; - preset = "LoudnessEqualizer"; - }; - - screen-locker = { - enable = false; - lockCmd = toString (pkgs.writeShellScript "lock" '' - ${pkgs.playerctl}/bin/playerctl -a status | ${pkgs.gnugrep}/bin/grep -q "Playing" && exit 0 - - cleanup() { - ${cfg.services.dunst.package}/bin/dunstctl set-paused false - } - trap cleanup EXIT INT TERM - - # ${pkgs.playerctl}/bin/playerctl -a pause - ${cfg.services.dunst.package}/bin/dunstctl set-paused true - ${pkgs.xsecurelock}/bin/xsecurelock - ''); - xss-lock.extraOptions = ["--transfer-sleep-lock"]; }; etesync-dav = { @@ -771,30 +652,6 @@ in { serverUrl = "https://etesync.yggdrasil.li"; }; - hypridle = { - enable = false; - settings = { - general = { - after_sleep_cmd = "hyprctl dispatch dpms on"; - before_sleep_cmd = "hyprlock"; - ignore_dbus_inhibit = false; - ignore_systemd_inhibit = false; - lock_cmd = "hyprlock"; - }; - - listener = [ - { - timeout = 300; - on-timeout = "hyprlock"; - } - { - timeout = 600; - on-timeout = "hyprctl dispatch dpms off"; - on-resume = "hyprctl dispatch dpms on"; - } - ]; - }; - }; swayidle = { enable = true; events = [ @@ -856,33 +713,23 @@ in { }; }; - xsession = { - enable = true; - - initExtra = '' - ${pkgs.xorg.xinput}/bin/xinput disable 'Synaptics TM3512-010' - ${pkgs.xorg.xmodmap}/bin/xmodmap -e 'keysym Caps_Lock = Multi_key' - ''; - - preferStatusNotifierItems = true; - }; + xsession.preferStatusNotifierItems = true; xresources.properties = import ./xresources.nix; home = { packages = with pkgs; [ fira fira-code powerline-fonts nerdfonts pavucontrol - wrappedKeepassxc sxiv xclip mumble pulseaudio-ctl pamixer - libnotify synergy xorg.xbacklight screen-message - wrappedYTMDesktop qt5ct playerctl evince thunderbird - zoom-us steam steam-run wireshark virt-manager - rclone cached-nix-shell xournal xmonad worktime + wrappedKeepassxc wl-clipboard-rs mumble pulseaudio-ctl + pamixer libnotify screen-message wrappedYTMDesktop qt5ct + playerctl evince thunderbird zoom-us steam steam-run + wireshark virt-manager rclone cached-nix-shell worktime fira-code-symbols libreoffice xournalpp google-chrome nixos-shell virt-viewer freerdp gnome-icon-theme paper-icon-theme sshpassSecret weechat element-desktop matrix-synapse-tools.synadm flakeInputs.deploy-rs.packages.${config.nixpkgs.system}.deploy-rs - sieve-connect gimp inkscape udiskie glab scrot nitrokey-app + sieve-connect gimp inkscape udiskie glab nitrokey-app pynitrokey gtklock wlrctl nvidiaOffloadScript ]; @@ -935,6 +782,9 @@ in { "gtklock/config.ini" = { source = (pkgs.formats.ini {}).generate "config.ini" { main = { + idle-hide = true; + follow-focus = true; + start-hidden = true; }; }; }; @@ -1035,7 +885,7 @@ in { doFilter = n: v: (filters.${n} or id) (filter (d: d != "emacs.desktop") v); in mapAttrs doFilter (cfg.lib.xdg.mimeAssociations [ cfg.programs.zathura.package - pkgs.sxiv + cfg.programs.imv.package cfg.programs.emacs.package cfg.programs.firefox.package ]) // { diff --git a/accounts/gkleen@sif/hyprland.nix b/accounts/gkleen@sif/hyprland.nix index c295997b..7491dcb4 100644 --- a/accounts/gkleen@sif/hyprland.nix +++ b/accounts/gkleen@sif/hyprland.nix @@ -15,7 +15,7 @@ in { ]; env = [ - # "XCURSOR_SIZE,12" + "XCURSOR_SIZE,12" "NIXOS_OZONE_WL,1" "QT_QPA_PLATFORM,wayland" "GDK_BACKEND,wayland" @@ -29,7 +29,7 @@ in { general = { gaps_in = 3; gaps_out = 9; - "col.active_border" = "rgba(33ccffee) rgba(00ff99ee) 45deg"; + "col.active_border" = "rgba(33ccffee) rgba(00ff95ee) 45deg"; "col.inactive_border" = "rgba(595959aa)"; resize_on_border = false; @@ -294,14 +294,26 @@ in { "suppressevent maximize fullscreen, class:.*" # "maximize, class:^(Element|thunderbird)$" - "workspace special:keepass, class:^org\.keepassxc\.KeePassXC$, title:^(?!KeePassXC - Access Request)$" + "workspace special:pavucontrol, class:^org\.pulseaudio\.pavucontrol$" + "workspace special:easyeffects, class:^com\.github\.wwmm\.easyeffects$" + "workspace special:blueman, class:^\.blueman-manager-wrapped$" + "workspace special:keepass silent, class:^org\.keepassxc\.KeePassXC$, title:^(?!Unlock Database.*)(?!.*Access Request)" # "group set always lock invade, class:^Element$" + "workspace 2, class:^firefox$" "workspace 4, class:^evince$" + "workspace 4, class:^imv$" + "workspace 4, class:^org\.pwmt\.zathura$" "workspace 10, class:^mpv$" - "float, class:^org\.keepassxc\.KeePassXC$, title:^KeePassXC - Access Request$" - "center, class:^org\.keepassxc\.KeePassXC$, title:^KeePassXC - Access Request$" - - "bordercolor rgba(ffee33ee) rgba(ff9500ee) 45deg, fullscreen:1" + "float, class:^org\.keepassxc\.KeePassXC$, title:Access Request$" + "center, class:^org\.keepassxc\.KeePassXC$, title:Access Request$" + "float, class:^org\.keepassxc\.KeePassXC$, title:^Unlock Database" + "center, class:^org\.keepassxc\.KeePassXC$, title:^Unlock Database" + "float, class:^xdg-desktop-portal-gtk$" + "center, class:^xdg-desktop-portal-gtk$" + + "bordercolor rgba(ffaa33ee) rgba(bfff00ee) 45deg, fullscreen:1" + "bordercolor rgba(3366ffee) rgba(6a00ffee) 45deg, xwayland:1" + "bordercolor rgba(6633ffee) rgba(ea00ffee) 45deg, xwayland:1, fullscreen:1" ]; workspace = [ diff --git a/accounts/gkleen@sif/systemd.nix b/accounts/gkleen@sif/systemd.nix index 5902946c..92404b61 100644 --- a/accounts/gkleen@sif/systemd.nix +++ b/accounts/gkleen@sif/systemd.nix @@ -126,11 +126,6 @@ in { After = ["graphical-session-pre.target"]; }; }; - taffybar = { - Service = { - Environment = with pkgs; "PATH=${worktime}/bin:${systemd}/bin"; - }; - }; dunst = { Service = { ExecStart = lib.mkForce "${cfg.services.dunst.package}/bin/dunst"; @@ -140,14 +135,6 @@ in { WantedBy = ["graphical-session.target"]; }; }; - xiccd = { - Service = { - Type = "simple"; - WorkingDirectory = "~"; - ExecStart = "${pkgs.xiccd}/bin/xiccd"; - Restart = "always"; - }; - }; keepassxc = { Service = { Type = "dbus"; @@ -161,11 +148,6 @@ in { After = ["graphical-session-pre.target"]; }; }; - xss-lock = { - Service = { - Environment = [ "XSECURELOCK_WANT_FIRST_KEYPRESS=1" ]; - }; - }; mpris-proxy = { Unit.Description = "Mpris proxy"; Unit.After = [ "network.target" "sound.target" ]; @@ -244,7 +226,7 @@ in { }; tray = { Unit = { - Wants = ["blueman-applet.service" "udiskie.service" "pasystray.service" "network-manager-applet.service"]; + Wants = ["blueman-applet.service" "udiskie.service" "network-manager-applet.service"]; }; }; }; diff --git a/accounts/gkleen@sif/zshrc b/accounts/gkleen@sif/zshrc index 83e86270..82e66337 100644 --- a/accounts/gkleen@sif/zshrc +++ b/accounts/gkleen@sif/zshrc @@ -1,106 +1,3 @@ -filebin() { - basePath=/srv/www/files - ssh ymir find /srv/www/files -type f -printf "$'%T@ %TY-%Tm-%TdT%TH:%TM %P\\\\0'" | sort -zn | cut -z -d ' ' -f 2- \ - | while IFS= read -r -d $'\0' l; do - IFS=' ' read -r t p <<<"${l}" - printf "%s https://f.141.li/%s\n" "${t}" "${p}" - done -} - -push2bin() { - if [[ ${#@} -eq 1 && ! -r ${1} ]]; then - uux -p 'ymir!push2bin' $(echo -n "${1:t}" | tr -c $'[:alnum:]+-=.' '_') - else - for f (${@}); do - uux -p 'ymir!push2bin' $(echo -n "${f:t}" | tr -c $'[:alnum:]+-=.' '_') <${f} - done - fi -} - -genmail() { - local baseName="" - local target="" - if [[ ${#@} -ge 1 ]]; then - target=${1} - shift - fi - - if [[ ${#@} -ge 1 ]]; then - baseName=$(pwgen ${@}) - else - baseName=$(pwgen -v -A -0 16 1) - fi - baseName=$(tr -cd $'[:alnum:]!#$%&*+-/=?^_{|}~.' <<<${baseName}) - address=${baseName}@141.li - insertAddr() { - echo "${baseName} gkleen" | ssh ymir tee -a /srv/mail/spm 1>/dev/null \ - } - - printf "%s\n" ${address} - read -q 'cont?Continue [y/N]? ' || return - - insertAddr -} - -s() { - dir=$(pwd) - [[ ${#@} -ge 1 ]] && dir=$1 - - shellFile=$(findNix ${@}) - [[ ${#@} -ge 1 ]] && shift - - typeset -a cmd - if [[ -d ${dir}/.nix-gc-roots ]]; then - cmd=(persistent-nix-shell ${shellFile} ${S_EXTRA_ARGS} ${@}) - else - cmd=(nix-shell ${shellFile} ${S_EXTRA_ARGS} ${@}) - fi - - if [[ -n "${S_SYSTEMD}" ]]; then - systemd-run --user --slice=development.slice --collect -E PATH=${PATH} -p WorkingDirectory=${dir} -- ${cmd} - else - ( - cd ${dir} - - exec ${cmd} - ) - fi -} - -sz() { - typeset -a S_EXTRA_ARGS - S_EXTRA_ARGS=(--run "env __ETC_ZSHENV_SOURCED=1 zsh") s ${@} -} -st() { - typeset -a S_EXTRA_ARGS - S_EXTRA_ARGS=(--run "tmux new-session env __ETC_ZSHENV_SOURCED=1 zsh") s ${@} -} -stt() { - typeset -a S_EXTRA_ARGS - S_SYSTEMD=true S_EXTRA_ARGS=(--run "urxvt -e tmux -S .tmux.sock new-session env __ETC_ZSHENV_SOURCED=1 zsh") s ${@} -} -se() { - typeset -a S_EXTRA_ARGS - S_SYSTEMD=true S_EXTRA_ARGS=(--run "emacs") s ${@} -} - -findNix() { - if [[ $#@ -eq 0 ]]; then - findNix $(pwd) - elif [[ -f "$1" ]]; then - print ${1:a} - elif [[ -d "$1" && -f "$1"/shell.nix ]]; then - print ${1:a}/shell.nix - elif [[ -d "$1" && -f "$1"/default.nix ]]; then - print ${1:a}/default.nix - elif [[ -d "$1" && "$1" != "/" ]]; then - findNix ${1:h} - else - printf "Traversed directories to ‘/’ and found no shell specification\n" >&2 - return 1 - fi -} - dir() { curlArchive=false templateArchive="" @@ -231,60 +128,9 @@ dir() { fi - # if [[ -n ${notmuchMsg} ]]; then - # getMimeTypes() { - # nix-shell -p mailcap --run "find \${buildInputs} -path '*/etc/mime.types' | head -n 1 | xargs -- cat" - # } - - # typeset -a messages - # messages=(${(z)$(notmuch search --output=messages ${notmuchMsg})}) - - # for message (${messages}); do - # typeset -A notmuchAtts - # notmuchAtts=() - - # while IFS= read -r -d $'\n' line; do - # [[ ${line} =~ '(attachment|part)\{ ID: ([0-9]+)' ]] || continue - # attId=${match[2]} - - # [[ ${line} =~ 'Content-type: multipart/' ]] && continue - - # fName="part_${attId}" - # [[ ${line} =~ 'Filename: (([^,]|,[^ ])+)' ]] && fName=${match[1]} - - # if [[ ${#messages} -gt 1 ]]; then - # fName="${message}/${fName}" - # fi - - # fExt="${fName:e}" - # [[ -n "${fExt}" ]] && fName="${fName:r}" - - # if [[ -z "${fExt}" && ${line} =~ 'Content-type: (([^,]|,[^ ])+)$' ]]; then - # fExt=$(getMimeTypes | grep ${match[1]}$'\t' | head -n 1 | awk '{ print $2; }') - # fi - - # mkdir -p ${fName:h} - # if [[ -n "${fExt}" ]]; then - # fName=$(mktemp -p . "${fName}.XXXXXX.${fExt}") - # else - # fName=$(mktemp -p . "${fName}.XXXXXX") - # fi - - # notmuchAtts[${attId}]=${fName} - # done <<(notmuch show --decrypt=false -- ${message} | tr -d $'\f') - - # for attId fName in ${(kv)notmuchAtts}; do - # [[ -d ${fName:h} ]] || mkdir -p ${fName:h} - # printf "#%d → ‘%s’\n" "${attId}" "${fName}" >&2 - - # notmuch show --decrypt=false --part=${attId} -- ${message} | pv -W -D 2 -i 0.1 >${fName} - # done - # done - # fi - - ${wormhole} && wormhole receive + if ${quickserve}; then quickserve --root . --upload . --show-hidden --tar gz fi @@ -370,16 +216,6 @@ tmpdir() { ) } -inhibit-sleep() { - if systemctl --user is-active prevent-suspend.service 1>/dev/null; then - echo "Allowing suspend" - systemctl --user stop prevent-suspend.service - else - echo "Inhibiting suspend" - systemctl --user start prevent-suspend.service - fi -} - qr() { qrencode -l M -o - -t ANSIUTF8 $@ } @@ -422,7 +258,7 @@ swap() { } ls() { - exa --all --group-directories-first --colour=always $@ | less --mouse -FR + eza --all --group-directories-first --colour=always $@ | less --mouse -FR } l() { @@ -437,10 +273,6 @@ ure() { systemctl --user --restart $@ } -u2wdb() { - ssh -t postgres@uniworxdb2 psql uni2work -} - ssh-installer() { ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o IdentityFile=~/.ssh/gkleen@sif.midgard.yggdrasil $@ } @@ -483,4 +315,5 @@ bindkey -e bindkey ';5C' emacs-forward-word bindkey ';5D' emacs-backward-word bindkey '^[[1;5C' emacs-forward-word -bindkey '^[[1;5D' emacs-backward-word \ No newline at end of file +bindkey '^[[1;5D' emacs-backward-word +bindkey '^H' backward-kill-word -- cgit v1.2.3