configs/nixos/common-configuration.nix
nixos/common-configuration.nixRaw
1# This file contains the config shared across different devices.
2
3{ 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 # Sway session managed by greetd.
25 services.greetd = {
26 enable = true;
27 settings.default_session = {
28 command = "${pkgs.tuigreet}/bin/tuigreet --time --remember --cmd sway";
29 user = "greeter";
30 };
31 };
32
33 # Enable and unlock the GNOME Keyring through greetd's PAM session.
34 services.gnome.gnome-keyring.enable = true;
35 security.pam.services.greetd.enableGnomeKeyring = true;
36
37 programs.sway = {
38 enable = true;
39 wrapperFeatures.gtk = true;
40 };
41 security.polkit.enable = true;
42
43 # Minimal Sway sessions do not process XDG autostart entries, so start the
44 # authentication agent explicitly with the graphical user session.
45 systemd.user.services.polkit-gnome-authentication-agent = {
46 description = "Polkit GNOME authentication agent";
47 wantedBy = [ "graphical-session.target" ];
48 partOf = [ "graphical-session.target"];
49 after = [ "graphical-session.target" ];
50 serviceConfig = {
51 Type = "simple";
52 ExecStart = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1";
53 Restart = "on-failure";
54 };
55 };
56
57 # Automatically mount removable media while the graphical session is active.
58 systemd.user.services.udiskie = {
59 description = "Udiskie removable media automounter";
60 wantedBy = [ "graphical-session.target" ];
61 partOf = [ "graphical-session.target" ];
62 after = [ "graphical-session.target" ];
63 serviceConfig = {
64 Type = "simple";
65 ExecStart = "${pkgs.udiskie}/bin/udiskie --no-tray";
66 Restart = "on-failure";
67 };
68 };
69 environment.systemPackages = with pkgs; [
70 # Sway utilities
71 grim
72 slurp
73 wl-clipboard
74 mako
75
76 # Utilities
77 wget
78 tmux
79 git
80 delta
81 tig
82 mosh
83 bat
84 ripgrep
85 fzf
86 htop
87 jq
88 unzip
89 gnutar
90 flameshot
91 pulseaudio
92 usbutils
93 time
94 fastfetch
95 rpm
96 pdfgrep
97 keynav
98 screenfetch
99
100 # Editors and terminals
101 neovim
102 vim-full
103 alacritty
104 kitty
105
106 # Documents and file management
107 zathura
108 atril
109 lf
110 yazi
111 thunar
112 xfconf
113 ristretto
114 tumbler
115 thunar-volman
116 udiskie # auto-mount usb (needed for sway)
117 polkit_gnome # let unprivileged users mount filesystems
118
119 # Media
120 pavucontrol
121 mpv
122 vlc
123 feh
124 gimp
125 calibre
126 tauon
127 kdePackages.kdenlive
128 libreoffice-qt6
129 ffmpeg
130
131 # Browsers
132 firefox
133 qutebrowser
134 chromium
135
136 # Development
137 texlive.combined.scheme-full
138 gnumake
139 gcc
140 clang
141 clang-tools
142 openssl
143 openssl.dev
144 glib
145 gdk-pixbuf
146 gtk3
147 atk
148 cairo
149 pango
150 pkg-config
151 cmake
152 rustup
153 wabt
154 wasmedge
155 sage
156 coq
157 coqPackages.mathcomp
158 opam
159 go
160 gopls
161 (python3.withPackages (ps: with ps; [
162 pynvim
163 matplotlib
164 numpy
165 meshtastic
166 esptool
167 unicodeit
168 setuptools
169 jupyterlab
170 ]))
171 nodejs
172 pnpm
173 elan
174
175 # Keyboard firmware
176 qmk
177 vial
178 via
179 ];
180 fonts.packages = with pkgs; [
181 dina-font
182 proggyfonts
183 terminus_font
184 fira-code
185 liberation_ttf
186 noto-fonts
187 tamsyn
188 termsyn
189 gohufont
190 ];
191
192 programs.zsh.enable = true;
193 users.defaultUserShell = pkgs.zsh;
194 environment.shells = [ pkgs.zsh ];
195
196 # Set the web browser and default PDF reader.
197 xdg.mime.enable = true;
198 environment.sessionVariables = {
199 BROWSER = "firefox";
200 };
201 xdg.mime.defaultApplications = {
202 "application/pdf" = "org.pwmt.zathura.desktop";
203 "text/html" = "firefox.desktop";
204 "x-scheme-handler/http" = "firefox.desktop";
205 "x-scheme-handler/https" = "firefox.desktop";
206 };
207
208 xdg.portal = {
209 enable = true;
210 xdgOpenUsePortal = true;
211 extraPortals = [ pkgs.xdg-desktop-portal-gtk ];
212
213 config.sway = {
214 default = "gtk";
215 "org.freedesktop.impl.portal.ScreenCast" = "wlr";
216 "org.freedesktop.impl.portal.Screenshot" = "wlr";
217 };
218 };
219
220 # gvfs needed for Thunar to detect external disks
221 services.gvfs.enable = true;
222
223 hardware.graphics.enable = true;
224
225 # bluetooth related
226 hardware.bluetooth.enable = true;
227 services.blueman.enable = true;
228
229 services.pipewire = {
230 enable = true;
231 alsa.enable = true;
232 alsa.support32Bit = true;
233 pulse.enable = true;
234 wireplumber.enable = true;
235 jack.enable = true;
236 };
237
238 # udev rules (for Vial)
239 services.udev.extraRules = ''
240 KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="4653", ATTRS{idProduct}=="0001", MODE="0660", GROUP="users", TAG+="uaccess"
241 '';
242 services.udev.packages = [ pkgs.qmk-udev-rules ];
243
244 nix.settings.extra-experimental-features = [ "nix-command" "flakes" ];
245}