diff --git a/modules/core/default.nix b/modules/core/default.nix index e2f0671..cbf71fc 100644 --- a/modules/core/default.nix +++ b/modules/core/default.nix @@ -4,7 +4,6 @@ [ (import ./docker.nix) ] ++ [ (import ../security/default.nix) ] ++ [ (import ./hardware.nix) ] - ++ [ (import ./displaylink.nix) ] # ++ [(import ./printing.nix)] ++ [ (import ./xserver.nix) ] ++ [ (import ./network.nix) ] diff --git a/modules/core/hardware.nix b/modules/core/hardware.nix index ca598dc..20dd4c1 100644 --- a/modules/core/hardware.nix +++ b/modules/core/hardware.nix @@ -1,7 +1,11 @@ { pkgs, ... }: -{ +{ services.smartd = { enable = true; autodetect = true; }; + hardware.logitech.wireless = { + enable = true; + enableGraphical = true; + }; } diff --git a/modules/core/network.nix b/modules/core/network.nix index 9cb9355..c6031a3 100644 --- a/modules/core/network.nix +++ b/modules/core/network.nix @@ -12,5 +12,29 @@ }; services = { avahi.enable = lib.mkDefault false; + tailscale = { + enable = true; + useRoutingFeatures = "client"; + extraUpFlags = [ + # "--accept-dns=false" + "--accept-routes" + ]; + }; }; + + programs = { + wireshark.enable = true; + }; + + environment.systemPackages = with pkgs; [ + dig + iftop + inetutils + ipcalc + iperf + nmap + tcpdump + traceroute + tshark + ]; } diff --git a/modules/core/program.nix b/modules/core/program.nix index 3acaa58..f82b534 100644 --- a/modules/core/program.nix +++ b/modules/core/program.nix @@ -8,11 +8,4 @@ # pinentryFlavor = ""; }; }; - - environment.systemPackages = with pkgs; [ - wget - git - dig - traceroute - ]; } diff --git a/modules/core/system.nix b/modules/core/system.nix index 29852e7..c4c5e0b 100644 --- a/modules/core/system.nix +++ b/modules/core/system.nix @@ -30,6 +30,8 @@ libraries = with pkgs; [ ]; }; + services.envfs.enable = true; + nixpkgs = { overlays = [ self.overlays.default diff --git a/modules/home/default.nix b/modules/home/default.nix index aaec9da..dac5f89 100644 --- a/modules/home/default.nix +++ b/modules/home/default.nix @@ -5,6 +5,7 @@ ++ [ (import ./swaync/default.nix) ] ++ [ (import ./sway/default.nix) ] ++ [ (import ./fonts.nix) ] + ++ [ (import ./htop.nix) ] ++ [ (import ./hyprland) ] ++ [ (import ./hyprlock) ] ++ [ (import ./kitty.nix) ] @@ -16,8 +17,10 @@ ++ [ (import ./packages.nix) ] ++ [ (import ./scripts/scripts.nix) ] ++ [ (import ./spotify.nix) ] + ++ [ (import ./ssh.nix) ] ++ [ (import ./waybar) ] ++ [ (import ./zsh.nix) ] ++ [ (import ./qutebrowser.nix) ] + ++ [ (import ./xdg.nix) ] ++ [ (import ./tmux.nix) ]; } diff --git a/modules/home/htop.nix b/modules/home/htop.nix new file mode 100644 index 0000000..f9555fd --- /dev/null +++ b/modules/home/htop.nix @@ -0,0 +1,59 @@ +{ pkgs, ... }: +{ + + programs.htop = { + enable = true; + package = pkgs.htop; + }; + + home.file.".config/htop/htoprc" = { + text = '' + fields=0 48 38 39 40 2 46 109 110 47 49 1 + hide_kernel_threads=1 + hide_userland_threads=0 + hide_running_in_container=0 + shadow_other_users=0 + show_thread_names=0 + show_program_path=1 + highlight_base_name=1 + highlight_deleted_exe=1 + shadow_distribution_path_prefix=0 + highlight_megabytes=1 + highlight_threads=1 + highlight_changes=0 + highlight_changes_delay_secs=5 + find_comm_in_cmdline=1 + strip_exe_from_cmdline=1 + show_merged_command=0 + header_margin=1 + screen_tabs=1 + detailed_cpu_time=1 + cpu_count_from_one=0 + show_cpu_usage=1 + show_cpu_frequency=1 + show_cpu_temperature=1 + degree_fahrenheit=0 + show_cached_memory=1 + update_process_names=0 + account_guest_in_cpu_meter=0 + color_scheme=6 + enable_mouse=1 + delay=15 + hide_function_bar=0 + header_layout=two_50_50 + column_meters_0=LeftCPUs2 MemorySwap PressureStallMemoryFull PressureStallIOFull DiskIO NetworkIO Uptime + column_meter_modes_0=1 1 2 2 2 2 2 + column_meters_1=RightCPUs2 CPU PressureStallCPUSome LoadAverage Tasks System Systemd Battery + column_meter_modes_1=1 1 2 2 2 2 2 2 + tree_view=0 + sort_key=46 + tree_sort_key=0 + sort_direction=-1 + tree_sort_direction=1 + tree_view_always_by_pid=0 + all_branches_collapsed=0 + screen:Main=PID USER M_VIRT M_RESIDENT M_SHARE STATE PERCENT_CPU IO_READ_RATE IO_WRITE_RATE PERCENT_MEM TIME Command + ''; + }; + +} diff --git a/modules/home/hyprland/config.nix b/modules/home/hyprland/config.nix index d37d4cb..94ce71a 100644 --- a/modules/home/hyprland/config.nix +++ b/modules/home/hyprland/config.nix @@ -124,6 +124,7 @@ "nwg-dock-hyprland -l top &" "nextcloud &" "hyprland-monitor-attached dock-on-all-monitors dock-on-all-monitors &" + "vicinae server &" ]; input = { @@ -279,7 +280,8 @@ "$mainMod SHIFT, X, exec, footclient --title 'float_foot' zsh -c 'bash ~/.local/src/bw-fzf/bw-fzf.sh" # clipboard manager - "$mainMod SHIFT, V, exec, cliphist list | bemenu -l 5 --ignorecase | cliphist decode | wl-copy" + # "$mainMod SHIFT, V, exec, cliphist list | bemenu -l 5 --ignorecase | cliphist decode | wl-copy" + "$mainMod SHIFT, V, exec, vicinae vicinae://extensions/vicinae/clipboard/history" "$mainMod SHIFT, F, exec, librewolf" "$mainMod SHIFT, C, exec, chromium" @@ -398,6 +400,14 @@ # "opacity 0.5 0.5, match:class nwg-dock-hyprland" "no_blur on, match:class ungoogled-chromium" "no_blur on, match:class librewolf" + "no_screen_share on, match:class element-desktop" + "match:title ^(.*Bitwarden Password Manager.*)$, float on" + "match:title ^(Picture-in-Picture)$, float on" + "match:title ^(Picture-in-Picture)$, pin on" + # stop idle when watching videos + "match:class ^(mpv|.+exe|celluloid)$, idle_inhibit focus" + "match:class ^(chromium)$, match:title ^(.*YouTube.*)$, idle_inhibit focus" + "match:class ^(chromium)$, idle_inhibit fullscreen" # "noanim, class:^(bemenu)$" # "float, title:^(Picture-in-Picture)$" # "opacity 1.0 override 1.0 override, title:^(Picture-in-Picture)$" @@ -430,7 +440,10 @@ # "float,title:^(float_foot)$" # "nofocus,class:^$,title:^$,xwayland:1,floating:1,fullscreen:0,pinned:0" ]; - + layerrule = [ + "match:class vicinae, blur on" + "match:class vicinae, ignore_alpha 0" + ]; }; extraConfig = " diff --git a/modules/home/kanshi.nix b/modules/home/kanshi.nix index 015b7b7..f7c1f6c 100644 --- a/modules/home/kanshi.nix +++ b/modules/home/kanshi.nix @@ -86,7 +86,7 @@ } { criteria = "eDP-1"; - status = if (host == "sakura") then "enable" else "disable"; + status = if (host == "sakura") then "disable" else "disable"; position = if (host == "sakura") then "152,1440" else "300,1440"; } ]; diff --git a/modules/home/packages.nix b/modules/home/packages.nix index 9069d0b..c039254 100644 --- a/modules/home/packages.nix +++ b/modules/home/packages.nix @@ -43,7 +43,6 @@ pwgen jq tmux - htop eza file fzf @@ -66,6 +65,19 @@ nmap aerc + aspell + aspellDicts.de + aspellDicts.nl + aspellDicts.uk + + # Hunspell dictionaries for spell checking + hunspell + hunspellDicts.de_DE # German + hunspellDicts.en_GB-ise # UK English with -ise spellings + hunspellDicts.en_US + hunspellDicts.nl_NL # Dutch + hunspellDicts.nl_nl # Dutch (alternative) + # Install pip packages # python3 # python3Packages.pip diff --git a/modules/home/ssh.nix b/modules/home/ssh.nix new file mode 100644 index 0000000..f9b3df5 --- /dev/null +++ b/modules/home/ssh.nix @@ -0,0 +1,9 @@ +{ + programs.ssh = { + matchBlocks = { + "github.com gitlab.com" = { + user = "git"; + }; + }; + }; +} diff --git a/modules/home/waybar/default.nix b/modules/home/waybar/default.nix index 193dd32..8dfb270 100644 --- a/modules/home/waybar/default.nix +++ b/modules/home/waybar/default.nix @@ -288,7 +288,8 @@ "orientation": "horizontal", "modules": [ "battery", - "custom/powerdraw" + "custom/powerdraw", + "power-profiles-daemon" ], "drawer": { "transition-left-to-right": false, @@ -318,6 +319,14 @@ "custom/powerdraw": { "interval": 60, "exec": "~/.local/bin/waybar-powerdraw", + "tooltip": false, + }, + + "power-profiles-daemon": { + "interval": 60, + "format": "{profile}", + "tooltip-format": "Power profile: {profile}\nDriver: {driver}", + "tooltip": true, }, "group/clock": { diff --git a/modules/home/xdg.nix b/modules/home/xdg.nix new file mode 100644 index 0000000..3bfd17c --- /dev/null +++ b/modules/home/xdg.nix @@ -0,0 +1,41 @@ +{ + xdg.mimeApps = { + enable = true; + defaultApplications = { + "image/tiff" = "nsxiv.desktop"; + "image/jp2" = "nsxiv.desktop"; + "image/jxl" = "nsxiv.desktop"; + "image/jpeg" = "nsxiv.desktop"; + "image/x-canon-cr2" = "nsxiv.desktop"; + "image/x-jp2-codestream" = "nsxiv.desktop"; + "image/webp" = "nsxiv.desktop"; + "image/x-nikon-nef" = "nsxiv.desktop"; + "image/x-sony-arw" = "nsxiv.desktop"; + "image/gif" = "nsxiv.desktop"; + "image/x-fuji-raf" = "nsxiv.desktop"; + "image/heif" = "nsxiv.desktop"; + "audio/mpeg" = "mpv.desktop"; + "audio/mp3" = "mpv.desktop"; + "audio/vnd.wave" = "mpv.desktop"; + "video/mp4" = "mpv.desktop"; + "video/mkv" = "mpv.desktop"; + "x-scheme-handler/sgnl" = "signal-desktop.desktop"; + "x-scheme-handler/signalcaptcha" = "signal-desktop.desktop"; + "x-scheme-handler/http" = "chromium-browser.desktop"; + "x-scheme-handler/https" = "chromium-browser.desktop"; + "x-scheme-handler/about" = "chromium-browser.desktop"; + "x-scheme-handler/unknown" = "chromium-browser.desktop"; + "x-scheme-handler/mailto" = "thunderbird.desktop"; + "x-scheme-handler/chrome" = "thunderbird.desktop"; + "text/calendar" = "thunderbird.desktop"; + "application/pdf" = "org.pwmt.zathura-pdf-mupdf.desktop"; + "application/x-extension-htm" = "chromium-browser.desktop"; + "application/x-extension-html" = "chromium-browser.desktop"; + "application/x-extension-shtml" = "chromium-browser.desktop"; + "application/x-extension-xht" = "chromium-browser.desktop"; + "application/x-extension-xhtml" = "chromium-browser.desktop"; + "application/x-zerosize" = "nsxiv.desktop"; + "application/xhtml+xml" = "chromium-browser.desktop"; + }; + }; +} diff --git a/roles/laptop.nix b/roles/laptop.nix index 6f1fa7a..f747485 100644 --- a/roles/laptop.nix +++ b/roles/laptop.nix @@ -30,11 +30,7 @@ in }; # DisplayLink - services.xserver.videoDrivers = [ - "displaylink" - "modesetting" - ]; - systemd.services.dlm.wantedBy = [ "multi-user.target" ]; + # imports = [ ../modules/core/displaylink.nix ]; networking.networkmanager.enable = true; @@ -48,6 +44,13 @@ in thermald.enable = true; power-profiles-daemon.enable = true; + udev.extraRules = '' + # Switch to power-save profile when on battery + SUBSYSTEM=="power_supply", ATTR{online}=="0", RUN+="${pkgs.power-profiles-daemon}/bin/powerprofilesctl set power-saver", RUN+="/bin/sh -c 'echo 30 | tee /sys/class/backlight/amdgpu_bl1/brightness'" + # Switch to balanced profile when plugged in + SUBSYSTEM=="power_supply", ATTR{online}=="1", RUN+="${pkgs.power-profiles-daemon}/bin/powerprofilesctl set balanced", RUN+="/bin/sh -c 'cat /sys/class/backlight/amdgpu_bl1/max_brightness > /sys/class/backlight/amdgpu_bl1/brightness'" + ''; + upower = { enable = true; percentageLow = 20; @@ -55,6 +58,21 @@ in percentageAction = 5; criticalPowerAction = "Hibernate"; }; + #auto-cpufreq = { + # enable = true; + # settings = { + # battery = { + # governor = "powersave"; + # turbo = "never"; + # energy_performance_preference = "balance_power"; + # }; + # charger = { + # governor = "performance"; + # turbo = "auto"; + # energy_performance_preference = "performance"; + # }; + # }; + #}; }; # powerManagement.powertop.enable = false; # somehow figure out how to let this not apply to specific USB devices, as they will auto suspend and that is annoying. };