diff --git a/home-manager/common.nix b/home-manager/common.nix index 4a9b876..9a45538 100644 --- a/home-manager/common.nix +++ b/home-manager/common.nix @@ -33,46 +33,46 @@ inputs: home.sessionVariables = { TERM = "xterm-256color"; }; programs.fish = { - enable = true; - shellAliases = { - ls = "lsd"; - la = "ls -a"; - lla = "ls -la"; - lt = "ls --tree"; - }; - plugins = [ - { - name = "done"; - src = inputs.done; - } - { - name = "bobthefish"; - src = inputs.bobthefish; - } - ]; - shellInit = '' - # Load nix shit on non-NixOS computers (yea yea laugh it up we all have legacy machines somewhere) - if not set -q NIX_PATH - set --prepend fish_function_path ${pkgs.fishPlugins.foreign-env}/share/fish/vendor_functions.d - fenv source $HOME/.nix-profile/etc/profile.d/nix.sh - set -e fish_function_path[1] - end - ''; - interactiveShellInit = '' - set TERM xterm-256color - - set -U __done_min_cmd_duration 2000 - - set -Ua fish_user_paths ~/.bin - set -Ua fish_user_paths ~/.local/bin - set -Ua fish_user_paths ~/.npm-global/bin - set -Ua fish_user_paths ~/.cargo/bin - - set -U fish_key_bindings fish_default_key_bindings - set -g theme_nerd_fonts yes - set -g theme_display_date no - - eval (${pkgs.direnv}/bin/direnv hook fish) - ''; + enable = true; + shellAliases = { + ls = "lsd"; + la = "ls -a"; + lla = "ls -la"; + lt = "ls --tree"; }; + plugins = [ + { + name = "done"; + src = inputs.done; + } + { + name = "bobthefish"; + src = inputs.bobthefish; + } + ]; + shellInit = '' + # Load nix shit on non-NixOS computers (yea yea laugh it up we all have legacy machines somewhere) + if not set -q NIX_PATH + set --prepend fish_function_path ${pkgs.fishPlugins.foreign-env}/share/fish/vendor_functions.d + fenv source $HOME/.nix-profile/etc/profile.d/nix.sh + set -e fish_function_path[1] + end + ''; + interactiveShellInit = '' + set TERM xterm-256color + + set -U __done_min_cmd_duration 2000 + + set -Ua fish_user_paths ~/.bin + set -Ua fish_user_paths ~/.local/bin + set -Ua fish_user_paths ~/.npm-global/bin + set -Ua fish_user_paths ~/.cargo/bin + + set -U fish_key_bindings fish_default_key_bindings + set -g theme_nerd_fonts yes + set -g theme_display_date no + + eval (${pkgs.direnv}/bin/direnv hook fish) + ''; + }; } diff --git a/home-manager/modules/ezpcusr.nix b/home-manager/modules/ezpcusr.nix index a513a35..b4ab659 100644 --- a/home-manager/modules/ezpcusr.nix +++ b/home-manager/modules/ezpcusr.nix @@ -373,118 +373,119 @@ in modules-right = [ "custom/left-arrow-dark" "pulseaudio" "custom/left-arrow-light" "custom/left-arrow-dark" "memory" "custom/left-arrow-light" "custom/left-arrow-dark" "cpu" "custom/left-arrow-light" "custom/left-arrow-dark" ] ++ lib.optionals cfg.battery [ "battery" "custom/left-arrow-light" "custom/left-arrow-dark" ] ++ [ "tray" ]; modules = - let - checkWttr = "${pkgs.bash}/bin/bash -c '! (${pkgs.curl}/bin/curl wttr.in/${cfg.location}?format=+ | ${pkgs.gnugrep}/bin/grep \\'^Unknown location;\\')'"; - in { - "custom/left-arrow-dark" = { - format = ""; - tooltip = false; - rotate = 270; - }; - "custom/left-arrow-light" = { - format = ""; - tooltip = false; - rotate = 270; - }; - "custom/right-arrow-dark" = { - format = ""; - tooltip = false; - rotate = 270; - }; - "custom/right-arrow-light" = { - format = ""; - tooltip = false; - rotate = 270; - }; + let + checkWttr = "${pkgs.bash}/bin/bash -c '! (${pkgs.curl}/bin/curl wttr.in/${cfg.location}?format=+ | ${pkgs.gnugrep}/bin/grep \\'^Unknown location;\\')'"; + in + { + "custom/left-arrow-dark" = { + format = ""; + tooltip = false; + rotate = 270; + }; + "custom/left-arrow-light" = { + format = ""; + tooltip = false; + rotate = 270; + }; + "custom/right-arrow-dark" = { + format = ""; + tooltip = false; + rotate = 270; + }; + "custom/right-arrow-light" = { + format = ""; + tooltip = false; + rotate = 270; + }; - "custom/weather-temp" = { - exec-if = checkWttr; - exec = "${pkgs.curl}/bin/curl 'wttr.in/${cfg.location}?format=%c+%t' || echo ERR"; - on-click = "${pkgs.xdg-utils}/bin/xdg-open 'https://weather.com/weather/today/l/85625'"; - on-click-right = "${pkgs.xdg-utils}/bin/xdg-open 'https://wttr.in/${cfg.location}'"; - interval = 900; - }; - "custom/weather-precip" = { - exec-if = checkWttr; - exec = "${pkgs.curl}/bin/curl 'wttr.in/${cfg.location}?format=🌧️+%p'"; - on-click = "${pkgs.xdg-utils}/bin/xdg-open 'https://www.lightningmaps.org/'"; - on-click-right = "${pkgs.xdg-utils}/bin/xdg-open 'https://wttr.in/${cfg.location}'"; - interval = 900; - }; - "custom/weather-wind" = { - exec-if = checkWttr; - exec = "${pkgs.curl}/bin/curl 'wttr.in/${cfg.location}?format=🌬️+%w'"; - on-click = "${pkgs.xdg-utils}/bin/xdg-open 'https://www.ventusky.com/"; - on-click-right = "${pkgs.xdg-utils}/bin/xdg-open 'https://wttr.in/${cfg.location}'"; - interval = 900; - }; + "custom/weather-temp" = { + exec-if = checkWttr; + exec = "${pkgs.curl}/bin/curl 'wttr.in/${cfg.location}?format=%c+%t' || echo ERR"; + on-click = "${pkgs.xdg-utils}/bin/xdg-open 'https://weather.com/weather/today/l/85625'"; + on-click-right = "${pkgs.xdg-utils}/bin/xdg-open 'https://wttr.in/${cfg.location}'"; + interval = 900; + }; + "custom/weather-precip" = { + exec-if = checkWttr; + exec = "${pkgs.curl}/bin/curl 'wttr.in/${cfg.location}?format=🌧️+%p'"; + on-click = "${pkgs.xdg-utils}/bin/xdg-open 'https://www.lightningmaps.org/'"; + on-click-right = "${pkgs.xdg-utils}/bin/xdg-open 'https://wttr.in/${cfg.location}'"; + interval = 900; + }; + "custom/weather-wind" = { + exec-if = checkWttr; + exec = "${pkgs.curl}/bin/curl 'wttr.in/${cfg.location}?format=🌬️+%w'"; + on-click = "${pkgs.xdg-utils}/bin/xdg-open 'https://www.ventusky.com/"; + on-click-right = "${pkgs.xdg-utils}/bin/xdg-open 'https://wttr.in/${cfg.location}'"; + interval = 900; + }; - mpd = { - rotate = 90; - max-length = 60; - format = "{stateIcon} {artist} - {title}"; - format-stopped = "⏹ STOPPED"; - state-icons = { - paused = ""; - playing = ""; + mpd = { + rotate = 90; + max-length = 60; + format = "{stateIcon} {artist} - {title}"; + format-stopped = "⏹ STOPPED"; + state-icons = { + paused = ""; + playing = ""; + }; + }; + + "sway/workspaces" = { + disable-scroll = true; + }; + + "clock#1" = { + tooltip = false; + format = "{:%a}"; + }; + "clock#2" = { + tooltip = false; + format = "{:%m-%d}"; + }; + "clock#3" = { + tooltip = false; + format = "{:%I:%M %p}"; + }; + + pulseaudio = { + format = "{icon} {volume}%"; + format-bluetooth = "{icon} {volume}%"; + format-muted = "MUTE"; + format-icons = { + headphone = ""; + default = ""; + }; + on-click = "${pkgs.pulseaudio}/bin/pactl set-source-mute @DEFAULT_SOURCE@ toggle"; + on-click-right = "${pkgs.pavucontrol}/bin/pavucontrol"; + }; + + memory = { + interval = 10; + format = " {}%"; + }; + + cpu = { + interval = 10; + format = " {usage}%"; + }; + + battery = { + states = { + good = 90; + warning = 25; + critical = 10; + }; + format = "{icon} {capacity}%"; + format-icons = [ "" "" "" "" "" ]; + }; + + tray = { + icon-size = 18; + spacing = 5; }; }; - "sway/workspaces" = { - disable-scroll = true; - }; - - "clock#1" = { - tooltip = false; - format = "{:%a}"; - }; - "clock#2" = { - tooltip = false; - format = "{:%m-%d}"; - }; - "clock#3" = { - tooltip = false; - format = "{:%I:%M %p}"; - }; - - pulseaudio = { - format = "{icon} {volume}%"; - format-bluetooth = "{icon} {volume}%"; - format-muted = "MUTE"; - format-icons = { - headphone = ""; - default = ""; - }; - on-click = "${pkgs.pulseaudio}/bin/pactl set-source-mute @DEFAULT_SOURCE@ toggle"; - on-click-right = "${pkgs.pavucontrol}/bin/pavucontrol"; - }; - - memory = { - interval = 10; - format = " {}%"; - }; - - cpu = { - interval = 10; - format = " {usage}%"; - }; - - battery = { - states = { - good = 90; - warning = 25; - critical = 10; - }; - format = "{icon} {capacity}%"; - format-icons = [ "" "" "" "" "" ]; - }; - - tray = { - icon-size = 18; - spacing = 5; - }; - }; - } // cfg.waybarConfig) ]; diff --git a/home-manager/modules/gaming.nix b/home-manager/modules/gaming.nix index 98941f5..ad26c12 100644 --- a/home-manager/modules/gaming.nix +++ b/home-manager/modules/gaming.nix @@ -111,83 +111,87 @@ in ) ]; - systemd.user.services.sunshine = { - Unit = { - Description = "Host for Moonlight Streaming Client"; - Requires = [ "dbus.service" ]; - After = [ "graphical-session-pre.target" "network.target" ]; - PartOf = [ "graphical-session.target" ]; - }; - - Install = { - WantedBy = [ "graphical-session.target" ]; - }; - - Service = { - WorkingDirectory = "${config.xdg.configHome}/sunshine"; - Restart = "on-failure"; - RestartSec = 3; - ExecStart = "${sunshine}/bin/sunshine"; - ExecStartPre = - let - script = pkgs.writeShellScript "sunshine-pre-start" '' - ${pkgs.coreutils}/bin/mkdir -p $HOME/.config/sunshine/assets - - ${pkgs.coreutils}/bin/rm -rf $HOME/.config/sunshine/assets/shaders - ${pkgs.coreutils}/bin/rm -rf $HOME/.config/sunshine/assets/web - ${pkgs.coreutils}/bin/rm -rf $HOME/.config/sunshine/assets/box.png - - ${pkgs.coreutils}/bin/cp --no-preserve=all -r ${sunshineAssets}/shaders $HOME/.config/sunshine/assets - ${pkgs.coreutils}/bin/cp --no-preserve=all -r ${sunshineAssets}/web $HOME/.config/sunshine/assets - ${pkgs.coreutils}/bin/cp --no-preserve=all ${sunshineAssets}/box.png $HOME/.config/sunshine/assets - ''; - in - "${script}"; - }; + systemd.user.services.sunshine = { + Unit = { + Description = "Host for Moonlight Streaming Client"; + Requires = [ "dbus.service" ]; + After = [ "graphical-session-pre.target" "network.target" ]; + PartOf = [ "graphical-session.target" ]; }; - systemd.user.services.scc = { - Unit = { - Description = "User-mode driver and GTK3 based GUI for Steam Controller"; - After = [ "graphical-session-pre.target" ]; - PartOf = [ "graphical-session.target" ]; - }; - - Service = { - Type = "simple"; - ExecStart = "${pkgs.sc-controller}/bin/scc-daemon debug"; - Restart = "always"; - RestartSec = 5; - }; - - Install = { WantedBy = [ "graphical-session.target" ]; }; + Install = { + WantedBy = [ "graphical-session.target" ]; }; - systemd.user.services.steam = { - Unit = { - Description = "Start Steam gaming platform"; - After = [ "graphical-session-pre.target" ]; - PartOf = [ "graphical-session.target" ]; - }; + Service = { + WorkingDirectory = "${config.xdg.configHome}/sunshine"; + Restart = "on-failure"; + RestartSec = 3; + ExecStart = "${sunshine}/bin/sunshine"; + ExecStartPre = + let + script = pkgs.writeShellScript "sunshine-pre-start" '' + ${pkgs.coreutils}/bin/mkdir -p $HOME/.config/sunshine/assets - Service = { - Type = "simple"; - ExecStart = let + ${pkgs.coreutils}/bin/rm -rf $HOME/.config/sunshine/assets/shaders + ${pkgs.coreutils}/bin/rm -rf $HOME/.config/sunshine/assets/web + ${pkgs.coreutils}/bin/rm -rf $HOME/.config/sunshine/assets/box.png + + ${pkgs.coreutils}/bin/cp --no-preserve=all -r ${sunshineAssets}/shaders $HOME/.config/sunshine/assets + ${pkgs.coreutils}/bin/cp --no-preserve=all -r ${sunshineAssets}/web $HOME/.config/sunshine/assets + ${pkgs.coreutils}/bin/cp --no-preserve=all ${sunshineAssets}/box.png $HOME/.config/sunshine/assets + ''; + in + "${script}"; + }; + }; + + systemd.user.services.scc = { + Unit = { + Description = "User-mode driver and GTK3 based GUI for Steam Controller"; + After = [ "graphical-session-pre.target" ]; + PartOf = [ "graphical-session.target" ]; + }; + + Service = { + Type = "simple"; + ExecStart = "${pkgs.sc-controller}/bin/scc-daemon debug"; + Restart = "always"; + RestartSec = 5; + }; + + Install = { WantedBy = [ "graphical-session.target" ]; }; + }; + + systemd.user.services.steam = { + Unit = { + Description = "Start Steam gaming platform"; + After = [ "graphical-session-pre.target" ]; + PartOf = [ "graphical-session.target" ]; + }; + + Service = { + Type = "simple"; + ExecStart = + let steamStart = pkgs.writeShellScript "steam-start" '' ${pkgs.systemd}/bin/systemctl --user stop scc # no sleep is needed here because steam is slow as fuck lol /run/current-system/sw/bin/steam ''; - in "${steamStart}"; - ExecStop = let + in + "${steamStart}"; + ExecStop = + let steamStop = pkgs.writeShellScript "steam-stop" '' ${pkgs.coreutils}/bin/sleep 5 # give time for controller to reset ${pkgs.systemd}/bin/systemctl --user start scc ''; - in "${steamStop}"; - }; - - Install = { WantedBy = [ "graphical-session.target" ]; }; + in + "${steamStop}"; }; + + Install = { WantedBy = [ "graphical-session.target" ]; }; }; + }; } diff --git a/modules/ezpw.nix b/modules/ezpw.nix index 2e2c407..0eebd4e 100644 --- a/modules/ezpw.nix +++ b/modules/ezpw.nix @@ -56,7 +56,7 @@ in } { name = "libpipewire-module-access"; - args = {}; + args = { }; } { name = "libpipewire-module-adapter"; } { name = "libpipewire-module-link-factory"; } diff --git a/modules/workstation.nix b/modules/workstation.nix index 1afd994..fdc4cab 100644 --- a/modules/workstation.nix +++ b/modules/workstation.nix @@ -169,21 +169,27 @@ in { from = 27031; to = 27036; - } + } ]; networking.firewall.allowedTCPPorts = [ # Steam remote play 27036 # Sunshine/moonlight streaming - 47984 47989 48010 + 47984 + 47989 + 48010 ]; networking.firewall.allowedUDPPorts = [ # Used for upnp or something? 1900 # Sunshine/moonlight streaming - 47998 47999 48000 48002 48010 + 47998 + 47999 + 48000 + 48002 + 48010 ]; # Shit breaks without this lol