Summary Files Commits Branches @commit @diff @stats
path: root / modules
diff options
context:
space:
mode:
Commitf087e4cda75ce0ab2dcf6f4a8dbcaad9ec876ede (patch)
Author
 Syndamia <kamen@syndamia.com>
2024-07-07 08:55:30 +0300
Committer
 Syndamia <kamen@syndamia.com>
2024-07-07 08:55:30 +0300
Files37d7d19aa83e5d2d7ab9370ddfda9091671d2972 /modules
nix-f087e4cda75ce0ab2dcf6f4a8dbcaad9ec876ede.tar
nix-f087e4cda75ce0ab2dcf6f4a8dbcaad9ec876ede.tar.gz
nix-f087e4cda75ce0ab2dcf6f4a8dbcaad9ec876ede.zip
Parent27b0e6bf1f4cc859d331d5c50030d8531c958452 (diff)
[all] Improved autoconfig-ing setup and added some configs
10 files changed, 292 insertions, 0 deletions
-rw-r--r--modules/cli-apps.nix33
-rw-r--r--modules/desktop_archiving.nix15
-rw-r--r--modules/dev.nix25
-rw-r--r--modules/fonts.nix9
-rw-r--r--modules/general-settings.nix21
-rw-r--r--modules/gui-apps.nix54
-rw-r--r--modules/keyboard.nix9
-rw-r--r--modules/laptop_control.nix13
-rw-r--r--modules/openbox-de.nix98
-rw-r--r--modules/web-server.nix15
diff --git a/modules/cli-apps.nix b/modules/cli-apps.nix
new file mode 100644
index 0000000..ab6f5a9
--- /dev/null
+++ b/modules/cli-apps.nix
@@ -0,0 +1,33 @@
+{ pkgs, ... }: {
+ environment.systemPackages = with pkgs; [
+ # Hardware managing apps
+ pipewire libinput lm_sensors lshw usbutils chrony iotop bluez efibootmgr libva-utils
+ parted dosfstools mtpfs ntfs3g squashfsTools
+ # Network
+ wget git rsync inetutils vnstat yt-dlp
+ # Working with files
+ neovim vim-full inotify-tools lsof tree xmlstarlet
+ # General usage
+ zsh dash htop rlwrap bc ddrescue cron
+ # Working with files
+ ffmpeg img2pdf pdftk imagemagick pngcrush jpegoptim optipng gd kid3 pandoc libisoburn mediainfo
+ # Archive formats
+ p7zip dpkg cdrtools zip unzip rar unrar rpm
+ # Misc
+ neofetch nixpkgs-2305.exa moc lazygit aspell
+ ];
+
+ # zsh
+ programs.zsh.enable = true;
+ environment.shells = with pkgs; [ zsh ];
+
+ # bluez
+
+ programs = {
+ mtr.enable = true;
+ gnupg.agent = {
+ enable = true;
+ enableSSHSupport = true;
+ };
+ };
+}
diff --git a/modules/desktop_archiving.nix b/modules/desktop_archiving.nix
new file mode 100644
index 0000000..f3b6de8
--- /dev/null
+++ b/modules/desktop_archiving.nix
@@ -0,0 +1,15 @@
+{ pkgs, ... }: {
+ environment.systemPackages = with pkgs; [
+ timeshift
+ # k3s
+ ];
+
+ networking.firewall = {
+ allowedTCPPorts = [ 6443 ];
+ };
+
+ services.k3s = {
+ enable = false;
+ role = "server";
+ };
+}
diff --git a/modules/dev.nix b/modules/dev.nix
new file mode 100644
index 0000000..b291692
--- /dev/null
+++ b/modules/dev.nix
@@ -0,0 +1,25 @@
+{ pkgs, ... }: {
+ environment.systemPackages = with pkgs; [
+ gnumake
+ lowdown wakatime cloc go php fontforge ruby csslint
+ # C/C++
+ clang clang-tools glibc gcc gdb valgrind pugixml cmake libusb libusb-compat-0_1 meson
+ # .NET
+ dotnet-sdk mono
+ # Python
+ python3Minimal
+ # Android
+ android-tools heimdall
+ # Networking
+ wireshark gns3-gui gns3-server dynamips
+ # awk
+ gawk mawk nawk
+ # DB
+ mysql sqlite sqlitebrowser flyway
+ # Functional
+ racket ghc sbcl
+ # Compilers
+ flex bison
+ rstudio
+ ];
+}
diff --git a/modules/fonts.nix b/modules/fonts.nix
new file mode 100644
index 0000000..923f452
--- /dev/null
+++ b/modules/fonts.nix
@@ -0,0 +1,9 @@
+{ pkgs, ... }: {
+ fonts.packages = with pkgs; [
+ meslolgs-nerdfont
+ # Note to self: DO NOT INSTALL ADOBE FONTS!
+ corefonts vistafonts liberation_ttf helvetica-neue-lt-std noto-fonts noto-fonts-emoji cm_unicode symbola
+ # CJK
+ noto-fonts-cjk arphic-ukai arphic-uming takao wqy_microhei wqy_zenhei
+ ];
+}
diff --git a/modules/general-settings.nix b/modules/general-settings.nix
new file mode 100644
index 0000000..652c55c
--- /dev/null
+++ b/modules/general-settings.nix
@@ -0,0 +1,21 @@
+{ pkgs, ... }: {
+ nixpkgs.config.allowUnfree = true;
+
+ services.xserver = {
+ # xkbmap
+ layout = "us,bg-custom";
+ xkbVariant = ",phonetic-nonstandard";
+ xkbOptions = "grp:rwin_toggle,grp:alt_shift_toggle,lv3:switch,caps:escape";
+ xkb.extraLayouts.bg-custom = {
+ description = "Non-standard variant of the traditional Bulgarian phonetic keyboard, which replaces some characters with their English counterparts";
+ languages = [ "bg" ];
+ symbolsFile = ../packages/bg-custom;
+ };
+
+ # touchpad support
+ libinput = {
+ enable = true;
+ touchpad.naturalScrolling = true;
+ };
+ };
+}
diff --git a/modules/gui-apps.nix b/modules/gui-apps.nix
new file mode 100644
index 0000000..7817860
--- /dev/null
+++ b/modules/gui-apps.nix
@@ -0,0 +1,54 @@
+{ pkgs, ... }:
+let
+ tex = (pkgs.texlive.combine {
+ inherit (pkgs.texlive) scheme-medium
+ babel-bulgarian cyrillic cancel enumitem;
+ });
+in {
+ environment.systemPackages = with pkgs; [
+ terminator
+ obs-studio qbittorrent speedcrunch
+ rtl-sdr gqrx sdrangel xed-editor
+ devilspie2 sxhkd
+ glava
+ # Settings and backup tools
+ feh xterm arandr pavucontrol blueberry piper
+ # Tray
+ copyq flameshot barrier redshift
+ # File openers/players
+ audacious mpv libreoffice
+ # File/image/audio editors
+ gimp inkscape texmaker tex krita ardour
+ # Web (app) clients
+ brave bitwarden nextcloud-client thunderbird birdtray
+ # System
+ peek gparted
+ # Virtualization
+ virt-manager libvirt qemu_kvm kvmtool qemu_full
+ ];
+
+ programs.firefox.enable = true;
+
+ # libvirt
+ virtualisation.libvirtd.enable = true;
+
+ # docker
+ virtualisation.docker.enable = true;
+
+ # rtl-sdr
+
+ systemd.user.services = {
+ devilspie2 = {
+ description = "devilspie2 runner";
+ wantedBy = [ "graphical-session.target" ];
+ wants = [ "graphical-session.target" ];
+ after = [ "graphical-session.target" ];
+ serviceConfig = {
+ ExecStart = "${pkgs.devilspie2}/bin/devilspie2";
+ Restart = "on-failure";
+ RestartSec = 1;
+ TimeoutStopSec = 10;
+ };
+ };
+ };
+}
diff --git a/modules/keyboard.nix b/modules/keyboard.nix
new file mode 100644
index 0000000..9dcc502
--- /dev/null
+++ b/modules/keyboard.nix
@@ -0,0 +1,9 @@
+{ pkgs, ... }: {
+ environment.systemPackages = with pkgs; [
+ via qmk
+ ];
+ services.udev.packages = with pkgs; [
+ via qmk
+ ];
+ hardware.keyboard.qmk.enable = true;
+}
diff --git a/modules/laptop_control.nix b/modules/laptop_control.nix
new file mode 100644
index 0000000..95de027
--- /dev/null
+++ b/modules/laptop_control.nix
@@ -0,0 +1,13 @@
+{ pkgs, ... }: {
+ environment.systemPackages = with pkgs; [
+ # Power
+ powertop upower acpid tlp
+ # Other
+ brightnessctl libinput-gestures epkowa
+ ];
+
+ services = {
+ upower.enable = true;
+ tlp.enable = true;
+ };
+}
diff --git a/modules/openbox-de.nix b/modules/openbox-de.nix
new file mode 100644
index 0000000..8102d6b
--- /dev/null
+++ b/modules/openbox-de.nix
@@ -0,0 +1,98 @@
+{ pkgs, ... }: {
+ environment.systemPackages = with pkgs; [
+ # Essential libs
+ dbus cairo libnotify gtk3 yad gnome.zenity gnome.gvfs gmtp at-spi2-atk
+ # Main apps and their config apps
+ # window manager, compositor, taskbar, notifications, app menu, lockscreen, session manager
+ openbox lxappearance obconf picom nixpkgs-2305.tint2 dunst jgmenu i3lock-color lightdm lightdm-gtk-greeter
+ # General X11 tools
+ lxqt.lxqt-policykit xorg.xev xfontsel xorg.xmodmap xorg.xwininfo xorg.xprop clipnotify xdotool xautolock xcape xorg.setxkbmap xkbmon xorg.xhost xclip wmctrl
+ menu-cache
+ # Tray
+ libappindicator networkmanagerapplet pnmixer
+ # File openers
+ evince gnome.eog gnome.file-roller cinnamon.nemo-with-extensions gnome.seahorse
+ # System
+ gnome.gnome-system-monitor udisks gnome.gnome-disk-utility baobab gnome.simple-scan
+ # Theme
+ nixpkgs-mint.cinnamon.mint-themes nixpkgs-mint.cinnamon.mint-y-icons oreo-black-bordered-cursor
+ openbox-theme-collections openbox-blocks-dark
+
+ xdg-desktop-portal-gtk xdg-desktop-portal-xapp
+ ];
+
+ security.polkit.enable = true;
+
+ xdg.portal = {
+ enable = true;
+ configPackages = with pkgs; [ xdg-desktop-portal-gtk xdg-desktop-portal-xapp ];
+ config.common = {
+ default = [ "gtk" "xapp" ];
+ "org.freedesktop.impl.portal.Screenshot" = [ "xapp" ];
+ };
+ };
+
+ programs = {
+ dconf.enable = true;
+ gnome-disks.enable = true;
+ };
+
+ services = {
+ dbus.packages = with pkgs; [ gnome2.GConf ];
+ udev.packages = with pkgs; [ gnome.gnome-settings-daemon ];
+
+ udisks2.enable = true; # gnome-disks disk access
+ gnome.gnome-keyring.enable = true;
+ gvfs.enable = true; # MTP (for nemo)
+
+ logind.extraConfig = ''
+ InhibitDelayMaxSec=1
+ HoldoffTimeoutSec=1s
+ HandlePowerKey=poweroff'';
+ };
+
+ services.xserver = {
+ enable = true;
+ # Window manager
+ windowManager.openbox.enable = true;
+
+ xautolock = {
+ enable = true;
+ time = 15;
+ locker = "/home/kamen/.a/sys/lock.sh";
+ extraOptions = [ "-detectsleep" "-secure" ];
+ };
+ };
+
+ systemd.services = {
+ lockscreen = {
+ wantedBy = [ "sleep.target" ];
+ before = [ "suspend.target" ];
+ serviceConfig = {
+ User = "kamen";
+ Environment = [ "DISPLAY=:0" "PATH=/run/current-system/sw/bin" "DBUS_SESSION_BUS_ADDRESS=\"unix:path=/run/user/1000/bus\"" ];
+ ExecStart = "/home/kamen/.a/sys/lock.sh";
+ };
+ };
+ };
+
+ systemd.user.services = {
+ lxqt-policykit = {
+ description = "lxqt-policykit runner";
+ wantedBy = [ "graphical-session.target" ];
+ wants = [ "graphical-session.target" ];
+ after = [ "graphical-session.target" ];
+ serviceConfig = {
+ Type = "simple";
+ ExecStart = "${pkgs.lxqt.lxqt-policykit}/bin/lxqt-policykit-agent";
+ Restart = "on-failure";
+ RestartSec = 1;
+ TimeoutStopSec = 10;
+ };
+ };
+
+ # This is kinda gross, because the xautolock service is already defined and configured
+ # inside services.xserver.xautolock, but it's the only way I know
+ xautolock.serviceConfig.Environment = [ "DISPLAY=:0" "PATH=/run/current-system/sw/bin" ];
+ };
+}
diff --git a/modules/web-server.nix b/modules/web-server.nix
new file mode 100644
index 0000000..f8a13b5
--- /dev/null
+++ b/modules/web-server.nix
@@ -0,0 +1,15 @@
+{ pkgs, ... }: {
+ environment.systemPackages = with pkgs; [ apacheHttpd ];
+
+ services.httpd = {
+ enable = true;
+
+ virtualHosts = {
+ syndamiadotcom-local = {
+ hostName = "synd.local";
+ listen = [ { port = 80; } ];
+ documentRoot = "/home/kamen/Programming/GitLab-repos/syndamiadotcom/website";
+ };
+ };
+ };
+}