Summary Files Commits Branches @commit @diff @stats
path: root / packages / default.nix
blob: 7949cc40286cf733719f023df56cbbbcd4c40cbb (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
{
  cli-apps = { 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
      # Working with files
      vim-full inotify-tools lsof tree
      # 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;
      };
    };
  };



  gui-apps = { 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
      # 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;
        };
      };
    };
  };



  dev = { pkgs, ... }: {
    environment.systemPackages = with pkgs; [
      gnumake
      lowdown wakatime cloc go php fontforge 
      # C/C++
      clang glibc gcc gdb valgrind pugixml cmake libusb libusb-compat-0_1
      # .NET
      dotnet-sdk mono 
      # Python
      python3Minimal 
      # Android
      android-tools heimdall
      # Networking
      wireshark gns3-gui gns3-server dynamips
      # awk
      gawk mawk nawk
      # DB
      mysql sqlitebrowser flyway
      # Functional
      racket ghc sbcl
      # Compilers
      flex bison
    ];
  };



  web-server = { 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";
        };
      };
    };
  };



  laptop_control = { pkgs, ... }: {
    environment.systemPackages = with pkgs; [
      # Power
      powertop upower acpid tlp
      # Other
      brightnessctl libinput-gestures epkowa
    ];

    services = {
      upower.enable = true;
      tlp.enable = true;
    };
  };



  desktop_archiving = { pkgs, ... }: {
    environment.systemPackages = with pkgs; [
      timeshift
    ];
  };



  openbox-de = { 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
    ];

    security.polkit.enable = true;

    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" ];
    };
  };



  general-settings = { pkgs, ... }: {
    nixpkgs.config.allowUnfree = true;

    services.xserver = {
      # xkbmap
      layout = "us,bg-custom";
      xkbVariant = ",phonetic-nonstandard";
      xkbOptions = "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 = ./bg-custom;
      };

      # touchpad support
      libinput = {
        enable = true;
        touchpad.naturalScrolling = true;
      };
    };
  };



  fonts = { 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
    ];
  };
}