diff --git a/hosts/fwminex/configuration.nix b/hosts/fwminex/configuration.nix index c4b05de..b0fd810 100644 --- a/hosts/fwminex/configuration.nix +++ b/hosts/fwminex/configuration.nix @@ -11,6 +11,7 @@ in { imports = [ ../../modules + ../../modules/profiles/physical ../../modules/profiles/btrfs ]; @@ -224,9 +225,6 @@ in }; services = { - pcscd.enable = true; - acpid.enable = true; - fwupd.enable = true; logind = { lidSwitch = "ignore"; powerKey = "suspend"; @@ -724,10 +722,8 @@ in environment = { enableDebugInfo = true; systemPackages = with pkgs; [ - acpi yt-dlp inferno - nvme-cli tpm2-tools amdgpu_top graphicsmagick diff --git a/hosts/mtworx/configuration.nix b/hosts/mtworx/configuration.nix index f472e42..651fb64 100644 --- a/hosts/mtworx/configuration.nix +++ b/hosts/mtworx/configuration.nix @@ -11,7 +11,7 @@ in imports = [ ../../shared/work ../../modules - ../../modules/profiles/desktop + ../../modules/profiles/workstation ../../modules/profiles/autorandr ../../modules/profiles/btrfs ]; diff --git a/hosts/vno1-gdrx/configuration.nix b/hosts/vno1-gdrx/configuration.nix index e1b2546..119b85f 100644 --- a/hosts/vno1-gdrx/configuration.nix +++ b/hosts/vno1-gdrx/configuration.nix @@ -12,7 +12,7 @@ in { imports = [ ../../modules - ../../modules/profiles/desktop + ../../modules/profiles/workstation ../../modules/profiles/autorandr ../../modules/profiles/btrfs ]; diff --git a/hosts/vno3-nk/configuration.nix b/hosts/vno3-nk/configuration.nix index 0e611b8..5b29c20 100644 --- a/hosts/vno3-nk/configuration.nix +++ b/hosts/vno3-nk/configuration.nix @@ -10,6 +10,7 @@ in { imports = [ ../../modules + ../../modules/profiles/physical ../../modules/profiles/btrfs ]; @@ -71,12 +72,6 @@ in hardware.cpu.intel.updateMicrocode = true; nixpkgs.hostPlatform = "x86_64-linux"; - services = { - pcscd.enable = true; - acpid.enable = true; - fwupd.enable = true; - }; - mj = { stateVersion = "24.11"; timeZone = "Europe/Vilnius"; diff --git a/modules/base/default.nix b/modules/base/default.nix index 9d271dd..54490a5 100644 --- a/modules/base/default.nix +++ b/modules/base/default.nix @@ -110,17 +110,12 @@ in btdu lshw entr - cloc poop # hopefully poof some day pigz zstd - flex - bison - s-tui # stress and monitor cpu unrar iotop wdiff - tokei sshfs pwgen below # tracking cgroups @@ -130,10 +125,7 @@ in bindfs spiped parted - bloaty dhcpcd - hdparm - sdparm procps unison usbtop @@ -144,7 +136,6 @@ in ethtool gettext exiftool - bpftrace keyutils libkcapi usbutils @@ -152,17 +143,11 @@ in bsdgames parallel yamllint - binutils dos2unix - patchelf compsize rtorrent p7zip-rar - hyperfine - stress-ng - dmidecode moreutils - sloccount cryptsetup lm_sensors inotify-info @@ -199,9 +184,6 @@ in config.boot.kernelPackages.perf config.boot.kernelPackages.vm-tools - # non-virtual - powerstat - config.boot.kernelPackages.cpupower ] (lib.mkIf (pkgs.stdenv.hostPlatform.system == "x86_64-linux") [ wrk2 ]) ]; diff --git a/modules/profiles/desktop/default.nix b/modules/profiles/desktop/default.nix index 59c71bd..92169d9 100644 --- a/modules/profiles/desktop/default.nix +++ b/modules/profiles/desktop/default.nix @@ -18,16 +18,12 @@ let }; in { - imports = [ ../dev ]; + imports = [ + ../dev + ../physical + ]; config = { boot = { - loader.systemd-boot.enable = true; - initrd.systemd.enable = true; - supportedFilesystems = [ - "exfat" - "ntfs" - "xfs" - ]; kernelModules = [ "kvm-intel" ]; }; @@ -66,11 +62,8 @@ in ]; services = { - fwupd.enable = true; blueman.enable = true; udev.packages = [ pkgs.yubikey-personalization ]; - acpid.enable = true; - pcscd.enable = true; gnome.gnome-keyring.enable = true; openssh.settings.X11Forwarding = true; @@ -113,14 +106,6 @@ in pipewire.enable = false; - tlp = { - enable = true; - settings = { - START_CHARGE_THRESH_BAT0 = lib.mkDefault 80; - STOP_CHARGE_THRESH_BAT0 = lib.mkDefault 87; - }; - }; - }; programs = { @@ -158,186 +143,141 @@ in xkcd-font ]; - environment.systemPackages = - with pkgs; - [ - # packages defined here - open - nicer - tmuxbash - brightness + environment.systemPackages = with pkgs; [ + # packages defined here + open + nicer + tmuxbash + brightness - f3 # flight-flash-fraud - iw - rr - gdb - ntp - i7z - vlc - sox - mpv - imv # image viewer - acpi - gimp - josm - pdal - gdal - qemu - zlib - ninja - xclip - pdftk - putty - scrot - tracy - mb2md # mailbox2maildir - cmake - typst - sioyek - (kazam.override { - python3Packages = pkgs.python311Packages; - }) # alternative to gtk-recordMyDesktop - x11vnc - yt-dlp - skopeo - ffmpeg - tinycc - scrcpy - cheese - arandr - pandoc - evince - ioping - motion - gthumb - calibre - gparted - glabels-qt - scribus - gnumake - libwebp - librsvg - neomutt - picocom - inferno - libheif - csvkit - mplayer - tcpflow - cppcheck - wasmtime - undocker - nautilus - smplayer - inkscape - chromium - hunspell - tigervnc - bsdgames - pstoedit - xss-lock - valgrind - musl.dev - audacity - graphviz - powertop - nvme-cli - librecad - qgis-ltr # qgis gets recompiled, qgis-ltr is cached by hydra - colordiff - tesseract - trayscale - espeak-ng - man-pages - rox-filer - distrobox - miniupnpc - v4l-utils - #nerdfonts - postgresql - winetricks - #diffoscope # broken on 2025-09-28, not used much - alsa-utils - gcc_latest - shellcheck - borgbackup - efibootmgr - virtualenv - imagemagick - #ventoy-full - ghostscript - libva-utils # intel video tests - pavucontrol - photocollage - libqalculate # qalc - qalculate-qt # qalculate - google-chrome - wirelesstools - poppler_utils - rkdeveloptool - squashfsTools - nixpkgs-review - joplin-desktop - aspellDicts.en - aspellDicts.lt - libreoffice-qt - graphicsmagick - magic-wormhole - signal-desktop - gnome-calendar - intel-gpu-tools - element-desktop - netsurf-browser - man-pages-posix - git-filter-repo - gnome-calculator - libsForQt5.okular - nvtopPackages.amd - age-plugin-yubikey - nvtopPackages.intel - hunspellDicts.en_US - wineWowPackages.full - openorienteering-mapper - samsung-unified-linux-driver + f3 # flight-flash-fraud + iw + gdb + ntp + vlc + sox + mpv + imv # image viewer + gimp + qemu + zlib + ninja + xclip + pdftk + putty + scrot + tracy + mb2md # mailbox2maildir + cmake + typst + sioyek + (kazam.override { + python3Packages = pkgs.python311Packages; + }) # alternative to gtk-recordMyDesktop + x11vnc + yt-dlp + skopeo + ffmpeg + tinycc + scrcpy + cheese + arandr + pandoc + evince + ioping + motion + gthumb + calibre + gparted + glabels-qt + scribus + gnumake + libwebp + librsvg + picocom + inferno + libheif + csvkit + mplayer + tcpflow + undocker + nautilus + smplayer + inkscape + chromium + hunspell + tigervnc + bsdgames + pstoedit + xss-lock + audacity + librecad + colordiff + tesseract + trayscale + espeak-ng + man-pages + rox-filer + distrobox + miniupnpc + v4l-utils + #nerdfonts + winetricks + #diffoscope # broken on 2025-09-28, not used much + alsa-utils + shellcheck + virtualenv + imagemagick + #ventoy-full + ghostscript + libva-utils # intel video tests + pavucontrol + photocollage + libqalculate # qalc + qalculate-qt # qalculate + google-chrome + wirelesstools + poppler_utils + rkdeveloptool + squashfsTools + joplin-desktop + aspellDicts.en + aspellDicts.lt + libreoffice-qt + graphicsmagick + magic-wormhole + signal-desktop + gnome-calendar + element-desktop + netsurf-browser + man-pages-posix + git-filter-repo + gnome-calculator + libsForQt5.okular + nvtopPackages.amd + age-plugin-yubikey + nvtopPackages.intel + hunspellDicts.en_US + wineWowPackages.full + openorienteering-mapper + samsung-unified-linux-driver - xdotool - xorg.xev - xorg.xeyes - xorg.lndir - xorg.xinit + xdotool + xorg.xev + xorg.xeyes + xorg.lndir + xorg.xinit - (python3.withPackages ( - ps: with ps; [ - numpy - pyyaml - ipython - matplotlib - ] - )) + (python3.withPackages ( + ps: with ps; [ + numpy + pyyaml + ipython + matplotlib + ] + )) - (texlive.combine { - inherit (texlive) - lithuanian - scheme-medium - hyphen-lithuanian - collection-binextra - collection-bibtexextra - collection-latexextra - collection-publishers - ; - }) - ] - ++ (with llvmPackages_19; [ - clang - lld.dev - llvm.dev - clang-tools - libllvm.dev - libclang.dev - llvm-manpages - clang-manpages - compiler-rt.dev - ]); + ]; # https://discourse.nixos.org/t/nixos-rebuild-switch-upgrade-networkmanager-wait-online-service-failure/30746 systemd.services.NetworkManager-wait-online.enable = false; @@ -347,7 +287,6 @@ in { imports = [ ./plasma.nix ]; xdg.configFile = { - "awesome/rc.lua".source = ./rc.lua; "gdb/gdbinit".text = '' set style address foreground yellow set style function foreground cyan @@ -356,10 +295,6 @@ in }; programs = { - msmtp.enable = true; - mbsync.enable = true; - neomutt.enable = true; - notmuch.enable = true; ghostty = { enable = true; installVimSyntax = true; @@ -377,104 +312,6 @@ in }; }; - tmux.extraConfig = - let - cmd = "${pkgs.extract_url}/bin/extract_url"; - cfg = pkgs.writeText "urlviewrc" "COMMAND systemd-run --user --collect xdg-open %s"; - in - '' - bind-key u capture-pane -J \; \ - save-buffer /tmp/tmux-buffer \; \ - delete-buffer \; \ - split-window -l 10 "${cmd} -c ${cfg} /tmp/tmux-buffer" - ''; - }; - - accounts.email = { - maildirBasePath = "Maildir"; - - accounts.mj = { - primary = true; - userName = "motiejus@jakstys.lt"; - address = "motiejus@jakstys.lt"; - realName = "Motiejus Jakštys"; - passwordCommand = "cat /home/${username}/.mail-appcode"; - imap.host = "imap.gmail.com"; - smtp.host = "smtp.gmail.com"; - - mbsync = { - enable = true; - create = "maildir"; - patterns = [ - "*" - "![Gmail]/All Mail" - ]; - }; - - msmtp = { - enable = true; - }; - - notmuch = { - enable = true; - neomutt.enable = true; - }; - - neomutt = { - enable = true; - extraConfig = '' - set index_format="%4C %Z %{%F %H:%M} %-15.15L (%?l?%4l&%4c?) %s" - - set mailcap_path = ${pkgs.writeText "mailcaprc" '' - text/html; ${pkgs.elinks}/bin/elinks -dump ; copiousoutput; - application/*; ${pkgs.xdg-utils}/bin/xdg-open %s &> /dev/null &; - image/*; ${pkgs.xdg-utils}/bin/xdg-open %s &> /dev/null &; - ''} - auto_view text/html - unset record - set send_charset="utf-8" - - macro attach 'V' "iconv -c --to-code=UTF8 > ~/.cache/mutt/mail.htmlfirefox ~/.cache/mutt/mail.html" - macro index,pager \cb " env BROWSER=firefox urlscan" "call urlscan to extract URLs out of a message" - macro attach,compose \cb " env BROWSER=firefox urlscan" "call urlscan to extract URLs out of a message" - - set sort_browser=date - set sort=reverse-threads - set sort_aux=last-date-received - - bind pager g top - bind pager G bottom - bind attach,index g first-entry - bind attach,index G last-entry - bind attach,index,pager \CD half-down - bind attach,index,pager \CU half-up - bind attach,index,pager \Ce next-line - bind attach,index,pager \Cy previous-line - bind index,pager B sidebar-toggle-visible - bind index,pager R group-reply - - set sidebar_visible = yes - set sidebar_width = 15 - bind index,pager \Cp sidebar-prev - bind index,pager \Cn sidebar-next - bind index,pager \Co sidebar-open - bind index,pager B sidebar-toggle-visible - set sidebar_short_path = yes - set sidebar_delim_chars = '/' - set sidebar_format = '%B%* %?N?%N?' - set mail_check_stats - set postponed="+[Gmail]/Drafts" - mailboxes =btrfs - mailboxes =Debian - mailboxes =alerts - mailboxes ="[Gmail]/Drafts" - mailboxes ="[Gmail]/Starred" - mailboxes ="[Gmail]/Sent Mail" - - source ${./notmuch-colors.muttrc} - ''; - }; - }; }; services = { diff --git a/modules/profiles/physical/default.nix b/modules/profiles/physical/default.nix new file mode 100644 index 0000000..ce5aefd --- /dev/null +++ b/modules/profiles/physical/default.nix @@ -0,0 +1,51 @@ +{ + lib, + pkgs, + config, + ... +}: +{ + config = { + boot = { + loader.systemd-boot.enable = true; + initrd.systemd.enable = true; + supportedFilesystems = [ + "exfat" + "ntfs" + "xfs" + ]; + }; + + services = { + fwupd.enable = true; + acpid.enable = true; + pcscd.enable = true; + + tlp = { + enable = lib.mkDefault true; + settings = { + START_CHARGE_THRESH_BAT0 = lib.mkDefault 80; + STOP_CHARGE_THRESH_BAT0 = lib.mkDefault 87; + }; + }; + }; + + environment.systemPackages = with pkgs; [ + acpi + i7z + nvme-cli + powertop + efibootmgr + smartmontools + intel-gpu-tools + tpm2-tools + hdparm + sdparm + s-tui + dmidecode + stress-ng + powerstat + config.boot.kernelPackages.cpupower + ]; + }; +} diff --git a/modules/profiles/workstation/default.nix b/modules/profiles/workstation/default.nix new file mode 100644 index 0000000..1db549b --- /dev/null +++ b/modules/profiles/workstation/default.nix @@ -0,0 +1,194 @@ +{ + lib, + pkgs, + config, + ... +}: +let + inherit (config.mj) username; +in +{ + imports = [ ../desktop ]; + + config = { + services.xserver = { + windowManager.awesome.enable = true; + }; + + services.displayManager = { + defaultSession = lib.mkDefault "none+awesome"; + }; + + environment.systemPackages = + with pkgs; + [ + rr + josm + pdal + gdal + qgis-ltr + neomutt + valgrind + musl.dev + graphviz + postgresql + cppcheck + wasmtime + gcc_latest + borgbackup + nixpkgs-review + cloc + tokei + bloaty + binutils + patchelf + hyperfine + sloccount + bpftrace + flex + bison + + (texlive.combine { + inherit (texlive) + lithuanian + scheme-medium + hyphen-lithuanian + collection-binextra + collection-bibtexextra + collection-latexextra + collection-publishers + ; + }) + ] + ++ (with llvmPackages_19; [ + clang + lld.dev + llvm.dev + clang-tools + libllvm.dev + libclang.dev + llvm-manpages + clang-manpages + compiler-rt.dev + ]); + + home-manager.users.${username} = + { pkgs, ... }: + { + xdg.configFile = { + "awesome/rc.lua".source = ../desktop/rc.lua; + "gdb/gdbinit".text = '' + set style address foreground yellow + set style function foreground cyan + set style string foreground magenta + ''; + }; + + programs = { + msmtp.enable = true; + mbsync.enable = true; + neomutt.enable = true; + notmuch.enable = true; + + tmux.extraConfig = + let + cmd = "${pkgs.extract_url}/bin/extract_url"; + cfg = pkgs.writeText "urlviewrc" "COMMAND systemd-run --user --collect xdg-open %s"; + in + '' + bind-key u capture-pane -J \; \ + save-buffer /tmp/tmux-buffer \; \ + delete-buffer \; \ + split-window -l 10 "${cmd} -c ${cfg} /tmp/tmux-buffer" + ''; + }; + + accounts.email = { + maildirBasePath = "Maildir"; + + accounts.mj = { + primary = true; + userName = "motiejus@jakstys.lt"; + address = "motiejus@jakstys.lt"; + realName = "Motiejus Jakštys"; + passwordCommand = "cat /home/${username}/.mail-appcode"; + imap.host = "imap.gmail.com"; + smtp.host = "smtp.gmail.com"; + + mbsync = { + enable = true; + create = "maildir"; + patterns = [ + "*" + "![Gmail]/All Mail" + ]; + }; + + msmtp = { + enable = true; + }; + + notmuch = { + enable = true; + neomutt.enable = true; + }; + + neomutt = { + enable = true; + extraConfig = '' + set index_format="%4C %Z %{%F %H:%M} %-15.15L (%?l?%4l&%4c?) %s" + + set mailcap_path = ${pkgs.writeText "mailcaprc" '' + text/html; ${pkgs.elinks}/bin/elinks -dump ; copiousoutput; + application/*; ${pkgs.xdg-utils}/bin/xdg-open %s &> /dev/null &; + image/*; ${pkgs.xdg-utils}/bin/xdg-open %s &> /dev/null &; + ''} + auto_view text/html + unset record + set send_charset="utf-8" + + macro attach 'V' "iconv -c --to-code=UTF8 > ~/.cache/mutt/mail.htmlfirefox ~/.cache/mutt/mail.html" + macro index,pager \cb " env BROWSER=firefox urlscan" "call urlscan to extract URLs out of a message" + macro attach,compose \cb " env BROWSER=firefox urlscan" "call urlscan to extract URLs out of a message" + + set sort_browser=date + set sort=reverse-threads + set sort_aux=last-date-received + + bind pager g top + bind pager G bottom + bind attach,index g first-entry + bind attach,index G last-entry + bind attach,index,pager \CD half-down + bind attach,index,pager \CU half-up + bind attach,index,pager \Ce next-line + bind attach,index,pager \Cy previous-line + bind index,pager B sidebar-toggle-visible + bind index,pager R group-reply + + set sidebar_visible = yes + set sidebar_width = 15 + bind index,pager \Cp sidebar-prev + bind index,pager \Cn sidebar-next + bind index,pager \Co sidebar-open + bind index,pager B sidebar-toggle-visible + set sidebar_short_path = yes + set sidebar_delim_chars = '/' + set sidebar_format = '%B%* %?N?%N?' + set mail_check_stats + set postponed="+[Gmail]/Drafts" + mailboxes =btrfs + mailboxes =Debian + mailboxes =alerts + mailboxes ="[Gmail]/Drafts" + mailboxes ="[Gmail]/Starred" + mailboxes ="[Gmail]/Sent Mail" + + source ${../desktop/notmuch-colors.muttrc} + ''; + }; + }; + }; + }; + }; +} diff --git a/modules/profiles/xfce4/default.nix b/modules/profiles/xfce4/default.nix new file mode 100644 index 0000000..2575fff --- /dev/null +++ b/modules/profiles/xfce4/default.nix @@ -0,0 +1,18 @@ +{ + lib, + config, + ... +}: +{ + imports = [ ../desktop ]; + + config = { + services.xserver = { + desktopManager.xfce.enable = true; + }; + + services.displayManager = { + defaultSession = lib.mkForce "xfce"; + }; + }; +}