authorgravatar for nmarks413@gmail.comNatalie Marks <nmarks413@gmail.com> 2025-04-18 15:55:34-07:00
committergravatar for nmarks413@gmail.comNatalie Marks <nmarks413@gmail.com> 2025-04-18 15:55:34-07:00
log1c313955d56b5bbebc81411969d2727ea1e51ed5
treed0b4993741fff1041996772048d0454d9cc4c169
parent51df904a8171d871ed988399647f3b0037645c0c
signature Commit is signed but in an unrecognized format.

start modularizing things


24 files changed, 413 insertions(+), 218 deletions(-)

.DS_Store created
Binary files /dev/null and b/.DS_Store differ
flake.lock+30-9
......@@ -668,23 +668,43 @@
668668 "type": "github"
669669 }
670670 },
671 "nh_darwin": {
671 "nh": {
672672 "inputs": {
673673 "nixpkgs": [
674674 "nixpkgs"
675675 ]
676676 },
677677 "locked": {
678 "lastModified": 1739410909,
679 "narHash": "sha256-wx0oBgnmh6K8PJGyASLAErnrIe8/1hZthVrkfoX+j/E=",
680 "owner": "ToyVo",
681 "repo": "nh_darwin",
682 "rev": "10c8d19efd0ed9f63708d1179468fbb2f2bd7f4e",
678 "lastModified": 1743682999,
679 "narHash": "sha256-bg+aAN8K90r3m/I+xXiXG0gawpbkshwlk93wxUN7KEk=",
680 "owner": "viperML",
681 "repo": "nh",
682 "rev": "9e9a4590b38b62b28f07a1fae973ce7b6ca0687a",
683683 "type": "github"
684684 },
685685 "original": {
686 "owner": "ToyVo",
687 "repo": "nh_darwin",
686 "owner": "viperML",
687 "repo": "nh",
688 "type": "github"
689 }
690 },
691 "nix-index-database": {
692 "inputs": {
693 "nixpkgs": [
694 "nixpkgs"
695 ]
696 },
697 "locked": {
698 "lastModified": 1744518957,
699 "narHash": "sha256-RLBSWQfTL0v+7uyskC5kP6slLK1jvIuhaAh8QvB75m4=",
700 "owner": "nix-community",
701 "repo": "nix-index-database",
702 "rev": "4fc9ea78c962904f4ea11046f3db37c62e8a02fd",
703 "type": "github"
704 },
705 "original": {
706 "owner": "nix-community",
707 "repo": "nix-index-database",
688708 "type": "github"
689709 }
690710 },
......@@ -920,7 +940,8 @@
920940 "hyprland": "hyprland",
921941 "hyprland-plugins": "hyprland-plugins",
922942 "moonlight": "moonlight",
923 "nh_darwin": "nh_darwin",
943 "nh": "nh",
944 "nix-index-database": "nix-index-database",
924945 "nix-options-search": "nix-options-search",
925946 "nixos-cosmic": "nixos-cosmic",
926947 "nixpkgs": "nixpkgs_5",
flake.nix+43-57
......@@ -33,8 +33,6 @@
3333 zig.url = "github:mitchellh/zig-overlay";
3434 zls.url = "github:zigtools/zls?rev=a26718049a8657d4da04c331aeced1697bc7652b";
3535
36 # foundryvtt.url = "github:reckenrode/nix-foundryvtt";
37
3836 moonlight = {
3937 url = "github:moonlight-mod/moonlight"; # Add `/develop` to the flake URL to use nightly.
4038 inputs.nixpkgs.follows = "nixpkgs";
......@@ -44,90 +42,78 @@
4442 inputs.nixpkgs.follows = "nixpkgs";
4543 };
4644
47 nh_darwin = {
48 url = "github:ToyVo/nh_darwin";
45 nh = {
46 url = "github:viperML/nh";
4947 inputs.nixpkgs.follows = "nixpkgs";
5048 };
5149 nix-options-search = {
5250 url = "github:madsbv/nix-options-search";
5351 };
5452
53 nix-index-database.url = "github:nix-community/nix-index-database";
54 nix-index-database.inputs.nixpkgs.follows = "nixpkgs";
55
5556 chinese-fonts-overlay = {
5657 url = "github:brsvh/chinese-fonts-overlay/main";
5758 inputs.nixpkgs.follows = "nixpkgs";
5859 };
5960 };
60 outputs = {
61 self,
61 outputs = inputs @ {
6262 nixpkgs,
63 nixpkgs-stable,
64 nix-options-search,
65 home-manager,
66 darwin,
67 hosts,
68 hyprland-plugins,
69 zig,
70 zls,
7163 nixos-cosmic,
72 nh_darwin,
64 nix-index-database,
65 darwin,
7366 ...
74 } @ inputs: let
67 }: let
7568 overlays = [
7669 inputs.zig.overlays.default
7770 inputs.rust-overlay.overlays.default
7871 inputs.chinese-fonts-overlay.overlays.default
72 inputs.nh.overlays.default
7973 ];
8074 inherit (nixpkgs) lib;
75 mkIfElse = p: yes: no:
76 lib.mkMerge [
77 (lib.mkIf p yes)
78 (lib.mkIf (!p) no)
79 ];
80
81 user = "nmarks";
82
83 shared_modules = [
84 # {nixpkgs.overlays = overlays;}
85 # {programs.nix-index-database.comma.enable = true;}
86 # nixindex
87 # homemanagerModules
88 {
89 _module.args = {
90 inherit user;
91 inherit mkIfElse;
92 };
93 }
94 ];
8195 in {
8296 nixosConfigurations = {
8397 nixos = lib.nixosSystem {
84 modules = [
85 {nixpkgs.overlays = overlays;}
86 hosts.nixosModule
87 {
88 networking.stevenBlackHosts.enable = true;
89 }
90 ./hosts/desktop/configuration.nix
91 home-manager.nixosModules.home-manager
92 {
93 home-manager = {
94 backupFileExtension = "hm-backup";
95 useGlobalPkgs = true;
96 useUserPackages = true;
97 users.nmarks = import ./hosts/desktop/home.nix;
98 };
99 home-manager.extraSpecialArgs = {
100 inherit hyprland-plugins;
101 inherit zls;
102 };
103 }
104 nixos-cosmic.nixosModules.default
105 ];
98 system = "x86_64-linux";
99 modules =
100 [
101 ./hosts/desktop/configuration.nix
102 nixos-cosmic.nixosModules.default
103 ]
104 ++ shared_modules;
106105 specialArgs = inputs;
107106 };
108107 };
109108 darwinConfigurations = {
110109 "Natalies-MacBook-Air" = darwin.lib.darwinSystem {
111110 system = "aarch64-darwin";
112 modules = [
113 {nixpkgs.overlays = overlays;}
114 ./hosts/laptop/configuration.nix
115 home-manager.darwinModules.home-manager
116 {
117 home-manager = {
118 useGlobalPkgs = true;
119 useUserPackages = true;
120 users.nmarks = import ./hosts/laptop/home.nix;
121 };
122 home-manager.extraSpecialArgs = {
123 inherit zls;
124 };
125 users.users.nmarks.home = "/Users/nmarks";
126 }
127 ];
128 specialArgs = {
129 inherit inputs;
130 };
111 specialArgs = inputs;
112 modules =
113 [
114 ./hosts/laptop/configuration.nix
115 ]
116 ++ shared_modules;
131117 };
132118 };
133119 };
hosts/.DS_Store created
Binary files /dev/null and b/hosts/.DS_Store differ
hosts/desktop/configuration.nix+7-116
......@@ -1,6 +1,3 @@
1#<BS> 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’).
41{
52 self,
63 inputs,
......@@ -8,8 +5,14 @@
85 pkgs,
96 ...
107}: {
11 nixpkgs.config.allowUnfree = true;
8 imports = [
9 # Include the results of the hardware scan.
10 ./hardware-configuration.nix
1211
12 ../../modules/shared/nix.nix
13 ../../modules/nixos/nvidia.nix
14 ../../modules/nixos/boot.ni
15 ];
1316 services.avahi = {
1417 enable = true;
1518 nssmdns4 = true;
......@@ -51,22 +54,6 @@
5154
5255 nix.settings.trusted-users = ["root" "nmarks"];
5356
54 nix.settings.experimental-features = ["nix-command" "flakes"];
55 nix.settings = {
56 substituters = [
57 "https://cache.nixos.org/"
58 "https://nix-community.cachix.org"
59 "https://cosmic.cachix.org/"
60 "https://cache.iog.io"
61 "https://cuda-maintainers.cachix.org"
62 ];
63 trusted-public-keys = [
64 "cuda-maintainers.cachix.org-1:0dq3bujKpuEPMCX6U4WylrUDZ9JyUG0VpVZa7CNfq5E="
65 "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
66 "cosmic.cachix.org-1:Dya9IyXD4xdBehWjrkPv6rtxpmMdRel02smYzA85dPE="
67 "hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ="
68 ];
69 };
7057 programs.hyprland.enable = true;
7158
7259 programs.fish.enable = true;
......@@ -109,89 +96,6 @@
10996 nerd-fonts.iosevka
11097 ];
11198
112 imports = [
113 # Include the results of the hardware scan.
114 ./hardware-configuration.nix
115 # inputs.foundryvtt.nixosModules.foundryvtt
116 ];
117
118 # Enable OpenGL
119 hardware.graphics = {
120 enable = true;
121 };
122 services.xserver.videoDrivers = ["nvidia"];
123
124 hardware.nvidia-container-toolkit.enable = true;
125 hardware.nvidia = {
126 forceFullCompositionPipeline = true;
127 # Modesetting is required.
128 modesetting.enable = true;
129
130 # Nvidia power management. Experimental, and can cause sleep/suspend to fail.
131 powerManagement.enable = false;
132 # Fine-grained power management. Turns off GPU when not in use.
133 # Experimental and only works on modern Nvidia GPUs (Turing or newer).
134 powerManagement.finegrained = false;
135
136 # Use the NVidia open source kernel module (not to be confused with the
137 # independent third-party "nouveau" open source driver).
138 # Support is limited to the Turing and later architectures. Full list of
139 # supported GPUs is at:
140 # https://github.com/NVIDIA/open-gpu-kernel-modules#compatible-gpus
141 # Only available from driver 515.43.04+
142 # Currently alpha-quality/buggy, so false is currently the recommended setting.
143 open = false;
144
145 # Enable the Nvidia settings menu,
146 # accessible via `nvidia-settings`.
147 nvidiaSettings = true;
148
149 # Optionally, you may need to select the appropriate driver version for your specific GPU.
150 package = config.boot.kernelPackages.nvidiaPackages.latest;
151 #Fixes a glitch
152 nvidiaPersistenced = true;
153
154 #Required for amdgpu and nvidia gpu pairings
155 # modesetting.enable = true;
156
157 prime = {
158 # offload.enable = true;
159 #sync.enable = true;
160
161 amdgpuBusId = "PCI:0f:00.0";
162
163 nvidiaBusId = "PCI:01:00.0";
164 };
165 };
166 # Bootloader.
167 #boot.loader.systemd-boot.enable = true;
168 #boot.loader.efi.canTouchEfiVariables = true;
169
170 boot.kernelPackages = pkgs.linuxPackages_latest;
171
172 boot.loader = {
173 # systemd-boot.enable = true;
174 efi = {
175 canTouchEfiVariables = true;
176 # assuming /boot is the mount point of the EFI partition in NixOS (as the installation section recommends).
177 efiSysMountPoint = "/boot/efi";
178 };
179 grub = {
180 enable = true;
181 device = "nodev";
182 theme = pkgs.catppuccin-grub;
183 useOSProber = true;
184 efiSupport = true;
185 };
186 };
187
188 boot.supportedFilesystems = ["ntfs"];
189 # Configure network proxy if necessary
190 # networking.proxy.default = "http://user:password@proxy:port/";
191 # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
192
193 # Enable networking
194
19599 # Set your time zone.
196100 time.timeZone = "America/Los_Angeles";
197101
......@@ -340,19 +244,6 @@
340244 networkmanager.enable = true;
341245 firewall = {
342246 allowedTCPPorts = [22 80 443];
343 #KDE Connect
344 # allowedTCPPortRanges = [
345 # {
346 # from = 1714;
347 # to = 1764;
348 # }
349 # ];
350 # allowedUDPPortRanges = [
351 # {
352 # from = 1714;
353 # to = 1764;
354 # }
355 # ];
356247 enable = true;
357248 };
358249 interfaces.enp11s0.wakeOnLan = {
hosts/laptop/.DS_Store created
Binary files /dev/null and b/hosts/laptop/.DS_Store differ
hosts/laptop/configuration.nix+15-10
......@@ -1,27 +1,32 @@
11{
22 config,
33 pkgs,
4 lib,
45 ...
56}: {
7 imports = [
8 ../../modules/shared/nix.nix
9 ./modules/icons.nix
10 ];
11
612 environment.systemPackages = with pkgs; [
7 home-manager
813 neovim
914 pinentry_mac
1015 ];
1116
12 nixpkgs.config.allowUnfree = true;
17 environment.customIcons = {
18 enable = true;
19 icons = [
20 {
21 path = "/Applications/Zen.app";
22 icon = "/Users/nmarks/.dotfiles/icons/Zen_icons/firefox.icns";
23 }
24 ];
25 };
1326
1427 # Use a custom configuration.nix location.
1528 #environment.darwinConfig = "$HOME/.dotfiles/hosts/laptop";
1629
17 # Auto upgrade nix package and the daemon service.
18 nix = {
19 package = pkgs.nix;
20 settings = {
21 "extra-experimental-features" = ["nix-command" "flakes"];
22 };
23 };
24
2530 # Create /etc/zshrc that loads the nix-darwin environment.
2631 programs = {
2732 gnupg.agent.enable = true;
hosts/laptop/home.nix+22-23
......@@ -1,36 +1,35 @@
11{
2 inputs,
32 config,
43 pkgs,
54 lib,
6 ghostty,
7 moonlight,
85 ...
96}: {
10 # Home Manager needs a bit of information about you and the paths it should
11 # manage.
12 # This value determines the Home Manager release that your configuration is
13 # compatible with. This helps avoid breakage when a new Home Manager release
14 # introduces backwards incompatible changes.
15 #
16 # You should not change this value, even if you update Home Manager. If you do
17 # want to update the value, then make sure to first check the Home Manager
18 # release notes.
19 home.stateVersion = "23.05"; # Please read the comment before changing.
7 programs = import ../shared/home-programs.nix {inherit config pkgs lib;};
208
21 home.packages = pkgs.callPackage ../shared/packages.nix {};
9 home = {
10 # Home Manager needs a bit of information about you and the paths it should
11 # manage.
12 # This value determines the Home Manager release that your configuration is
13 # compatible with. This helps avoid breakage when a new Home Manager release
14 # introduces backwards incompatible changes.
15 #
16 # You should not change this value, even if you update Home Manager. If you do
17 # want to update the value, then make sure to first check the Home Manager
18 # release notes.
19 stateVersion = "23.05"; # Please read the comment before changing.
2220
23 programs = import ../shared/home-programs.nix {inherit config pkgs lib;};
21 packages = pkgs.callPackage ../shared/packages.nix {};
2422
25 home.sessionVariables = {
26 EDITOR = "nvim";
27 VISUAL = "nvim";
28 TERMINAL = "ghostty";
29 BROWSER = "firefox";
23 sessionVariables = {
24 EDITOR = "nvim";
25 VISUAL = "nvim";
26 TERMINAL = "ghostty";
27 BROWSER = "firefox";
28 };
29 sessionPath = [
30 "$HOME/.emacs.d/bin"
31 ];
3032 };
31 home.sessionPath = [
32 "$HOME/.emacs.d/bin"
33 ];
3433
3534 # Let Home Manager install and manage itself.
3635}
hosts/laptop/icons/.DS_Store created
Binary files /dev/null and b/hosts/laptop/icons/.DS_Store differ
hosts/laptop/icons/Zen_icons/Zen Browser - Dark Mono.icns created
Binary files /dev/null and b/hosts/laptop/icons/Zen_icons/Zen Browser - Dark Mono.icns differ
hosts/laptop/icons/Zen_icons/Zen Browser - Dark.icns created
Binary files /dev/null and b/hosts/laptop/icons/Zen_icons/Zen Browser - Dark.icns differ
hosts/laptop/icons/Zen_icons/Zen Browser - Inverted.icns created
Binary files /dev/null and b/hosts/laptop/icons/Zen_icons/Zen Browser - Inverted.icns differ
hosts/laptop/icons/Zen_icons/Zen Browser - Light Mono.icns created
Binary files /dev/null and b/hosts/laptop/icons/Zen_icons/Zen Browser - Light Mono.icns differ
hosts/laptop/icons/Zen_icons/Zen Browser - Light.icns created
Binary files /dev/null and b/hosts/laptop/icons/Zen_icons/Zen Browser - Light.icns differ
hosts/laptop/icons/Zen_icons/firefox.icns created
Binary files /dev/null and b/hosts/laptop/icons/Zen_icons/firefox.icns differ
hosts/laptop/modules/icons.nix created+61
......@@ -0,0 +1,61 @@
1{
2 lib,
3 config,
4 ...
5}: let
6 cfg = config.environment.customIcons;
7 inherit
8 (lib)
9 mkEnableOption
10 mkIf
11 mkMerge
12 mkOption
13 types
14 ;
15in {
16 options.environment.customIcons = {
17 enable = mkEnableOption "environment.customIcons";
18 clearCacheOnActivation = mkEnableOption "environment.customIcons.clearCacheOnActivation";
19
20 icons = mkOption {
21 type = types.listOf (
22 types.submodule {
23 options = {
24 path = mkOption {type = types.path;};
25 icon = mkOption {type = types.path;};
26 };
27 }
28 );
29 };
30 };
31
32 config = mkMerge [
33 (mkIf cfg.enable {
34 system.activationScripts.extraActivation.text = ''
35 echo -e "applying custom icons..."
36
37 ${
38 (builtins.concatStringsSep "\n\n" (
39 builtins.map (iconCfg: ''
40 osascript <<EOF >/dev/null
41 use framework "Cocoa"
42
43 set iconPath to "${iconCfg.icon}"
44 set destPath to "${iconCfg.path}"
45
46 set imageData to (current application's NSImage's alloc()'s initWithContentsOfFile:iconPath)
47 (current application's NSWorkspace's sharedWorkspace()'s setIcon:imageData forFile:destPath options:2)
48 EOF
49 '')
50 cfg.icons
51 ))
52 }
53
54 ${lib.optionalString cfg.clearCacheOnActivation ''
55 sudo rm -rf /Library/Caches/com.apple.iconservices.store
56 sudo find /private/var/folders/ -name com.apple.dock.iconcache -or -name com.apple.iconservices -or -name com.apple.iconservicesagent -exec rm -rf {} \; || true
57 killall Dock
58 ''}'';
59 })
60 ];
61}
hosts/shared/home-programs.nix+23-1
......@@ -26,6 +26,25 @@
2626 bold_font auto";
2727 };
2828
29 bat = {
30 enable = true;
31 extraPackages = with pkgs.bat-extras; [batdiff batman batgrep batwatch batpipe prettybat];
32 config = {
33 theme = "catpuccin";
34 };
35 themes = {
36 catpuccin = {
37 src = pkgs.fetchFromGitHub {
38 owner = "catppuccin";
39 repo = "bat";
40 hash = "sha256-6fWoCH90IGumAMc4buLRWL0N61op+AuMNN9CAR9/OdI=";
41 rev = "699f60fc8ec434574ca7451b444b880430319941";
42 };
43 file = "themes/Catppuccin Mocha.tmTheme";
44 };
45 };
46 };
47
2948 hyfetch = {
3049 enable = true;
3150 settings = {
......@@ -63,7 +82,10 @@
6382 shellAliases = {
6483 reboot-windows = "sudo efibootmgr --bootnext 0000; sudo reboot -h now";
6584 };
66 shellInit = "test -r '/Users/nmarks/.opam/opam-init/init.fish' && source '/Users/nmarks/.opam/opam-init/init.fish' > /dev/null 2> /dev/null; or true";
85 shellInit = ''
86 test -r '/Users/nmarks/.opam/opam-init/init.fish' && source '/Users/nmarks/.opam/opam-init/init.fish' > /dev/null 2> /dev/null; or true
87 batman --export-env | source
88 '';
6789 };
6890 home-manager.enable = true;
6991}
hosts/shared/packages.nix-2
......@@ -32,7 +32,6 @@ with pkgs; [
3232 #nix tools
3333 cachix
3434 direnv
35 comma
3635 nh
3736
3837 #terminal stuff
......@@ -44,7 +43,6 @@ with pkgs; [
4443 neofetch
4544 hyfetch
4645 fastfetch
47 bat
4846 eza
4947 ollama
5048 uv
modules/nixos/boot.nix created+33
......@@ -0,0 +1,33 @@
1{pkgs, ...}: {
2 boot = {
3 kernelPackages = pkgs.linuxPackages_latest; # _zen, _hardened, _rt, _rt_latest, etc.
4 loader = {
5 efi = {
6 canTouchEfiVariables = true;
7 # assuming /boot is the mount point of the EFI partition in NixOS (as the installation section recommends).
8 efiSysMountPoint = "/boot/efi";
9 };
10 grub = {
11 enable = true;
12 device = "nodev";
13 theme = pkgs.catppuccin-grub;
14 useOSProber = true;
15 efiSupport = true;
16 };
17 };
18
19 #this is set to false by default for some reason
20 tmp.cleanOnBoot = true;
21
22 # Make boot screen quiet
23 kernelParams = [
24 "quiet"
25 "splash"
26 "rd.systemd.show_status=auto"
27 "rd.udev.log_level=3"
28 "udev.log_priority=3"
29 ];
30 consoleLogLevel = 0;
31 initrd.verbose = false;
32 };
33}
modules/nixos/nvidia.nix created+95
......@@ -0,0 +1,95 @@
1{
2 lib,
3 pkgs,
4 config,
5 ...
6}: let
7 nvidiaDriverChannel = config.boot.kernelPackages.nvidiaPackages.latest;
8in {
9 services.xserver.videoDrivers = ["nvidia"];
10
11 nixpkgs.config = {
12 nvidia.acceptLicense = true;
13 allowUnfree = true;
14 };
15 # Kernel parameters for better Wayland and Hyprland integration
16 boot.kernelParams = [
17 "nvidia-drm.modeset=1" # Enable mode setting for Wayland
18 "nvidia.NVreg_PreserveVideoMemoryAllocations=1" # Improves resume after sleep
19 ];
20
21 # Blacklist nouveau to avoid conflicts
22 boot.blacklistedKernelModules = ["nouveau"];
23
24 hardware = {
25 nvidia = {
26 forceFullCompositionPipeline = true; # Prevents screen tearing
27 # Modesetting is required.
28 modesetting.enable = true;
29
30 powerManagement = {
31 enable = true; # Power management
32 finegrained = true; # More precise power consumption control
33 };
34
35 # Use the NVidia open source kernel module (not to be confused with the
36 # independent third-party "nouveau" open source driver).
37 # Currently alpha-quality/buggy, so false is currently the recommended setting.
38 open = false;
39
40 # Environment variables for better compatibility
41 environment.variables = {
42 LIBVA_DRIVER_NAME = "nvidia"; # Hardware video acceleration
43 XDG_SESSION_TYPE = "wayland"; # Force Wayland
44 GBM_BACKEND = "nvidia-drm"; # Graphics backend for Wayland
45 __GLX_VENDOR_LIBRARY_NAME = "nvidia"; # Use Nvidia driver for GLX
46 WLR_NO_HARDWARE_CURSORS = "1"; # Fix for cursors on Wayland
47 NIXOS_OZONE_WL = "1"; # Wayland support for Electron apps
48 __GL_GSYNC_ALLOWED = "1"; # Enable G-Sync if available
49 __GL_VRR_ALLOWED = "1"; # Enable VRR (Variable Refresh Rate)
50 WLR_DRM_NO_ATOMIC = "1"; # Fix for some issues with Hyprland
51 NVD_BACKEND = "direct"; # Configuration for new driver
52 MOZ_ENABLE_WAYLAND = "1"; # Wayland support for Firefox
53 };
54
55 # Enable the Nvidia settings menu,
56 # accessible via `nvidia-settings`.
57 nvidiaSettings = true;
58
59 package = nvidiaDriverChannel;
60
61 #Fixes a glitch
62 nvidiaPersistenced = true;
63 };
64 nvidia-container-toolkit.enable = true;
65
66 graphics = {
67 enable = true;
68 package = nvidiaDriverChannel;
69 enable32Bit = true;
70 extraPackages = with pkgs; [
71 nvidia-vaapi-driver
72 vaapiVdpau
73 libvdpau-va-gl
74 mesa
75 egl-wayland
76 vulkan-loader
77 vulkan-validation-layers
78 libva
79 ];
80 };
81 };
82
83 nix.settings = {
84 substituters = ["https://cuda-maintainers.cachix.org"];
85 trusted-public-keys = [
86 "cuda-maintainers.cachix.org-1:0dq3bujKpuEPMCX6U4WylrUDZ9JyUG0VpVZa7CNfq5E="
87 ];
88 };
89
90 environment.systemPackages = with pkgs; [
91 vulkan-tools
92 glxinfo
93 libva-utils # VA-API debugging tools
94 ];
95}
modules/shared/extras.nix created+14
......@@ -0,0 +1,14 @@
1{
2 pkgs,
3 config,
4 inputs,
5 hostName,
6 mkIfElse,
7 darwin,
8 ...
9}: {
10 networking = {
11 inherit hostName;
12 networkmanager = !darwin;
13 };
14}
modules/shared/home-manager.nix created+8
......@@ -0,0 +1,8 @@
1{inputs, ...}: {
2 home-manager = {
3 useGlobalPkgs = true;
4 useUserPackages = true;
5 backupFileExtension = "hm-backup";
6 extraSpecialArgs = {inherit inputs;};
7 };
8}
modules/shared/nix.nix created+39
......@@ -0,0 +1,39 @@
1{
2 config,
3 inputs,
4 ...
5}: {
6 nixpkgs.config = {
7 allowUnfree = true;
8 };
9
10 nix = {
11 nixPath = ["nixpkgs = ${inputs.nixpkgs}"];
12 extraOptions = ''
13 warn-dirty = false
14 '';
15
16 settings = {
17 auto-optimise-store = true;
18 experimental-features = ["nix-command" "flakes"];
19 substituters = [
20 "https://cache.nixos.org/?priority=10"
21
22 "https://nix-community.cachix.org"
23 "https://cosmic.cachix.org/"
24 "https://cache.iog.io"
25 ];
26 trusted-public-keys = [
27 "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
28 "cosmic.cachix.org-1:Dya9IyXD4xdBehWjrkPv6rtxpmMdRel02smYzA85dPE="
29 "hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ="
30 ];
31 };
32 gc = {
33 automatic = true;
34 persistent = true;
35 dates = "weekly";
36 options = "--delete-older-than 7d";
37 };
38 };
39}
modules/shared/vars.nix created+23
......@@ -0,0 +1,23 @@
1{
2 inputs,
3 pkgs,
4 config,
5 lib,
6 mkIfElse,
7 ...
8}: let
9 darwin = pkgs.stdenv.isDarwin;
10 homemanagerModules = mkIfElse darwin inputs.home-manager.darwinModules inputs.home-manager.nixosModules;
11 nixindex = mkIfElse darwin inputs.nix-index-database.darwinModules.nix-index inputs.nix-index-database.nixosModules.nix-index;
12in {
13 config.var = {
14 inherit darwin homemanagerModules nixindex;
15 };
16
17 options = {
18 var = lib.mkOption {
19 type = lib.types.attrs;
20 default = {};
21 };
22 };
23}