configs/nixos/common-configuration.nix
nixos/common-configuration.nixRaw
1# This file contains the config shared across different devices.
2
3{ config, pkgs, ... }:
4
5{
6 # Set your time zone.
7 time.timeZone = "Europe/Madrid";
8
9 # Select internationalisation properties.
10 i18n.defaultLocale = "en_US.UTF-8";
11
12 i18n.extraLocaleSettings = {
13 LC_ADDRESS = "es_ES.UTF-8";
14 LC_IDENTIFICATION = "es_ES.UTF-8";
15 LC_MEASUREMENT = "es_ES.UTF-8";
16 LC_MONETARY = "es_ES.UTF-8";
17 LC_NAME = "es_ES.UTF-8";
18 LC_NUMERIC = "es_ES.UTF-8";
19 LC_PAPER = "es_ES.UTF-8";
20 LC_TELEPHONE = "es_ES.UTF-8";
21 LC_TIME = "en_US.UTF-8";
22 };
23
24# services.displayManager = {
25# defaultSession = "none+i3";
26# };
27 services.xserver = {
28 xkb = { # Configure keymap in X11
29 layout = "us";
30 variant = "";
31 };
32
33 enable=true;
34# #displayManager = {
35# # defaultSession = "none+i3";
36# #};
37# windowManager.i3 = {
38# enable=true;
39# extraPackages = with pkgs; [
40# dmenu
41# i3status
42# i3lock
43# ];
44# };
45 };
46 # --- sway wm config:
47 #services.xserver.displayManager.gdm.enable=true; # v25.05
48 #services.displayManager.gdm.enable = true; # v26.05
49 services.displayManager.gdm.enable = false;
50 services.greetd = {
51 enable = true;
52 settings.default_session = {
53 command = "${pkgs.tuigreet}/bin/tuigreet --time --remember --cmd sway";
54 user = "greeter";
55 };
56 };
57
58 #services.displayManager.sessionPackages = [ pkgs.sway ];
59 #services.xserver.displayManager.gdm.wayland=false;
60 #services.xserver.displayManager.plasma5.enable=true;
61 # Enable the gnome-keyring secrets vault.
62 # Will be exposed through DBus to programs willing to store secrets.
63 services.gnome.gnome-keyring.enable = true;
64 # enable sway wm
65 programs.sway = {
66 enable = true;
67 wrapperFeatures.gtk = true;
68 };
69 security.polkit.enable = true;
70 # --- end of sway config.
71
72 environment.systemPackages = with pkgs; [
73 # sway wm utilities
74 grim # screenshot functionality
75 slurp # screenshot functionality
76 wl-clipboard # wl-copy and wl-paste for copy/paste from stdin / stdout
77 mako # notification system developed by swaywm maintainer
78
79 # utilities
80 wget
81 tmux
82 git
83 delta
84 tig
85 mosh
86 bat
87 ripgrep
88 fzf
89 screenfetch
90 htop
91 jq
92 keynav
93 unzip
94 gnutar
95 xmodmap # keyboard remapping
96 xfce4-screenshooter
97 flameshot
98 pulseaudio
99 usbutils
100 time
101 #impala # nmtui alternative
102 fastfetch
103 rpm
104 pdfgrep # to find strings across pdfs in directories
105
106 # code editors
107 vim
108 neovim
109 vim-full
110 #vimHugeX # to make clipboard work in vim
111 xclip # to make clipboard work in neovim
112
113 # terminals
114 alacritty
115 kitty
116
117 # pdf
118 zathura
119 atril
120
121 # file explorers/managers
122 lf
123 yazi
124 thunar
125 xfconf # needed to save preferences of thunar
126 ristretto
127 tumbler # for thumbnails of imgs
128 # for detecting usbs:
129 thunar-volman
130 gvfs
131 polkit_gnome
132 udiskie
133
134 # media
135 pavucontrol
136 mpv
137 vlc
138 feh
139 #kolourpaint
140 gimp
141 calibre
142 tauon
143 kdePackages.kdenlive
144 libreoffice-qt6
145 ffmpeg
146
147 # browsers
148 firefox
149 qutebrowser
150 chromium
151
152 # languages
153 #texlive.combined.scheme-medium # includes latexmk
154 #texlivePackages.minted
155 pgf-umlsd # latex diagrams
156 pgf
157 (pkgs.texlive.combine {
158 inherit (pkgs.texlive)
159 scheme-full # includes latexmk
160 minted # syntax highligting
161 pgf
162 yfonts
163 ;
164 })
165 gnumake
166 gcc
167 clang
168 clang-tools
169
170 openssl
171 openssl.dev
172 glib # GLib base library
173 #gio # GIO library
174 gdk-pixbuf # GDK Pixbuf library
175 gtk3 # GTK3 including GDK, relevant for gdk-sys
176 atk # Accessibility Toolkit
177 cairo # 2D graphics library
178 pango # Text layout and rendering
179 pkg-config # Needed for pkg-config to find .pc files
180 cmake
181
182 stdenv
183 rustup
184 wabt # wasm binary toolkit
185 wasmedge # to execute wasm binaries
186 sage
187 coq
188 coqPackages.mathcomp
189 #coqPackages.coqide
190 opam # ocaml package manager, for coq packages
191 go
192 (python3.withPackages(ps: with ps; [
193 matplotlib numpy
194 qmk
195 meshtastic esptool # meshtastic related
196 unicodeit
197 setuptools
198 jupyterlab
199 ]))
200 #pipx # removed bcs it has errors in the test suite
201 nodejs
202 pnpm
203 elan # lean
204
205 # other
206 qmk
207 vial
208 via
209
210 #freecad
211 #orca-slicer
212 ];
213
214
215 environment.variables = {
216 OPENSSL_DEV = "${pkgs.openssl.dev}";
217 OPENSSL_LIB_DIR = "${pkgs.openssl.out}/lib";
218 OPENSSL_INCLUDE_DIR = "${pkgs.openssl.dev}/include";
219 PKG_CONFIG_PATH = "${pkgs.openssl.dev}/lib/pkgconfig";
220
221 OPENSSL_NO_VENDOR="1";
222 OPENSSL_STATIC="0";
223
224 # for screen sharing in sway
225 #XDG_CURRENT_DESKTOP = "sway";
226 #XDG_SESSION_TYPE="wayland";
227
228 #WAYLAND_DISPLAY="wayland-1";
229 #XDG_RUNTIME_DIR="/run/user/$(id -u)";
230 };
231
232 fonts.packages = with pkgs; [
233 dina-font
234 proggyfonts
235 terminus_font
236 fira-code
237 liberation_ttf
238 noto-fonts
239 tamsyn
240 termsyn
241 gohufont
242 ];
243
244 programs.zsh.enable = true;
245 users.defaultUserShell = pkgs.zsh;
246 environment.shells = with pkgs; [zsh];
247
248 # set default pdf reader to zathura
249 xdg.mime.enable=true;
250 environment.sessionVariables = {
251 BROWSER = "zathura";
252 };
253 xdg.mime.defaultApplications = {
254 "application/pdf" = "zathura";
255 };
256 #xdg.portal = {
257 # enable = true;
258 # wlr.enable = true;
259 # extraPortals = [ pkgs.xdg-desktop-portal-gtk pkgs.xdg-desktop-portal-wlr ];
260 #};
261
262xdg.portal = {
263 enable = true;
264 wlr.enable = true;
265
266 extraPortals = with pkgs; [
267 xdg-desktop-portal-gtk
268 ];
269
270 configPackages = with pkgs; [
271 xdg-desktop-portal-wlr
272 xdg-desktop-portal-gtk
273 ];
274
275 config.sway = {
276 default = "gtk";
277 "org.freedesktop.impl.portal.ScreenCast" = "wlr";
278 "org.freedesktop.impl.portal.Screenshot" = "wlr";
279 };
280};
281
282 # gvfs needed for Thunar to detect external disks
283 services.gvfs.enable = true;
284
285 hardware.graphics.enable = true;
286
287 # bluetooth related
288 hardware.bluetooth.enable = true;
289 services.blueman.enable = true;
290
291 #hardware.pulseaudio.enable = true;
292 #services.pulseaudio.enable = true;
293 #services.pipewire.pulse.enable=false;
294 #services.pipewire.enable=false;
295 services.pipewire = {
296 enable = true; # Enable PipeWire service
297 alsa.enable = true; # Enable ALSA support (audio hardware)
298 alsa.support32Bit = true; # Support 32-bit apps on 64-bit systems
299 pulse.enable = true; # Enable PipeWire PulseAudio replacement
300 wireplumber.enable = true; # Enable WirePlumber session manager (recommended)
301 jack.enable = true; # Enable JACK support if needed
302 };
303
304 # udev rules (for Vial)
305 services.udev.extraRules = ''
306 KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="4653", ATTRS{idProduct}=="0001", MODE="0660", GROUP="users", TAG+="uaccess", TAG+="udev-acl"
307 '';
308 services.udev.packages = with pkgs; [
309 qmk
310 qmk-udev-rules
311 qmk_hid
312 via
313 vial
314 ];
315
316 nix.settings.extra-experimental-features = [ "nix-command" "flakes" ];
317}