|
1 | 1 | # Edit this configuration file to define what should be installed on |
2 | 2 | # your system. Help is available in the configuration.nix(5) man page |
3 | | -# and in the NixOS manual (accessible by running ‘nixos-help’). |
| 3 | +# and in the NixOS manual (accessible by running 'nixos-help'). |
4 | 4 |
|
5 | 5 | # sudo nixos-rebuild switch |
6 | 6 | # sudo nix-channel --update |
|
46 | 46 | ]; |
47 | 47 |
|
48 | 48 | boot = { |
49 | | - |
50 | 49 | loader.systemd-boot = { |
51 | 50 | enable = true; |
52 | 51 | consoleMode = "max"; |
|
63 | 62 |
|
64 | 63 | # https://github.com/tolgaerok/nixos-2405-gnome/blob/main/core/boot/efi/efi.nix#L56C5-L56C21 |
65 | 64 | kernelParams = [ |
66 | | - #"nvidia-drm.modeset=1" |
67 | | - #"nvidia-drm.fbdev=1" |
| 65 | + "nvidia-drm.modeset=1" |
| 66 | + "nvidia-drm.fbdev=1" |
68 | 67 | # https://www.reddit.com/r/NixOS/comments/u5l3ya/cant_start_x_in_nixos/?rdt=56160 |
69 | 68 | #"nomodeset" |
70 | 69 | ]; |
|
78 | 77 | # https://nixos.org/manual/nixos/stable/options#opt-boot.binfmt.emulatedSystems |
79 | 78 | binfmt.emulatedSystems = [ "aarch64-linux" "riscv64-linux" ]; |
80 | 79 |
|
81 | | - extraModulePackages = with config.boot.kernelPackages; [ |
82 | | - v4l2loopback |
83 | | - #nvidia_x11 |
| 80 | + extraModulePackages = [ |
| 81 | + config.boot.kernelPackages.v4l2loopback |
| 82 | + pkgs.unstable.linuxPackages.nvidiaPackages.production |
84 | 83 | ]; |
85 | 84 |
|
86 | | - # https://nixos.wiki/wiki/Libvirt#Nested_virtualization |
87 | | - #extraModprobeConfig = "options kvm_intel nested=1"; |
88 | | - # https://gist.github.com/chrisheib/162c8cad466638f568f0fb7e5a6f4f6b#file-config_working-nix-L19 |
89 | | - extraModprobeConfig = |
90 | | - "options nvidia " |
91 | | - #"" |
92 | | - + lib.concatStringsSep " " [ |
93 | | - # nvidia assume that by default your CPU does not support PAT, |
94 | | - # but this is effectively never the case in 2023 |
95 | | - "NVreg_UsePageAttributeTable=1" |
96 | | - # This is sometimes needed for ddc/ci support, see |
97 | | - # https://www.ddcutil.com/nvidia/ |
98 | | - # |
99 | | - # Current monitor does not support it, but this is useful for |
100 | | - # the future |
101 | | - "NVreg_RegistryDwords=RMUseSwI2c=0x01;RMI2cSpeed=100" |
102 | | - "options kvm_intel nested=1" |
103 | | - # # https://nixos.wiki/wiki/OBS_Studio |
104 | | - '' |
105 | | - options v4l2loopback devices=1 video_nr=1 card_label="OBS Cam" exclusive_caps=1 |
106 | | - '' |
107 | | - ]; |
| 85 | + extraModprobeConfig = '' |
| 86 | + options nvidia NVreg_UsePageAttributeTable=1 |
| 87 | + options nvidia NVreg_RegistryDwords=RMUseSwI2c=0x01;RMI2cSpeed=100 |
| 88 | + options kvm_intel nested=1 |
| 89 | + options v4l2loopback devices=1 video_nr=1 card_label="OBS Cam" exclusive_caps=1 |
| 90 | + ''; |
108 | 91 | }; |
109 | 92 |
|
110 | 93 | # For OBS |
111 | 94 | security.polkit.enable = true; |
112 | 95 |
|
113 | 96 | nix = { |
114 | | - gc = { |
115 | | - automatic = true; # Enable automatic execution of the task |
116 | | - dates = "weekly"; # Schedule the task to run weekly |
117 | | - options = "--delete-older-than 10d"; # Specify options for the task: delete files older than 10 days |
118 | | - randomizedDelaySec = "14m"; # Introduce a randomized delay of up to 14 minutes before executing the task |
119 | | - }; |
120 | 97 | settings = { |
121 | 98 | auto-optimise-store = true; |
122 | 99 | experimental-features = [ "nix-command" "flakes" ]; |
123 | 100 | download-buffer-size = "500000000"; |
124 | 101 | }; |
| 102 | + gc = { |
| 103 | + automatic = true; # Enable automatic execution of the task |
| 104 | + dates = "daily"; # Schedule the task to run daily |
| 105 | + options = "--delete-older-than 10d"; # Specify options for the task: delete files older than 10 days |
| 106 | + randomizedDelaySec = "14m"; # Introduce a randomized delay of up to 14 minutes before executing the task |
| 107 | + }; |
125 | 108 | }; |
126 | 109 |
|
127 | 110 | # https://nixos.wiki/wiki/Networking |
|
280 | 263 |
|
281 | 264 | # This value determines the NixOS release from which the default |
282 | 265 | # settings for stateful data, like file locations and database versions |
283 | | - # on your system were taken. It‘s perfectly fine and recommended to leave |
| 266 | + # on your system were taken. It's perfectly fine and recommended to leave |
284 | 267 | # this value at the release version of the first install of this system. |
285 | 268 | # Before changing this value read the documentation for this option |
286 | 269 | # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). |
|
290 | 273 |
|
291 | 274 | nixpkgs.config = { |
292 | 275 | allowUnfree = true; |
293 | | - allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [ |
294 | | - "nvidia-x11" |
295 | | - "nvidia-settings" |
296 | | - "nvidia-persistenced" |
297 | | - ]; |
| 276 | + # allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [ |
| 277 | + # "nvidia-x11" |
| 278 | + # "nvidia-settings" |
| 279 | + # "nvidia-persistenced" |
| 280 | + # ]; |
298 | 281 | }; |
| 282 | + |
| 283 | + # hardware.opengl = { |
| 284 | + # enable = true; |
| 285 | + # driSupport = true; |
| 286 | + # driSupport32Bit = true; |
| 287 | + # extraPackages = with pkgs; [ |
| 288 | + # vaapiVdpau |
| 289 | + # libvdpau-va-gl |
| 290 | + # ]; |
| 291 | + # }; |
299 | 292 | } |
0 commit comments