diff options
Diffstat (limited to '')
-rw-r--r-- | flake.lock | 42 | ||||
-rw-r--r-- | home/nipsy/arrakis/mutt/muttrc | 2 | ||||
-rw-r--r-- | home/nipsy/common/core/vim/vimrc | 4 | ||||
-rw-r--r-- | home/nipsy/common/optional/desktops/i3/default.nix | 7 | ||||
-rwxr-xr-x | home/nipsy/common/optional/desktops/i3/xscreensaver-activate | 100 | ||||
-rw-r--r-- | home/root/arrakis.nix | 54 | ||||
-rw-r--r-- | home/root/common/core/vim/vimrc | 4 | ||||
-rw-r--r-- | hosts/arrakis/hardware-configuration.nix | 16 | ||||
-rw-r--r-- | hosts/arrakis/services.nix | 16 | ||||
-rw-r--r-- | hosts/common/optional/games.nix | 3 | ||||
-rw-r--r-- | hosts/common/optional/google-authenticator.nix | 2 | ||||
-rw-r--r-- | hosts/common/optional/sound.nix | 10 |
12 files changed, 198 insertions, 62 deletions
@@ -7,11 +7,11 @@ ] }, "locked": { - "lastModified": 1736437680, - "narHash": "sha256-9Sy17XguKdEU9M5peTrkWSlI/O5IAqjHzdzxbXnc30g=", + "lastModified": 1737038063, + "narHash": "sha256-rMEuiK69MDhjz1JgbaeQ9mBDXMJ2/P8vmOYRbFndXsk=", "owner": "nix-community", "repo": "disko", - "rev": "4d5d07d37ff773338e40a92088f45f4f88e509c8", + "rev": "bf0abfde48f469c256f2b0f481c6281ff04a5db2", "type": "github" }, "original": { @@ -27,11 +27,11 @@ ] }, "locked": { - "lastModified": 1736421950, - "narHash": "sha256-RyrX0WFXxFrYvzHNLTIyuk3NcNl3UBykuYru/P0zW5E=", + "lastModified": 1737480538, + "narHash": "sha256-rk/cmrvq3In0TegW9qaAxw+5YpJhRWt2p74/6JStrw0=", "owner": "nix-community", "repo": "home-manager", - "rev": "d4aebb947a301b8da8654a804979a738c5c5da50", + "rev": "4481a16d1ac5bff4a77c608cefe08c9b9efe840d", "type": "github" }, "original": { @@ -63,11 +63,11 @@ }, "nixos-hardware": { "locked": { - "lastModified": 1736441705, - "narHash": "sha256-OL7leZ6KBhcDF3nEKe4aZVfIm6xQpb1Kb+mxySIP93o=", + "lastModified": 1737359802, + "narHash": "sha256-utplyRM6pqnN940gfaLFBb9oUCSzkan86IvmkhsVlN8=", "owner": "nixos", "repo": "nixos-hardware", - "rev": "8870dcaff63dfc6647fb10648b827e9d40b0a337", + "rev": "61c79181e77ef774ab0468b28a24bc2647d498d6", "type": "github" }, "original": { @@ -78,11 +78,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1736344531, - "narHash": "sha256-8YVQ9ZbSfuUk2bUf2KRj60NRraLPKPS0Q4QFTbc+c2c=", + "lastModified": 1737469691, + "narHash": "sha256-nmKOgAU48S41dTPIXAq0AHZSehWUn6ZPrUKijHAMmIk=", "owner": "nixos", "repo": "nixpkgs", - "rev": "bffc22eb12172e6db3c5dde9e3e5628f8e3e7912", + "rev": "9e4d5190a9482a1fb9d18adf0bdb83c6e506eaab", "type": "github" }, "original": { @@ -94,11 +94,11 @@ }, "nixpkgs-master": { "locked": { - "lastModified": 1736441877, - "narHash": "sha256-m3+PhBFkDwqo9lBplG4AyMW8P4/KcioJRS1UG8N7okM=", + "lastModified": 1737568255, + "narHash": "sha256-GZpOrZO+4eKvVG4p3moZnZfdFOXpBDPg9Vst1/MvWdk=", "owner": "nixos", "repo": "nixpkgs", - "rev": "ce3899414dab3297cf025bfa356dc2da426feefd", + "rev": "13d1fa195f9b57d682ba4141a6b3867c890e59c1", "type": "github" }, "original": { @@ -131,11 +131,11 @@ "utils": "utils" }, "locked": { - "lastModified": 1734937677, - "narHash": "sha256-5qKdUBN1cq/LHa6ASIjGcDEYKDnAiaKgNtZCRbBrWEs=", + "lastModified": 1736883042, + "narHash": "sha256-DFij3ZnNbP8bISN6ra6rKVb3CAhaX4jg3dDxJlDUFYA=", "owner": "icewind1991", "repo": "nvidia-patch-nixos", - "rev": "ec2e76e3cd53208c6bcbbddcc043516a24ca71b2", + "rev": "bb8ac52eff4c4e8df0a18ab444263f2619d0d25a", "type": "github" }, "original": { @@ -164,11 +164,11 @@ ] }, "locked": { - "lastModified": 1736203741, - "narHash": "sha256-eSjkBwBdQk+TZWFlLbclF2rAh4JxbGg8az4w/Lfe7f4=", + "lastModified": 1737411508, + "narHash": "sha256-j9IdflJwRtqo9WpM0OfAZml47eBblUHGNQTe62OUqTw=", "owner": "Mic92", "repo": "sops-nix", - "rev": "c9c88f08e3ee495e888b8d7c8624a0b2519cb773", + "rev": "015d461c16678fc02a2f405eb453abb509d4e1d4", "type": "github" }, "original": { diff --git a/home/nipsy/arrakis/mutt/muttrc b/home/nipsy/arrakis/mutt/muttrc index f77c5bf..1293092 100644 --- a/home/nipsy/arrakis/mutt/muttrc +++ b/home/nipsy/arrakis/mutt/muttrc @@ -53,7 +53,7 @@ set confirmcreate=no # prompt when creating new files set copy=yes # always save a copy of outgoing messages set delete=yes # purge deleted messages without asking set edit_headers # let me edit the message header when composing -set editor="vim -c 'set textwidth=65'" # editor to use when composing messages +set editor="vim -c 'set textwidth=65' -c 'set noautoindent' -c 'set formatoptions+=a'" # editor to use when composing messages #set editor="/usr/bin/nvi" # editor to use when composing messages #set editor="/usr/bin/vi" # editor to use when composing messages set fast_reply # skip initial prompts when replying diff --git a/home/nipsy/common/core/vim/vimrc b/home/nipsy/common/core/vim/vimrc index 9f652cd..87de2a0 100644 --- a/home/nipsy/common/core/vim/vimrc +++ b/home/nipsy/common/core/vim/vimrc @@ -43,5 +43,5 @@ set hlsearch " highlight all search matches set laststatus=2 set statusline=%<%f%h%m%r%=%{&ff}\ %Y\ %b\ 0x%B\ \ %l,%c%V\ %P -map <F5> :w<CR><bar>:!clear;go run %<CR> -map <F6> :w<CR><bar>:%! gofmt<CR> +"map <F5> :w<CR><bar>:!clear;go run %<CR> +"map <F6> :w<CR><bar>:%! gofmt<CR> diff --git a/home/nipsy/common/optional/desktops/i3/default.nix b/home/nipsy/common/optional/desktops/i3/default.nix index c7a521d..bbfc50c 100644 --- a/home/nipsy/common/optional/desktops/i3/default.nix +++ b/home/nipsy/common/optional/desktops/i3/default.nix @@ -36,6 +36,8 @@ foreground = #e5e5e5 cursor-color = #ffffff ''; + + "bin/xscreensaver-activate".source = ./xscreensaver-activate; }; packages = [ @@ -79,6 +81,11 @@ always = true; notification = false; } + { + command = "~/bin/xscreensaver-activate"; + always = true; + notification = false; + } ]; window.border = 0; window.commands = [ diff --git a/home/nipsy/common/optional/desktops/i3/xscreensaver-activate b/home/nipsy/common/optional/desktops/i3/xscreensaver-activate new file mode 100755 index 0000000..edcfa62 --- /dev/null +++ b/home/nipsy/common/optional/desktops/i3/xscreensaver-activate @@ -0,0 +1,100 @@ +#!/usr/bin/env zsh + +# bail out if xscreensaver isn't installed +if [[ ! -x =xscreensaver ]]; then + echo "no xscreensaver command found, ${0:t} bailing out" >&2 + exit 0 +fi + +# record our own PID to avoid duplicate invocations +PIDFILE="/dev/shm/${0:t}.pid" + +# check for already running script +if [[ -f ${PIDFILE} ]]; then + for i in $(pidof -x ${0:t}); do + if [[ ${i} -eq $(cat ${PIDFILE}) ]]; then + echo "${0:t} already running!" >&2 + exit 1 + fi + done +fi + +# record current PID +echo ${$} > ${PIDFILE} + +# wait a bit for everything to start +sleep 30 + +# check whether xscreensaver itself is running and start it if not +if ! systemctl --user --quiet is-active xscreensaver.service; then + systemctl --user start xscreensaver.service +fi + +# retrieve current Xorg screen size so we know where the corners are +xrandr | grep ^Screen | grep -Eo 'current [[:digit:]]+ x [[:digit:]]+' | cut -d' ' -f2,4 | read max_x max_y +echo "read screen size as ${max_x} x ${max_y}" + +# main loop +while true; do + + # retrieve current mouse position and set environment variables + eval $(xdotool getmouselocation --shell) + + # keep xscreensaver deactivated if we're in the top right corner of the screen + if [[ ${X} -eq $((max_x - 1)) && ${Y} -eq $((max_y - max_y)) ]]; then + + # make sure xscreensaver is even running before telling it to stay idle + if pidof xscreensaver &>/dev/null; then + sleep 5 + xscreensaver-command -deactivate &>/dev/null + fi + + # mouse is in the top left corner -- potentially activate xscreensaver right now + elif [[ ${X} -eq $((max_x - max_x)) && ${Y} -eq $((max_y - max_y)) ]]; then + + # sleep a bit and then check mouse coordinates again + sleep 5 + eval $(xdotool getmouselocation --shell) + + # mouse is still in the top left corner -- we must really want to activate xscreensaver + if [[ ${X} -eq $((max_x - max_x)) && ${Y} -eq $((max_y - max_y)) ]]; then + + # make sure xscreensaver is actually running + if pidof xscreensaver &>/dev/null; then + + # make sure it hasn't already activated + if ! xscreensaver-command -time | grep -q 'screen blanked since'; then + + # activate it! + xscreensaver-command -activate &>/dev/null + + fi + + fi + + fi + + # a Steam game is running + elif ps axfu | grep '/home/nipsy/.steam/debian-installation/steamapps/common' | grep -qv grep; then + + # make sure xscreensaver is even running before telling it to stay idle + if pidof xscreensaver &>/dev/null; then + sleep 5 + xscreensaver-command -deactivate &>/dev/null + fi + + fi + + # die off if we're no longer running on a connected Xorg screen any longer -- this should be the normal termination path for this script + if ! xdpyinfo &>/dev/null; then + rm ${PIDFILE} + exit 0 + fi + + # arbitrary sleep for script to avoid CPU sucking infinite loop + sleep 5 + +done + +# exit with error since we should never get here +exit 1 diff --git a/home/root/arrakis.nix b/home/root/arrakis.nix index b852ce5..ac7a30a 100644 --- a/home/root/arrakis.nix +++ b/home/root/arrakis.nix @@ -9,16 +9,16 @@ executable = true; text = '' #!${pkgs.zsh}/bin/zsh - + function status_vpn { - + ip netns exec vpn su -c 'curl -m 10 -s https://bitgnome.net/ip/ | grep REMOTE_ADDR' nipsy ip netns exec vpn su -c 'curl -m 10 -s https://www.cloudflarestatus.com | grep "Cloudflare Status"' nipsy - + } - + function start_vpn { - + ip netns add vpn ip link add veth.host type veth peer veth.vpn ip link set dev veth.host up @@ -32,44 +32,52 @@ ip -n vpn link set wg1 up ip -n vpn route add default dev wg1 ip netns exec vpn nft -f /etc/nftables-vpn.conf - + } - + function stop_vpn { - - ip netns del vpn - ip link del veth.host - + + systemctl stop prowlarr.service qbittorrent.service + + if ip netns | grep -q '^vpn '; then + ip netns del vpn + fi + + if ip link show veth.host > /dev/null; then + ip link del veth.host + fi + } - + if [[ -z "''${1}" || "''${1}" == "status" ]]; then - + status_vpn - + elif [[ "''${1}" == "restart" ]]; then - + stop_vpn sleep 2 start_vpn - + systemctl restart prowlarr.service qbittorrent.service + elif [[ "''${1}" == "restart_firewall" ]]; then - + ip netns exec vpn nft -f /etc/nftables-vpn.conf - + elif [[ "''${1}" == "start" ]]; then - + if [[ ! -f /run/netns/vpn ]]; then start_vpn else echo 'VPN service already appears to be running' >&2 fi - + elif [[ "''${1}" == "stop" ]]; then - + stop_vpn - + fi - + exit 0 ''; }; diff --git a/home/root/common/core/vim/vimrc b/home/root/common/core/vim/vimrc index 9f652cd..87de2a0 100644 --- a/home/root/common/core/vim/vimrc +++ b/home/root/common/core/vim/vimrc @@ -43,5 +43,5 @@ set hlsearch " highlight all search matches set laststatus=2 set statusline=%<%f%h%m%r%=%{&ff}\ %Y\ %b\ 0x%B\ \ %l,%c%V\ %P -map <F5> :w<CR><bar>:!clear;go run %<CR> -map <F6> :w<CR><bar>:%! gofmt<CR> +"map <F5> :w<CR><bar>:!clear;go run %<CR> +"map <F6> :w<CR><bar>:%! gofmt<CR> diff --git a/hosts/arrakis/hardware-configuration.nix b/hosts/arrakis/hardware-configuration.nix index 3c508e5..855152e 100644 --- a/hosts/arrakis/hardware-configuration.nix +++ b/hosts/arrakis/hardware-configuration.nix @@ -50,16 +50,32 @@ hardware = { bluetooth.enable = true; + graphics = { enable = true; extraPackages = with pkgs; [ nvidia-vaapi-driver ]; extraPackages32 = with pkgs.pkgsi686Linux; [ nvidia-vaapi-driver ]; }; + nvidia = { modesetting.enable = true; open = true; package = pkgs.nvidia-patch.patch-nvenc (pkgs.nvidia-patch.patch-fbc config.boot.kernelPackages.nvidiaPackages.beta); #package = config.boot.kernelPackages.nvidiaPackages.beta; }; + + printers = let + brother = "Brother_HL-L2340D"; + ip = "192.168.1.20"; + in { + ensureDefaultPrinter = brother; + ensurePrinters = [{ + name = brother; + deviceUri = "ipp://${ip}/ipp"; + model = "everywhere"; + description = lib.replaceStrings [ "_" ] [ " " ] brother; + location = "home"; + }]; + }; }; } diff --git a/hosts/arrakis/services.nix b/hosts/arrakis/services.nix index ceb60c4..b3fcc91 100644 --- a/hosts/arrakis/services.nix +++ b/hosts/arrakis/services.nix @@ -19,12 +19,6 @@ services = { - avahi = { - enable = true; - nssmdns4 = true; - openFirewall = true; - }; - cgit = { "arrakis.bitgnome.net" = { enable = true; @@ -58,7 +52,7 @@ cron.enable = true; - #dictd.enable = true; + dictd.enable = true; iperf3.openFirewall = true; @@ -291,10 +285,10 @@ device = "/dev/disk/by-id/nvme-WD_BLACK_SN850X_4000GB_23162P800014"; options = "-a -o on -S on -m ${my_email_addr}"; } - #{ - # device = "/dev/disk/by-id/ata-WDC_WD80EFAX-68KNBN0_VAHUEZNL"; - # options = "-a -o on -S on -s (S/../.././02|L/../../5/03) -m ${my_email_addr}"; - #} + { + device = "/dev/disk/by-id/ata-WDC_WUH722020ALE604_2LG5X74K"; + options = "-a -o on -S on -s (S/../.././02|L/../../5/03) -m ${my_email_addr}"; + } { device = "/dev/disk/by-id/ata-WDC_WD80EFAX-68KNBN0_VAHUUSXL"; options = "-a -o on -S on -s (S/../.././02|L/../../5/03) -m ${my_email_addr}"; diff --git a/hosts/common/optional/games.nix b/hosts/common/optional/games.nix index c0770cd..ded605c 100644 --- a/hosts/common/optional/games.nix +++ b/hosts/common/optional/games.nix @@ -21,6 +21,7 @@ programs.steam = { enable = true; - extraCompatPackages = with pkgs; [ proton-ge-bin ]; + extraCompatPackages = [ pkgs.proton-ge-bin ]; + #package = pkgs.master.steam; }; } diff --git a/hosts/common/optional/google-authenticator.nix b/hosts/common/optional/google-authenticator.nix index 7380d1b..09079d8 100644 --- a/hosts/common/optional/google-authenticator.nix +++ b/hosts/common/optional/google-authenticator.nix @@ -9,7 +9,7 @@ security.pam.services = { chfn.googleAuthenticator.enable = true; chsh.googleAuthenticator.enable = true; - cups.googleAuthenticator.enable = true; + #cups.googleAuthenticator.enable = true; lightdm.googleAuthenticator.enable = true; login.googleAuthenticator.enable = true; other.googleAuthenticator.enable = true; diff --git a/hosts/common/optional/sound.nix b/hosts/common/optional/sound.nix index ec7f41d..6312d3b 100644 --- a/hosts/common/optional/sound.nix +++ b/hosts/common/optional/sound.nix @@ -2,14 +2,21 @@ { environment = { systemPackages = with pkgs; [ + artyFX + audacity bespokesynth + boops cardinal chow-tape-model distrho-ports fluidsynth + #master.fmsynth geonkick + guitarix + gxplugins-lv2 lilypond-unstable-with-fonts lsp-plugins + metersLv2 odin2 oxefmsynth polyphone @@ -18,8 +25,11 @@ master.rosegarden samplv1 sfizz + sorcer surge-XT synthv1 + talentedhack + #master.tunefish v4l-utils vapoursynth vital |