From f35599a59a080f0e7a173e21cae3d51dc230a212 Mon Sep 17 00:00:00 2001 From: Grisha Shipunov Date: Fri, 15 Aug 2025 18:34:37 +0200 Subject: Revert "retire toaster" This reverts commit 1baa256be04a8b4e711a7d48a76197b5ffad6637. --- modules/chromium.nix | 40 +++++++++++++ modules/desktop-software.nix | 31 ++++++++++ modules/emacs.nix | 60 +++++++++++++++++++ modules/fonts.nix | 48 +++++++++++++++ modules/gnome.nix | 63 ++++++++++++++++++++ modules/mail/default.nix | 138 +++++++++++++++++++++++++++++++++++++++++++ modules/mail/mbsyncrc | 97 ++++++++++++++++++++++++++++++ modules/niri.nix | 127 +++++++++++++++++++++++++++++++++++++++ modules/plasma.nix | 52 ++++++++++++++++ modules/radio.nix | 39 ++++++++++++ modules/science.nix | 8 +++ modules/tlp.nix | 14 +++++ modules/wg/mgmt.nix | 1 - 13 files changed, 717 insertions(+), 1 deletion(-) create mode 100644 modules/chromium.nix create mode 100644 modules/desktop-software.nix create mode 100644 modules/emacs.nix create mode 100644 modules/fonts.nix create mode 100644 modules/gnome.nix create mode 100644 modules/mail/default.nix create mode 100644 modules/mail/mbsyncrc create mode 100644 modules/niri.nix create mode 100644 modules/plasma.nix create mode 100644 modules/radio.nix create mode 100644 modules/science.nix create mode 100644 modules/tlp.nix (limited to 'modules') diff --git a/modules/chromium.nix b/modules/chromium.nix new file mode 100644 index 0000000..4cdf16a --- /dev/null +++ b/modules/chromium.nix @@ -0,0 +1,40 @@ +{ pkgs, ... }: + +{ + environment.systemPackages = with pkgs; [ + (chromium.override { enableWideVine = true; }) + ]; + + nixpkgs.config.chromium.commandLineArgs = "--enable-features=UseOzonePlatform --ozone-platform=wayland --ignore-gpu-blocklist --enable-gpu-rasterization --enable-zero-copy --enable-features=VaapiVideoDecoder,VaapiVideoEncoder,CanvasOopRasterization,WebUIDarkMode"; + + programs.chromium = { + enable = true; + extensions = [ + "ekhagklcjbdpajgpjgmbionohlpdbjgc" # zotero connector + "nngceckbapebfimnlniiiahkandclblb" # bitwarden + "ddkjiahejlhfcafbddmgiahcphecmpfh" # ublock lite + "mnjggcdmjocbbbhaepdhchncahnbgone" # sponsorblock + "khncfooichmfjbepaaaebmommgaepoid" # unhook + ]; + extraOpts = { + "BrowserSignin" = 0; + "SyncDisabled" = true; + "PasswordManagerEnabled" = false; + "TranslateEnabled" = false; + "AutofillAddressEnabled" = false; + "AutofillCreditCardEnabled" = false; + "AutoplayAllowed" = false; + "DefaultNotificationSetting" = 2; + "BackgroundModeEnabled" = false; + # "DefaultSearchProviderEnabled" = true; + # "DefaultSearchProviderSearchURL" = "https://google.com/search?q={searchTerms}"; + # "DefaultSearchProviderSearchURL" = "https://duckduckgo.com/?q={searchTerms}"; + "SearchSuggestEnable" = false; + "BlockThirdPartyCookies" = true; + "PrivacySandboxAdMeasurementEnabled" = false; + "PrivacySandboxAdTopicsEnabled" = false; + "PrivacySandboxPromptEnabled" = false; + "PrivacySandboxSiteEnabledAdsEnabled" = false; + }; + }; +} diff --git a/modules/desktop-software.nix b/modules/desktop-software.nix new file mode 100644 index 0000000..af73ea5 --- /dev/null +++ b/modules/desktop-software.nix @@ -0,0 +1,31 @@ +{ pkgs, ... }: +{ + imports = [ + ./chromium.nix + ]; + environment.systemPackages = with pkgs; [ + audacity + blender + dino + discord + element-desktop + ffmpeg-full + ghostty + gimp + inkscape + lapce + libreoffice + mpv + obs-studio + qbittorrent + signal-desktop + spotify + telegram-desktop + tor-browser + transmission_4-gtk + wl-clipboard + yt-dlp + ]; + programs.steam.enable = true; + programs.firefox.enable = true; +} diff --git a/modules/emacs.nix b/modules/emacs.nix new file mode 100644 index 0000000..39c2db8 --- /dev/null +++ b/modules/emacs.nix @@ -0,0 +1,60 @@ +{ + pkgs, + lib, + ... +}: + +{ + environment.systemPackages = + let + # https://wiki.nixos.org/wiki/TexLive + # minimal set of latex packages for orgmode + # emacs config: + # (setq org-latex-complier "lualatex") + # (setq org-preview-latex-default-process 'dvisvgm) + orgmode-tex = ( + pkgs.texlive.combine { + inherit (pkgs.texlive) + scheme-basic + dvisvgm + dvipng + wrapfig + amsmath + ulem + hyperref + capt-of + ; + } + ); + in + with pkgs; + [ + mu + orgmode-tex + ]; + + services.emacs = { + install = true; + enable = true; + package = + with pkgs; + ( + (emacsPackagesFor ( + emacs-pgtk.overrideAttrs (old: { + passthru = old.passthru // { + treeSitter = true; + }; + }) + )).emacsWithPackages + ( + epkgs: with epkgs; [ + treesit-grammars.with-all-grammars + vterm + pdf-tools + mu4e + ] + ) + ); + defaultEditor = lib.mkForce true; + }; +} diff --git a/modules/fonts.nix b/modules/fonts.nix new file mode 100644 index 0000000..96236cb --- /dev/null +++ b/modules/fonts.nix @@ -0,0 +1,48 @@ +{ pkgs, ... }: +{ + fonts.packages = with pkgs; [ + adwaita-fonts + monoid + font-awesome + dejavu_fonts + julia-mono + uw-ttyp0 + gohufont + spleen + terminus_font + creep + corefonts + dina-font + fira + fira-mono + hack-font + liberation_ttf + noto-fonts + noto-fonts-cjk-sans + noto-fonts-color-emoji + noto-fonts-monochrome-emoji + noto-fonts-emoji + noto-fonts-extra + proggyfonts + symbola + open-sans + twemoji-color-font + twitter-color-emoji + iosevka-bin + cozette + nerd-fonts.hack + ibm-plex + ]; + + fonts.enableDefaultPackages = true; + fonts.fontconfig = { + enable = true; + allowBitmaps = true; + useEmbeddedBitmaps = true; + defaultFonts.emoji = [ + "Twitter Color Emoji" + "Noto Color Emoji" + ]; + }; + +} diff --git a/modules/gnome.nix b/modules/gnome.nix new file mode 100644 index 0000000..5743283 --- /dev/null +++ b/modules/gnome.nix @@ -0,0 +1,63 @@ +{ pkgs, ... }: +{ + + imports = [ + ./desktop-software.nix + ./fonts.nix + ]; + environment.systemPackages = with pkgs; [ + amberol + celluloid + ddcutil + gnome-console + gnome-obfuscate + gnome-boxes + gnome-tweaks + gnomeExtensions.caffeine + gnomeExtensions.brightness-control-using-ddcutil + fractal + ]; + + environment.gnome.excludePackages = with pkgs; [ + totem + geary + gnome-music + ]; + + services.gnome = { + evolution-data-server.enable = true; + gnome-keyring.enable = true; + gnome-online-accounts.enable = true; + }; + + programs = { + seahorse.enable = true; + gnupg.agent.pinentryPackage = pkgs.pinentry-gnome3; + evolution = { + enable = true; + plugins = [ pkgs.evolution-ews ]; + }; + }; + + services = { + desktopManager.gnome.enable = true; + displayManager.gdm = { + enable = true; + wayland = true; + }; + }; + + # Enable sound. + security.rtkit.enable = true; + services.pipewire = { + enable = true; + alsa.enable = true; + pulse.enable = true; + }; + + programs.zsh.vteIntegration = true; + programs.bash.vteIntegration = true; + + hardware.bluetooth.enable = true; + +} diff --git a/modules/mail/default.nix b/modules/mail/default.nix new file mode 100644 index 0000000..ba65f2c --- /dev/null +++ b/modules/mail/default.nix @@ -0,0 +1,138 @@ +{ config, pkgs, ... }: +let + mbsyncConf = ./mbsyncrc; +in +{ + environment.systemPackages = with pkgs; [ + isync + msmtp + neomutt + notmuch + alot + w3m + links2 + ]; + + environment.shellAliases = { + mutt = "neomutt"; + }; + + sops.secrets = { + "mail/oxapentane.com" = { + owner = config.users.users."0xa".name; + }; + "mail/shipunov.xyz" = { + owner = config.users.users."0xa".name; + }; + "mail/dvb.solutions" = { + owner = config.users.users."0xa".name; + }; + "mail/tlm.solutions" = { + owner = config.users.users."0xa".name; + }; + }; + + programs.msmtp = { + enable = true; + setSendmail = true; + extraConfig = '' + account mail@oxapentane.com + host smtp.migadu.com + port 587 + from *@oxapentane.com + user mail@oxapentane.com + passwordeval cat ${config.sops.secrets."mail/oxapentane.com".path} + auth on + tls on + tls_trust_file /etc/ssl/certs/ca-certificates.crt + logfile ~/.msmtp.log + + account grigory@shipunov.xyz + host smtp.migadu.com + port 587 + from *@shipunov.xyz + user grigory@shipunov.xyz + passwordeval cat ${config.sops.secrets."mail/shipunov.xyz".path} + auth on + tls on + tls_trust_file /etc/ssl/certs/ca-certificates.crt + logfile ~/.msmtp.log + + account dump@dvb.solutions + host smtp.migadu.com + port 587 + from dump@dvb.solutions + user dump@dvb.solutions + passwordeval cat ${config.sops.secrets."mail/dvb.solutions".path} + auth on + tls on + tls_trust_file /etc/ssl/certs/ca-certificates.crt + logfile ~/.msmtp.log + + account grigory@tlm.solutions + host smtp.migadu.com + port 587 + from grigory@tlm.solutions + user grigory@tlm.solutions + passwordeval cat ${config.sops.secrets."mail/tlm.solutions".path} + auth on + tls on + tls_trust_file /etc/ssl/certs/ca-certificates.crt + logfile ~/.msmtp.log + ''; + }; + + systemd.user = { + + # Service and timer to sync imap to local maildir + services.mbsync = { + enable = true; + after = [ + "graphical.target" + "network-online.target" + ]; + script = '' + ${pkgs.isync}/bin/mbsync -q -a --config=${mbsyncConf} + ''; + serviceConfig = { + Type = "oneshot"; + }; + }; + + timers.mbsync = { + enable = true; + wantedBy = [ "timers.target" ]; + timerConfig = { + Unit = "mbsync.service"; + OnBootSec = "5m"; + OnUnitInactiveSec = "11m"; + }; + }; + + # service and timer to flush the msmtp queue + services.flush-msmtpq = { + enable = true; + after = [ + "graphical.target" + "network-online.target" + ]; + script = '' + ${pkgs.msmtp}/bin/msmtp-queue -r + ''; + serviceConfig = { + Type = "oneshot"; + }; + }; + + timers.flush-msmtpq = { + enable = true; + wantedBy = [ "timers.target" ]; + timerConfig = { + Unit = "flush-msmtpq.service"; + OnBootSec = "11m"; + OnUnitInactiveSec = "13m"; + }; + }; + + }; +} diff --git a/modules/mail/mbsyncrc b/modules/mail/mbsyncrc new file mode 100644 index 0000000..fd2bc5b --- /dev/null +++ b/modules/mail/mbsyncrc @@ -0,0 +1,97 @@ +IMAPStore mail@oxapentane.com-remote +Host imap.migadu.com +Port 993 +User mail@oxapentane.com +PassCmd "cat /run/secrets/mail/oxapentane.com" +AuthMechs LOGIN +SSLType IMAPS + +MaildirStore mail@oxapentane.com-local +Subfolders Verbatim +Path /home/0xa/mail/mail@oxapentane.com/ +Inbox /home/0xa/mail/mail@oxapentane.com/INBOX + +Channel mail@oxapentane.com +Expunge Both +Master :mail@oxapentane.com-remote: +Slave :mail@oxapentane.com-local: +Create Both +SyncState * +Patterns * +MaxMessages 0 +ExpireUnread no +# End profile + + +IMAPStore grigory@shipunov.xyz-remote +Host imap.migadu.com +Port 993 +User grigory@shipunov.xyz +PassCmd "cat /run/secrets/mail/shipunov.xyz" +AuthMechs LOGIN +SSLType IMAPS + +MaildirStore grigory@shipunov.xyz-local +Subfolders Verbatim +Path /home/0xa/mail/grigory@shipunov.xyz/ +Inbox /home/0xa/mail/grigory@shipunov.xyz/INBOX + +Channel grigory@shipunov.xyz +Expunge Both +Master :grigory@shipunov.xyz-remote: +Slave :grigory@shipunov.xyz-local: +Create Both +SyncState * +Patterns * +MaxMessages 0 +ExpireUnread no +# End profile + + +IMAPStore dump@dvb.solutions-remote +Host imap.migadu.com +Port 993 +User dump@dvb.solutions +PassCmd "cat /run/secrets/mail/dvb.solutions" +AuthMechs LOGIN +SSLType IMAPS + +MaildirStore dump@dvb.solutions-local +Subfolders Verbatim +Path /home/0xa/mail/dump@dvb.solutions/ +Inbox /home/0xa/mail/dump@dvb.solutions/INBOX + +Channel dump@dvb.solutions +Expunge Both +Master :dump@dvb.solutions-remote: +Slave :dump@dvb.solutions-local: +Create Both +SyncState * +Patterns * +MaxMessages 0 +ExpireUnread no +# End profile + +IMAPStore grigory@tlm.solutions-remote +Host imap.migadu.com +Port 993 +User grigory@tlm.solutions +PassCmd "cat /run/secrets/mail/tlm.solutions" +AuthMechs LOGIN +SSLType IMAPS + +MaildirStore grigory@tlm.solutions-local +Subfolders Verbatim +Path /home/0xa/mail/grigory@tlm.solutions/ +Inbox /home/0xa/mail/grigory@tlm.solutions/INBOX + +Channel grigory@tlm.solutions +Expunge Both +Master :grigory@tlm.solutions-remote: +Slave :grigory@tlm.solutions-local: +Create Both +SyncState * +Patterns * +MaxMessages 0 +ExpireUnread no +# End profile diff --git a/modules/niri.nix b/modules/niri.nix new file mode 100644 index 0000000..441c55b --- /dev/null +++ b/modules/niri.nix @@ -0,0 +1,127 @@ +{ pkgs, ... }: +{ + programs.niri.enable = true; + + imports = [ + ./desktop-software.nix + ./fonts.nix + ]; + environment.systemPackages = with pkgs; [ + screen-message + qbittorrent + gajim + imv + mpv + evince + brightnessctl + pulsemixer + cmus + termusic + gsettings-desktop-schemas + xdg-utils + qt5.qtwayland + bashmount + audacity + spotify-player + zathura + ncdu + adwaita-icon-theme + bluetui + gammastep + graphicsmagick + i3status-rust + impala + kanshi + pamixer + swayidle + swaylock + wl-clipboard + xfce.thunar + banana-cursor + yofi + alacritty + i3bar-river + mako + swww + wbg + oculante + xwayland-satellite + foot + fuzzel + ]; + + # Enable sound. + security.rtkit.enable = true; + + services.pipewire = { + enable = true; + alsa.enable = true; + pulse.enable = true; + }; + + hardware.bluetooth = { + enable = true; + package = pkgs.bluez; + }; + + programs.zsh.vteIntegration = true; + programs.bash.vteIntegration = true; + services.upower.enable = true; + + services.acpid.enable = true; + programs.light.enable = true; + + programs.xwayland.enable = true; + + environment.sessionVariables = { + GTK_THEME = "Adwaita:dark"; + }; + xdg.portal = { + enable = true; + wlr.enable = true; + extraPortals = [ pkgs.xdg-desktop-portal-gnome ]; + }; + + services.udisks2.enable = true; + environment.shellAliases = { + # mounting shit + mnt = "udisksctl mount -b"; + umnt = "udisksctl unmount -b"; + unlock = "udisksctl unlock -b"; + lock = "udisksctl lock -b"; + # easier navigation + pwc = "pwd|wl-copy"; + cdp = "cd $(wl-paste)"; + }; + + qt = { + enable = true; + platformTheme = "gnome"; + style = "adwaita-dark"; + }; + + services.gnome.gnome-keyring.enable = true; + programs.seahorse.enable = true; + + # https://github.com/JohnRTitor/nix-conf/commit/53bc83aef18849976d5a42cc727d38dd0e38c5b0 + security.pam.services = { + greetd.enableGnomeKeyring = true; + greetd-password.enableGnomeKeyring = true; + login.enableGnomeKeyring = true; + }; + services.dbus.packages = with pkgs; [ + gnome-keyring + gcr + ]; + + services.greetd = { + enable = true; + settings = { + default_session = { + command = "${pkgs.greetd.tuigreet}/bin/tuigreet --time --greeting \"$(${pkgs.fortune}/bin/fortune -s)\" --cmd ${pkgs.niri}/bin/niri-session"; + }; + }; + }; + + programs.gnupg.agent.pinentryPackage = pkgs.pinentry-curses; +} diff --git a/modules/plasma.nix b/modules/plasma.nix new file mode 100644 index 0000000..1a7a170 --- /dev/null +++ b/modules/plasma.nix @@ -0,0 +1,52 @@ +{ pkgs, ... }: +{ + imports = [ + ./desktop-software.nix + ./fonts.nix + ]; + + environment.systemPackages = with pkgs; [ + kaidan + kdePackages.filelight + kdePackages.okular + vlc + ]; + + programs.kde-pim = { + enable = true; + kmail = true; + kontact = true; + merkuro = true; + }; + + # Enable sound. + security.rtkit.enable = true; + services.pipewire = { + enable = true; + alsa.enable = true; + pulse.enable = true; + }; + + programs.zsh.vteIntegration = true; + programs.bash.vteIntegration = true; + + hardware.bluetooth.enable = true; + + services.displayManager.sddm = { + enable = true; + wayland.enable = true; + }; + + services.desktopManager.plasma6.enable = true; + + programs.ssh = { + startAgent = true; + enableAskPassword = false; + extraConfig = '' + AddKeysToAgent yes + ''; + }; + programs.firefox.nativeMessagingHosts.packages = with pkgs.kdePackages; [ + plasma-browser-integration + ]; +} diff --git a/modules/radio.nix b/modules/radio.nix new file mode 100644 index 0000000..391e98b --- /dev/null +++ b/modules/radio.nix @@ -0,0 +1,39 @@ +{ pkgs, ... }: + +{ + environment.systemPackages = with pkgs; [ + gnuradio + gqrx + cubicsdr + sdrangel + multimon-ng + sox + + libusb1 + rtl-sdr + hackrf + soapyhackrf + + sigdigger + suscan + sigutils + ]; + + hardware = { + rtl-sdr.enable = true; + hackrf.enable = true; + }; + + services.udev.extraRules = '' + # MCH2022 Badge + SUBSYSTEM=="usb", ATTR{idVendor}=="16d0", ATTR{idProduct}=="0f9a", MODE="0666" + + #Flipper Zero serial port + SUBSYSTEMS=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="5740", ATTRS{manufacturer}=="Flipper Devices Inc.", TAG+="uaccess" + #Flipper Zero DFU + SUBSYSTEMS=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="df11", ATTRS{manufacturer}=="STMicroelectronics", TAG+="uaccess" + #Flipper ESP32s2 BlackMagic + SUBSYSTEMS=="usb", ATTRS{idVendor}=="303a", ATTRS{idProduct}=="40??", ATTRS{manufacturer}=="Flipper Devices Inc.", TAG+="uaccess" + ''; + +} diff --git a/modules/science.nix b/modules/science.nix new file mode 100644 index 0000000..ff7eaa3 --- /dev/null +++ b/modules/science.nix @@ -0,0 +1,8 @@ +{ pkgs, ... }: +{ + environment.systemPackages = with pkgs; [ + gnuplot + zotero + numbat + ]; +} diff --git a/modules/tlp.nix b/modules/tlp.nix new file mode 100644 index 0000000..5606ab2 --- /dev/null +++ b/modules/tlp.nix @@ -0,0 +1,14 @@ +{ ... }: + +{ + powerManagement.cpuFreqGovernor = null; + services.power-profiles-daemon.enable = false; + services.tlp = { + enable = true; + settings = { + USB_BLACKLIST = "1d50:604b 1d50:6089 1d50:cc15 1fc9:000c"; + CPU_SCALING_GOVERNOR_ON_AC = "performance"; + CPU_SCALING_GOVERNOR_ON_BAT = "powersave"; + }; + }; +} diff --git a/modules/wg/mgmt.nix b/modules/wg/mgmt.nix index cfec996..64a55fd 100644 --- a/modules/wg/mgmt.nix +++ b/modules/wg/mgmt.nix @@ -26,7 +26,6 @@ }; "toaster" = { - # for now it's a non-nixos system address = [ "10.89.87.100/24" "fd31:185d:722e::100/48" -- cgit v1.3.1