From 9ba38635df9f3c33004cdb4d7fac55e3cc3d4d6a Mon Sep 17 00:00:00 2001 From: steven carpenter Date: Mon, 1 Sep 2025 16:20:13 -0400 Subject: [PATCH] got nvidia propritary Drivers working{ --- flake.lock | 66 ++++++--------- flake.nix | 2 +- hosts/katana.nix | 103 +++++++++++++----------- modules/home-manager/home.nix | 12 ++- modules/home-manager/superfile.nix | 2 +- modules/home-manager/zsh.nix | 11 +-- modules/system/applications/default.nix | 7 ++ modules/system/applications/fnv.nix | 62 ++++++++++++++ modules/system/default.nix | 1 + 9 files changed, 170 insertions(+), 96 deletions(-) create mode 100644 modules/system/applications/default.nix create mode 100644 modules/system/applications/fnv.nix diff --git a/flake.lock b/flake.lock index 98b6d28..a31c2e1 100644 --- a/flake.lock +++ b/flake.lock @@ -153,20 +153,6 @@ "type": "github" } }, - "flake-schemas": { - "locked": { - "lastModified": 1721999734, - "narHash": "sha256-G5CxYeJVm4lcEtaO87LKzOsVnWeTcHGKbKxNamNWgOw=", - "rev": "0a5c42297d870156d9c57d8f99e476b738dcd982", - "revCount": 75, - "type": "tarball", - "url": "https://api.flakehub.com/f/pinned/DeterminateSystems/flake-schemas/0.1.5/0190ef2f-61e0-794b-ba14-e82f225e55e6/source.tar.gz" - }, - "original": { - "type": "tarball", - "url": "https://flakehub.com/f/DeterminateSystems/flake-schemas/%2A" - } - }, "gitignore": { "inputs": { "nixpkgs": [ @@ -824,16 +810,17 @@ }, "nixpkgs_10": { "locked": { - "lastModified": 1752308619, - "narHash": "sha256-pzrVLKRQNPrii06Rm09Q0i0dq3wt2t2pciT/GNq5EZQ=", - "rev": "650e572363c091045cdbc5b36b0f4c1f614d3058", - "revCount": 806273, - "type": "tarball", - "url": "https://api.flakehub.com/f/pinned/NixOS/nixpkgs/0.2505.806273%2Brev-650e572363c091045cdbc5b36b0f4c1f614d3058/019804de-4447-7b40-88ef-4e58b0e7553e/source.tar.gz" + "lastModified": 1753844155, + "narHash": "sha256-w81jpZeM3AtYlTKIhT05p3IqvJRIHZPyp0Acgb6hXWc=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "e44b8dc0882d66e2627a8ff252b04a22f4a629fd", + "type": "github" }, "original": { - "type": "tarball", - "url": "https://flakehub.com/f/NixOS/nixpkgs/%2A" + "id": "nixpkgs", + "ref": "nixpkgs-unstable", + "type": "indirect" } }, "nixpkgs_2": { @@ -1027,17 +1014,16 @@ "nixpkgs": "nixpkgs_3" }, "locked": { - "lastModified": 1751159013, - "narHash": "sha256-ROTyPZ5CxbNmCrXiQBQDyJOfEJrF2ZGExVoAcXwiEMA=", - "ref": "refs/heads/main", - "rev": "95063ba566db81a0a40e49d9ba02060a93087562", - "revCount": 65, - "type": "git", - "url": "https://git.skdevstudios.com/specCon18/sk_extract.git" + "lastModified": 1753934621, + "narHash": "sha256-figluHBPK0GxE1xJcdmYGR0qtXIDFj08Lgilo9xdBtU=", + "rev": "5fcad9436d6c2b3236979962ba283ecbd034db7a", + "revCount": 70, + "type": "tarball", + "url": "https://api.flakehub.com/f/pinned/specCon18/sk_extract/1.0.4/01985ea8-3adb-7366-b632-f42ad2214319/source.tar.gz" }, "original": { - "type": "git", - "url": "https://git.skdevstudios.com/specCon18/sk_extract.git" + "type": "tarball", + "url": "https://flakehub.com/f/specCon18/sk_extract/1.0.4" } }, "sops-nix": { @@ -1238,21 +1224,19 @@ }, "yunodo": { "inputs": { - "flake-schemas": "flake-schemas", "nixpkgs": "nixpkgs_10" }, "locked": { - "lastModified": 1752585859, - "narHash": "sha256-QQD++CqMHHzLU+FLjPgkhGfs5WwhtikarDEShyd3w3s=", - "ref": "refs/heads/main", - "rev": "9e9a9e4f1e4f909bb3d3bf32a2a80549fffa7786", - "revCount": 15, - "type": "git", - "url": "https://git.skdevstudios.com/specCon18/yunodo_redux.git" + "lastModified": 1717319278, + "narHash": "sha256-zVvNjZpriC5AO+nAzIcB0wuFbeidBtm8A78D9ZwGmKI=", + "rev": "375fe6c9827b7bce27404049102c26deaf54a250", + "revCount": 22, + "type": "tarball", + "url": "https://api.flakehub.com/f/pinned/specCon18/YUNODO/0.1.22%2Brev-375fe6c9827b7bce27404049102c26deaf54a250/018fd844-6abd-7bea-a06b-1011111afc20/source.tar.gz" }, "original": { - "type": "git", - "url": "https://git.skdevstudios.com/specCon18/yunodo_redux.git" + "type": "tarball", + "url": "https://flakehub.com/f/specCon18/YUNODO/0.1.22" } } }, diff --git a/flake.nix b/flake.nix index 2bc2897..f54eea8 100644 --- a/flake.nix +++ b/flake.nix @@ -1,5 +1,5 @@ { - description = "Nixos config flake"; + description = "My Nixos config flake"; inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixos-25.05"; diff --git a/hosts/katana.nix b/hosts/katana.nix index 912a53f..93fd8e1 100644 --- a/hosts/katana.nix +++ b/hosts/katana.nix @@ -1,11 +1,12 @@ -{ config, pkgs, lib, self,inputs, ... }: +{config, pkgs, lib, self,inputs, ... }: { system.stateVersion = "23.05"; # Hardware + hardware = { enableRedistributableFirmware = lib.mkDefault true; - cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; + cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; bluetooth = { enable = true; # enables support for Bluetooth powerOnBoot = true; # powers up the default Bluetooth controller on boot @@ -24,11 +25,10 @@ efi.canTouchEfiVariables = true; }; initrd = { - availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usb_storage" "sd_mod" ]; + availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usb_storage" "sd_mod"]; kernelModules = [ ]; }; kernelModules = [ "kvm-intel" ]; - extraModulePackages = [ ]; # Prevent tampering of the pkgstore readOnlyNixStore = true; }; @@ -53,15 +53,23 @@ networking = { hostName = "katana"; # Define your hostname. networkmanager.enable = true; #Enable Network Manager - firewall = { - checkReversePath = "loose"; - allowedTCPPorts = [ ]; - allowedUDPPorts = [ 1990 2021 ]; - extraCommands = '' - iptables -I INPUT -m pkttype --pkt-type multicast -j ACCEPT - iptables -A INPUT -m pkttype --pkt-type multicast -j ACCEPT - ''; - }; + # ┏━━━━━━━━━┳━━━━━━┳━━━━━━━━━━━━━━━━━━━━━┓ + # ┃ Port # ┃ Type ┃ Purpose ┃ + # ┣━━━━━━━━━╋━━━━━━╋━━━━━━━━━━━━━━━━━━━━━┫ + # ┃ 1990 ┃ UDP ┃ Bambu Printer Comms ┃ + # ┃ 2021 ┃ UDP ┃ Bambu Printer Comms ┃ + # ┗━━━━━━━━━┻━━━━━━┻━━━━━━━━━━━━━━━━━━━━━┛ + firewall = { + checkReversePath = "loose"; + allowedTCPPorts = [ ]; + allowedUDPPorts = [ 1990 2021 ]; + + # Both iptables commands are to get multicast working for orca slicer for my bambu printer + extraCommands = '' + iptables -I INPUT -m pkttype --pkt-type multicast -j ACCEPT + iptables -A INPUT -m pkttype --pkt-type multicast -j ACCEPT + ''; + }; }; @@ -84,19 +92,20 @@ programs.steam.enable = true; - # Services - services = { - pcscd.enable = true; - blueman.enable = false; - pulseaudio.enable = false; - printing.enable = true; - xserver = { - xkb = { - layout = "us"; - variant = ""; - }; + # Services + services = { + flatpak.enable = true; #flatpak + pcscd.enable = true; #yubikey + blueman.enable = false; #bluetooth + pulseaudio.enable = false; #Audio + printing.enable = true; #Printing + xserver = { + xkb = { + layout = "us"; + variant = ""; + }; + }; }; - }; # Package Manager nixpkgs = { @@ -120,25 +129,24 @@ }; environment.systemPackages = with pkgs; [ - gparted # Drive Partition Manger - bluez # Bluetooth Stack - # blueman # Bluetooth Management - home-manager # Dotfiles Management - pkg-config # Determine lib locations for linking during compliation + gparted # Drive Partition Manger + bluez # Bluetooth Stack + home-manager # Dotfiles Management + pkg-config # Determine lib locations for linking during compliation ripgrep # regex parser written in rust - openssl # SSL TLS Protocol - tree # Filetree to stdout - eza # LS rewritten in rust - zsh # Prefered Shell - dig #dns lookup - rage #file encryption - age-plugin-yubikey #plugin for rage to manage yubi-2fa - sops #file based secrets operations - direnv #used for development environments - gcc # Gnu C Compiler - bottom # Top rewritten in rust - felix-fm # File browser tui written in rust - discord # Discord for comms with friends + openssl # SSL TLS Protocol + tree # Filetree to stdout + eza # LS rewritten in rust + zsh # Prefered Shell + dig #dns lookup + rage #file encryption + age-plugin-yubikey #plugin for rage to manage yubi-2fa + sops #file based secrets operations + direnv #used for development environments + gcc # Gnu C Compiler + bottom # Top rewritten in rust + felix-fm # File browser tui written in rust + discord # Discord for comms with friends neovim # Modal Text Editor brave # Web Browser libation # Backup audible libraries @@ -148,8 +156,8 @@ yubioath-flutter # Yubico Authenticator Client lazygit # Git tui written in rust glow # Markdown renderer for terminal - inputs.sk-extract.packages.${system}.default - inputs.yunodo.packages.${system}.default + inputs.sk-extract.packages.${system}.default + inputs.yunodo.packages.${system}.default signal-desktop bat #cat but better in rust xclip #fixes nvim clipboard @@ -159,6 +167,11 @@ openscad #cad software for 3d modeling programattically orca-slicer #3d printer slicer wishlist #ssh bastion + fd # required for nvim config telescope + rustdesk #remote tech support + pciutils #lspci + lshw # for getting bus ids for PRIME + dracut # for lsinitrd ]; # Fonts diff --git a/modules/home-manager/home.nix b/modules/home-manager/home.nix index c6f96cf..a3db23f 100644 --- a/modules/home-manager/home.nix +++ b/modules/home-manager/home.nix @@ -27,7 +27,7 @@ speccon18.hm.zsh.enable = true; speccon18.hm.rio.enable = false; speccon18.hm.ssh.enable = true; - speccon18.hm.superfile.enable = true; + speccon18.hm.superfile.enable = false; # Home Manager needs a bit of information about you and the paths it should # manage. home = { @@ -53,7 +53,7 @@ superfile #rio #imgcat - + # # Adds the 'hello' command to your environment. It prints a friendly # # "Hello, world!" when run. # pkgs.hello @@ -71,7 +71,13 @@ # echo "Hello, ${config.home.username}!" # '') ]; - + sessionVariables = { + POP_SMTP_HOST = "smtp.protonmail.ch"; + POP_SMTP_PORT = "587"; + POP_SMTP_USERNAME = "steven.carpenter@skdevstudios.com"; + POP_FROM = "steven.carpenter@skdevstudios.com"; + POP_SMTP_PASSWORD = "2SJ83CHLPPVQ2RLT"; + }; # Home Manager is pretty good at managing dotfiles. The primary way to manage # plain files is through 'home.file'. file = { diff --git a/modules/home-manager/superfile.nix b/modules/home-manager/superfile.nix index 90fa90a..8e9c2a7 100644 --- a/modules/home-manager/superfile.nix +++ b/modules/home-manager/superfile.nix @@ -8,7 +8,7 @@ package = pkgs.superfile; hotkeys = { confirm = [ "enter" "" ]; - quit = [ "ctrl+c" "" ]; + quit = [ "ctrl+q" "" ]; list_up = [ "k" "up" ]; list_down = [ "j" "down" ]; page_up = [ "pgup" "" ]; diff --git a/modules/home-manager/zsh.nix b/modules/home-manager/zsh.nix index 30d3588..32b3d7a 100644 --- a/modules/home-manager/zsh.nix +++ b/modules/home-manager/zsh.nix @@ -17,12 +17,13 @@ syntaxHighlighting.enable = lib.mkDefault true; shellAliases = { - ls = "eza -l"; - lsa = "eza -al"; - grep = "rg"; + mo2 = "steam-run steamtinkerlaunch mo2 start"; + ls = "eza --icons -alog --group-directories-first --no-permissions --no-time --total-size --git --header"; + #grep = "rg"; osrb = "sudo nixos-rebuild $1 --flake ~/Documents/code/nix/nixos-config/#katana"; - nvim-cfg = "nvim /home/speccon18/.config/nvim/"; - cat = "bat"; + nvim-cfg = "nvim /home/speccon18/.config/nvim/"; + edit-nix-cfg = "nvim --cmd 'cd /home/speccon18/Documents/code/nix/nixos-config' flake.nix"; + cat = "bat"; }; localVariables = { diff --git a/modules/system/applications/default.nix b/modules/system/applications/default.nix new file mode 100644 index 0000000..c63a8ab --- /dev/null +++ b/modules/system/applications/default.nix @@ -0,0 +1,7 @@ +{pkgs,config,...}:{ + imports = [ + ./fnv.nix + ]; + + speccon18.applications.fnv.enable = true; +} diff --git a/modules/system/applications/fnv.nix b/modules/system/applications/fnv.nix new file mode 100644 index 0000000..457eb6b --- /dev/null +++ b/modules/system/applications/fnv.nix @@ -0,0 +1,62 @@ +{ pkgs, config, lib, ... }: { + options.speccon18.applications.fnv.enable = + lib.mkEnableOption "enable config for Fallout New Vegas"; + + config = lib.mkIf config.speccon18.applications.fnv.enable { + + # Load nvidia driver for Xorg and Wayland + # For offloading, `modesetting` is needed additionally, + # otherwise the X-server will be running permanently on nvidia, + # thus keeping the GPU always on (see `nvidia-smi`). + services.xserver.videoDrivers = [ + "nvidia" + ]; + + # Blacklist Nouveau driver to force 3060 to use nvidia driver + boot.blacklistedKernelModules = [ "nouveau" ]; + + # Enable OpenGL + hardware = { + graphics = { + enable = true; + enable32Bit = true; + + }; + nvidia = { + # Optionally, you may need to select the appropriate driver version for your specific GPU. + package = config.boot.kernelPackages.nvidiaPackages.latest; + prime = { + sync.enable = true; + # Make sure to use the correct Bus ID values for your system! + intelBusId = "PCI:0:2:0"; + nvidiaBusId = "PCI:1:0:0"; + }; + # Modesetting is required. + modesetting.enable = true; + + # Nvidia power management. Experimental, and can cause sleep/suspend to fail. + # Enable this if you have graphical corruption issues or application crashes after waking + # up from sleep. This fixes it by saving the entire VRAM memory to /tmp/ instead + # of just the bare essentials. + powerManagement.enable = false; + + # Fine-grained power management. Turns off GPU when not in use. + # Experimental and only works on modern Nvidia GPUs (Turing or newer). + powerManagement.finegrained = false; + + # Use the NVidia open source kernel module (not to be confused with the + # independent third-party "nouveau" open source driver). + # Support is limited to the Turing and later architectures. Full list of + # supported GPUs is at: + # https://github.com/NVIDIA/open-gpu-kernel-modules#compatible-gpus + # Only available from driver 515.43.04+ + open = true; + + # Enable the Nvidia settings menu, + # accessible via `nvidia-settings`. + nvidiaSettings = true; + }; + }; + }; +} + diff --git a/modules/system/default.nix b/modules/system/default.nix index 1943ebd..d3d4f37 100644 --- a/modules/system/default.nix +++ b/modules/system/default.nix @@ -2,5 +2,6 @@ imports = [ ./desktop-environments ./services + ./applications ]; }