1- # Edit this configuration file to define what should be installed on
2- # your system. Help is available in the configuration.nix(5) man page
3- # and in the NixOS manual (accessible by running 'nixos-help').
4-
5- # sudo nixos-rebuild switch
6- # sudo nix-channel --update
7- # nix-shell -p vim
8- # nmcli device wifi connect MYSSID password PWORD
9- # systemctl restart display-manager.service
1+ #
2+ #
3+ # l2/configuration.nix
4+ #
105
116{
127 inputs ,
5045 enable = true ;
5146 consoleMode = "max" ;
5247 memtest86 . enable = true ;
48+ configurationLimit = 20 ;
5349 } ;
5450
5551 loader . efi . canTouchEfiVariables = true ;
5652
5753 # https://nixos.wiki/wiki/Linux_kernel
58- #kernelPackages = pkgs.linuxPackages; # need to run this old kernel to allow nvidia driver to compile :(
5954 #kernelPackages = pkgs.linuxPackages;
6055 kernelPackages = pkgs . linuxPackages_latest ;
61- #boot.kernelPackages = pkgs.linuxPackages_rpi4
62-
63- # # https://github.com/tolgaerok/nixos-2405-gnome/blob/main/core/boot/efi/efi.nix#L56C5-L56C21
64- # kernelParams = [
65- # "nvidia-drm.modeset=1"
66- # "nvidia-drm.fbdev=1"
67- # # https://www.reddit.com/r/NixOS/comments/u5l3ya/cant_start_x_in_nixos/?rdt=56160
68- # #"nomodeset"
69- # ];
7056
7157 initrd . kernelModules = [
7258 "amdgpu"
7763 #"i915"
7864 ] ;
7965
80- # https://wiki.nixos.org/wiki/NixOS_on_ARM/Building_Images#Compiling_through_binfmt_QEMU
81- # https://nixos.org/manual/nixos/stable/options#opt-boot.binfmt.emulatedSystems
82- binfmt . emulatedSystems = [ "aarch64-linux" "riscv64-linux" ] ;
83-
84- extraModulePackages = [
85- config . boot . kernelPackages . v4l2loopback
86- ] ;
66+ initrd . preDeviceCommands = ''
67+ echo "Loading regulatory database early"
68+ cp ${ pkgs . wireless-regdb } /lib/firmware/regulatory.db /lib/firmware/
69+ cp ${ pkgs . wireless-regdb } /lib/firmware/regulatory.db.p7s /lib/firmware/
70+ '' ;
8771
72+ # cat /proc/cmdline
73+ # cat /etc/modprobe.d/nixos.conf
8874 extraModprobeConfig = ''
89- options kvm_intel nested=1
90- options v4l2loopback devices=1 video_nr=1 card_label="OBS Cam" exclusive_caps =1
75+ options cfg80211 ieee80211_regdom=US
76+ options iwlwifi lar_disable =1
9177 '' ;
78+
9279 } ;
9380
9481 # https://fzakaria.com/2025/02/26/nix-pragmatism-nix-ld-and-envfs
10087 stdenv . cc . cc . lib
10188 zlib
10289 libxml2
103- # Add more libraries as needed
10490 ] ;
10591 } ;
10692
10995 enable = true ;
11096 } ;
11197
112- # For OBS
113- security . polkit . enable = true ;
114-
11598 nix = {
11699 settings = {
117100 auto-optimise-store = true ;
136119
137120 time . timeZone = "America/Los_Angeles" ;
138121
139- services . udev . packages = [ pkgs . gnome-settings-daemon ] ;
140- # services.udev.packages = [ pkgs.gnome.gnome-settings-daemon ];
141-
142- # # https://nixos.wiki/wiki/NixOS_Wiki:Audio
143- # services.pulseaudio.enable = false; # Use Pipewire, the modern sound subsystem
144-
145- # security.rtkit.enable = true; # Enable RealtimeKit for audio purposes
146-
147- # services.pipewire = {
148- # enable = true;
149- # alsa.enable = true;
150- # alsa.support32Bit = true;
151- # pulse.enable = true;
152- # # Uncomment the following line if you want to use JACK applications
153- # # jack.enable = true;
154- # };
122+ systemd . services . systemd-udev-settle . enable = false ;
155123
156124 services . openssh . enable = true ;
157125 programs . ssh . extraConfig = ''
164132 services . lldpd . enable = true ;
165133 services . timesyncd . enable = true ;
166134 services . fstrim . enable = true ;
135+
167136 services . avahi = {
168137 enable = true ;
169138 nssmdns4 = true ;
172141 openFirewall = true ;
173142 } ;
174143
175- services . bpftune . enable = true ;
176- # Enable touchpad support (enabled default in most desktopManager).
177- # services.libinput.enable = true;
178-
179- # https://nixos.wiki/wiki/Printing
180- #services.printing.enable = true;
181-
182- # https://wiki.nixos.org/wiki/Flameshot
183- # services.flameshot = {
184- # enable = true;
185- # settings.General = {
186- # showStartupLaunchMessage = false;
187- # saveLastRegion = true;
188- # };
189- # };
190-
191- systemd . services . modem-manager . enable = false ;
192- systemd . services . "dbus-org.freedesktop.ModemManager1" . enable = false ;
193-
194- services . clickhouse . enable = false ;
195-
196144 # environment.variables defined in hardware-graphics.nix
197145 environment . sessionVariables = {
198146 TERM = "xterm-256color" ;
211159 ] ;
212160 } ;
213161
214- # package moved to systemPackages.nix
215- # environment.systemPackages = with pkgs; [
216-
217- # Some programs need SUID wrappers, can be configured further or are
218- # started in user sessions.
219- # programs.mtr.enable = true;
220-
221162 programs . gnupg . agent = {
222163 enable = true ;
223164 enableSSHSupport = true ;
224165 } ;
225166
226- # hardware.graphics = {
227- # enable = true; # auto includes mesa
228- # package = pkgs.mesa;
229- # extraPackages = with pkgs; [
230- # libglvnd
231- # libva-vdpau-driver
232- # libvdpau-va-gl
233- # rocmPackages.clr.icd
234- # ];
235- # };
236- # services.xserver = {
237- # enable = true;
238- # videoDrivers = [ "amdgpu" ];
239- # xkb = {
240- # layout = "us";
241- # variant = "";
242- # };
243- # };
244-
245- # services.desktopManager.gnome.enable = true;
246- # services.displayManager.gdm.enable = true;
247-
248- # # https://nixos.wiki/wiki/AMD_GPU
249- # systemd.tmpfiles.rules = [
250- # "L+ /opt/rocm/hip - - - - ${pkgs.rocmPackages.clr}"
251- # ];
252- # systemd.services.lactd.wantedBy = [ "multi-user.target" ];
253-
254- # xdg.portal = {
255- # enable = true;
256- # extraPortals = with pkgs; [ xdg-desktop-portal-gtk ];
257- # config.common.default = "gtk";
258- # };
259-
260- # # https://wiki.hyprland.org/Nix/Hyprland-on-NixOS/
261- # programs.hyprland = {
262- # enable = true;
263- # xwayland.enable = true;
264- # };
265-
266- # Open ports in the firewall.
267- # networking.firewall.allowedTCPPorts = [ ... ];
268- # networking.firewall.allowedUDPPorts = [ ... ];
269- # Or disable the firewall altogether.
270- # networking.firewall.enable = false;
271-
272- # # https://nixos.wiki/wiki/Podman
273- # virtualisation.podman = {
274- # enable = true;
275- # dockerCompat = true;
276- # defaultNetwork.settings.dns_enabled = true;
277- # autoPrune.enable = true;
278- # };
279- # #virtualisation.oci-containers.backend = "podman";
280- # # virtualisation.oci-containers.containers = {
281- # # container-name = {
282- # # image = "container-image";
283- # # autoStart = true;
284- # # ports = [ "127.0.0.1:1234:1234" ];
285- # # };
286- # # };
287-
288167 # https://nixos.wiki/wiki/Virt-manager
289168 virtualisation . libvirtd . enable = true ;
290169 #programs.virt-manager.enable = true;
307186 } ;
308187
309188}
189+
190+ # end
0 commit comments