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