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;
48 #services.displayManager.sessionPackages = [ pkgs.sway ];
49 #services.xserver.displayManager.gdm.wayland=false;
50 #services.xserver.displayManager.plasma5.enable=true;
51 # Enable the gnome-keyring secrets vault.
52 # Will be exposed through DBus to programs willing to store secrets.
53 services.gnome.gnome-keyring.enable = true;
54 # enable sway wm
55 programs.sway = {
56 enable = true;
57 wrapperFeatures.gtk = true;
58 };
59 security.polkit.enable = true;
60 # --- end of sway config.
61
62 environment.systemPackages = with pkgs; [
63 # sway wm utilities
64 grim # screenshot functionality
65 slurp # screenshot functionality
66 wl-clipboard # wl-copy and wl-paste for copy/paste from stdin / stdout
67 mako # notification system developed by swaywm maintainer
68
69 # utilities
70 wget
71 tmux
72 git
73 delta
74 tig
75 mosh
76 bat
77 ripgrep
78 fzf
79 screenfetch
80 htop
81 jq
82 keynav
83 unzip
84 gnutar
85 xorg.xmodmap # keyboard remapping
86 xfce.xfce4-screenshooter
87 pulseaudio
88 usbutils
89 time
90 #impala # nmtui alternative
91 fastfetch
92 rpm
93 pdfgrep # to find strings across pdfs in directories
94
95 # code editors
96 vim
97 neovim
98 vimHugeX # to make clipboard work in vim
99 xclip # to make clipboard work in neovim
100
101 # terminals
102 alacritty
103 kitty
104
105 # pdf
106 zathura
107 mate.atril
108
109 # file explorers/managers
110 lf
111 yazi
112 xfce.thunar
113 xfce.xfconf # needed to save preferences of thunar
114 xfce.ristretto
115 xfce.tumbler # for thumbnails of imgs
116 # for detecting usbs:
117 xfce.thunar-volman
118 gvfs
119 polkit_gnome
120 udiskie
121
122 # media
123 pavucontrol
124 mpv
125 vlc
126 feh
127 #kolourpaint
128 gimp
129 calibre
130 tauon
131 libsForQt5.kdenlive
132 libreoffice-qt6
133 ffmpeg
134
135 # browsers
136 firefox
137 qutebrowser
138 chromium
139
140 # languages
141 #texlive.combined.scheme-medium # includes latexmk
142 #texlivePackages.minted
143 pgf-umlsd # latex diagrams
144 pgf
145 (pkgs.texlive.combine {
146 inherit (pkgs.texlive)
147 scheme-medium # includes latexmk
148 minted # syntax highligting
149 pgf
150 ;
151 })
152 gnumake
153 gcc
154 clang
155 clang-tools
156
157 openssl
158 openssl.dev
159 glib # GLib base library
160 #gio # GIO library
161 gdk-pixbuf # GDK Pixbuf library
162 gtk3 # GTK3 including GDK, relevant for gdk-sys
163 atk # Accessibility Toolkit
164 cairo # 2D graphics library
165 pango # Text layout and rendering
166 pkg-config # Needed for pkg-config to find .pc files
167 cmake
168
169 stdenv
170 rustup
171 wabt # wasm binary toolkit
172 wasmedge # to execute wasm binaries
173 sage
174 coq
175 coqPackages.mathcomp
176 #coqPackages.coqide
177 opam # ocaml package manager, for coq packages
178 go
179 (python3.withPackages(ps: with ps; [
180 matplotlib numpy
181 qmk
182 meshtastic esptool # meshtastic related
183 unicodeit
184 setuptools
185 ]))
186 pipx
187 nodejs
188 pnpm
189
190 # other
191 qmk
192 vial
193 via
194
195 freecad
196 orca-slicer
197 ];
198
199 environment.variables = {
200 OPENSSL_DEV = "${pkgs.openssl.dev}";
201 OPENSSL_LIB_DIR = "${pkgs.openssl.out}/lib";
202 OPENSSL_INCLUDE_DIR = "${pkgs.openssl.dev}/include";
203 PKG_CONFIG_PATH = "${pkgs.openssl.dev}/lib/pkgconfig";
204
205 OPENSSL_NO_VENDOR="1";
206 OPENSSL_STATIC="0";
207
208 # for screen sharing in sway
209 XDG_CURRENT_DESKTOP = "sway";
210 XDG_SESSION_TYPE="wayland";
211
212 WAYLAND_DISPLAY="wayland-1";
213 XDG_RUNTIME_DIR="/run/user/$(id -u)";
214 };
215
216 fonts.packages = with pkgs; [
217 dina-font
218 proggyfonts
219 terminus_font
220 fira-code
221 liberation_ttf
222 noto-fonts
223 tamsyn
224 termsyn
225 gohufont
226 ];
227
228 programs.zsh.enable = true;
229 users.defaultUserShell = pkgs.zsh;
230 environment.shells = with pkgs; [zsh];
231
232 # set default pdf reader to zathura
233 xdg.mime.enable=true;
234 environment.sessionVariables = {
235 BROWSER = "zathura";
236 };
237 xdg.mime.defaultApplications = {
238 "application/pdf" = "zathura";
239 };
240 xdg.portal = {
241 enable = true;
242 wlr.enable = true;
243 extraPortals = [ pkgs.xdg-desktop-portal-gtk pkgs.xdg-desktop-portal-wlr ];
244 };
245
246 # gvfs needed for Thunar to detect external disks
247 services.gvfs.enable = true;
248
249 hardware.graphics.enable = true;
250
251 # bluetooth related
252 hardware.bluetooth.enable = true;
253 services.blueman.enable = true;
254
255 #hardware.pulseaudio.enable = true;
256 #services.pulseaudio.enable = true;
257 #services.pipewire.pulse.enable=false;
258 #services.pipewire.enable=false;
259 services.pipewire = {
260 enable = true; # Enable PipeWire service
261 alsa.enable = true; # Enable ALSA support (audio hardware)
262 alsa.support32Bit = true; # Support 32-bit apps on 64-bit systems
263 pulse.enable = true; # Enable PipeWire PulseAudio replacement
264 wireplumber.enable = true; # Enable WirePlumber session manager (recommended)
265 jack.enable = true; # Enable JACK support if needed
266 };
267
268 # udev rules (for Vial)
269 services.udev.extraRules = ''
270 KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="4653", ATTRS{idProduct}=="0001", MODE="0660", GROUP="users", TAG+="uaccess", TAG+="udev-acl"
271 '';
272 services.udev.packages = with pkgs; [
273 qmk
274 qmk-udev-rules
275 qmk_hid
276 via
277 vial
278 ];
279
280 nix.settings.extra-experimental-features = [ "nix-command" "flakes" ];
281}