Switch to unfree NVIDIA drivers and use Blender-bin to use CUDA

This commit is contained in:
Jimbo 2024-08-26 19:43:59 -04:00
parent 08948089a3
commit 0060e25fde
8 changed files with 57 additions and 58 deletions

View file

@ -1,5 +1,22 @@
{ {
"nodes": { "nodes": {
"blender-bin": {
"inputs": {
"nixpkgs": "nixpkgs"
},
"locked": {
"lastModified": 1724347557,
"narHash": "sha256-0eqXNM4mulNroWyx5h1ICDJQfY79jwW9KqMFHRstjP0=",
"rev": "9062c70ff62d9718485733f5cd5b25cd87875772",
"revCount": 120,
"type": "tarball",
"url": "https://api.flakehub.com/f/pinned/edolstra/blender-bin/1.0.8/01917b20-9eba-7b35-90c8-a4db33d22a81/source.tar.gz"
},
"original": {
"type": "tarball",
"url": "https://flakehub.com/f/edolstra/blender-bin/1.0.8.tar.gz"
}
},
"blobs": { "blobs": {
"flake": false, "flake": false,
"locked": { "locked": {
@ -32,26 +49,6 @@
"type": "gitlab" "type": "gitlab"
} }
}, },
"disko": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1724349583,
"narHash": "sha256-zgB1Cfk46irIsto8666yLdKjqKdBrjR48Dd3lhQ0CnQ=",
"owner": "nix-community",
"repo": "disko",
"rev": "435737144be0259559ca3b43f7d72252b1fdcc1b",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "disko",
"type": "github"
}
},
"flake-compat": { "flake-compat": {
"flake": false, "flake": false,
"locked": { "locked": {
@ -125,7 +122,7 @@
"inputs": { "inputs": {
"blobs": "blobs", "blobs": "blobs",
"flake-compat": "flake-compat", "flake-compat": "flake-compat",
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs_2",
"nixpkgs-24_05": "nixpkgs-24_05" "nixpkgs-24_05": "nixpkgs-24_05"
}, },
"locked": { "locked": {
@ -146,7 +143,7 @@
"inputs": { "inputs": {
"blobs": "blobs_2", "blobs": "blobs_2",
"flake-compat": "flake-compat_2", "flake-compat": "flake-compat_2",
"nixpkgs": "nixpkgs_2", "nixpkgs": "nixpkgs_3",
"nixpkgs-24_05": "nixpkgs-24_05_2", "nixpkgs-24_05": "nixpkgs-24_05_2",
"utils": "utils" "utils": "utils"
}, },
@ -167,16 +164,15 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1717602782, "lastModified": 1722221733,
"narHash": "sha256-pL9jeus5QpX5R+9rsp3hhZ+uplVHscNJh8n8VpqscM0=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "e8057b67ebf307f01bdcc8fba94d94f75039d1f6", "rev": "12bf09802d77264e441f48e25459c10c93eada2e",
"type": "github" "type": "github"
}, },
"original": { "original": {
"id": "nixpkgs", "id": "nixpkgs",
"ref": "nixos-unstable", "ref": "nixos-24.05",
"type": "indirect" "type": "indirect"
} }
}, },
@ -242,6 +238,21 @@
} }
}, },
"nixpkgs_3": { "nixpkgs_3": {
"locked": {
"lastModified": 1717602782,
"narHash": "sha256-pL9jeus5QpX5R+9rsp3hhZ+uplVHscNJh8n8VpqscM0=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "e8057b67ebf307f01bdcc8fba94d94f75039d1f6",
"type": "github"
},
"original": {
"id": "nixpkgs",
"ref": "nixos-unstable",
"type": "indirect"
}
},
"nixpkgs_4": {
"locked": { "locked": {
"lastModified": 1724242322, "lastModified": 1724242322,
"narHash": "sha256-HMpK7hNjhEk4z5SFg5UtxEio9OWFocHdaQzCfW1pE7w=", "narHash": "sha256-HMpK7hNjhEk4z5SFg5UtxEio9OWFocHdaQzCfW1pE7w=",
@ -274,12 +285,12 @@
}, },
"root": { "root": {
"inputs": { "inputs": {
"disko": "disko", "blender-bin": "blender-bin",
"hardware": "hardware", "hardware": "hardware",
"home-manager": "home-manager", "home-manager": "home-manager",
"mail": "mail", "mail": "mail",
"nixos-mailserver": "nixos-mailserver", "nixos-mailserver": "nixos-mailserver",
"nixpkgs": "nixpkgs_3", "nixpkgs": "nixpkgs_4",
"nixpkgs-unstable": "nixpkgs-unstable", "nixpkgs-unstable": "nixpkgs-unstable",
"nur": "nur" "nur": "nur"
} }

View file

@ -8,13 +8,10 @@
nur.url = "github:nix-community/NUR"; nur.url = "github:nix-community/NUR";
mail.url = "gitlab:simple-nixos-mailserver/nixos-mailserver"; mail.url = "gitlab:simple-nixos-mailserver/nixos-mailserver";
nixos-mailserver.url = "gitlab:simple-nixos-mailserver/nixos-mailserver/nixos-24.05"; nixos-mailserver.url = "gitlab:simple-nixos-mailserver/nixos-mailserver/nixos-24.05";
blender-bin.url = "https://flakehub.com/f/edolstra/blender-bin/1.0.8.tar.gz";
# NixOS utils # NixOS utils
hardware.url = "github:nixos/nixos-hardware/master"; hardware.url = "github:nixos/nixos-hardware/master";
disko = {
url = "github:nix-community/disko";
inputs.nixpkgs.follows = "nixpkgs";
};
# Home manager # Home manager
home-manager = { home-manager = {
@ -24,16 +21,17 @@
}; };
outputs = { outputs = {
self, self,
nixpkgs, nixpkgs,
home-manager,
nur, nur,
blender-bin,
nixos-mailserver, nixos-mailserver,
home-manager,
... ...
} @inputs: let } @inputs: let
inherit (self) outputs; inherit (self) outputs;
forAllSystems = nixpkgs.lib.genAttrs [ forAllSystems = nixpkgs.lib.genAttrs [
"aarch64-linux" "aarch64-linux"
"x86_64-linux" "x86_64-linux"
]; ];
in rec { in rec {

View file

@ -21,6 +21,7 @@
outputs.overlays.additions outputs.overlays.additions
outputs.overlays.modifications outputs.overlays.modifications
outputs.overlays.unstable-packages outputs.overlays.unstable-packages
inputs.blender-bin.overlays.default
]; ];
# Configure your nixpkgs instance # Configure your nixpkgs instance
config = { config = {

View file

@ -18,7 +18,7 @@
./guiapps/easyeffects.nix ./guiapps/easyeffects.nix
./tuiapps/ncmpcpp.nix ./tuiapps/ncmpcpp.nix
# Misc Apps # Misc apps and tools
./misc/useful.nix ./misc/useful.nix
./misc/avtools.nix ./misc/avtools.nix
./misc/filemanager.nix ./misc/filemanager.nix

View file

@ -3,7 +3,7 @@
krita krita
inkscape inkscape
audacity audacity
blender blender_4_2
sunvox sunvox
]; ];
} }

View file

@ -98,7 +98,7 @@
# Communication # Communication
"${ws.w3a}" = [{class = "zoom";}]; "${ws.w3a}" = [{class = "zoom";}];
"${ws.w7}" = [{app_id = "MiscBrowser";} {app_id = "vesktop";}]; "${ws.w7}" = [{app_id = "MiscBrowser";} {app_id = "vesktop";}];
"${ws.w8}" = [{class = "Element";}]; "${ws.w8}" = [{app_id = "Element";}];
"${ws.w9}" = [{app_id = "thunderbird";}]; "${ws.w9}" = [{app_id = "thunderbird";}];
# Else # Else

View file

@ -1,11 +1,5 @@
# This file was initially made by 'nixos-generate-config', try not to edit too much # This file was initially made by 'nixos-generate-config', try not to edit too much
{ { config, lib, pkgs, modulesPath, ... }: let
config,
lib,
pkgs,
modulesPath,
...
}: let
# Set common boot paramaters # Set common boot paramaters
commonKernelParams = [ commonKernelParams = [
# Nvidia settings # Nvidia settings

View file

@ -1,4 +1,4 @@
{config, ... }: { {pkgs, config, ... }: {
# Enable video drivers # Enable video drivers
services.xserver.videoDrivers = ["nvidia"]; services.xserver.videoDrivers = ["nvidia"];
@ -6,17 +6,12 @@
modesetting.enable = true; modesetting.enable = true;
nvidiaSettings = false; nvidiaSettings = false;
package = config.boot.kernelPackages.nvidiaPackages.beta; package = config.boot.kernelPackages.nvidiaPackages.beta;
open = true; open = false;
}; };
pkgs.stdenv.mkDerivation { environment.sessionVariables = {
name = "cuda-env-shell"; CUDA_PATH = "${pkgs.cudatoolkit}";
buildInputs = with pkgs; [ EXTRA_LDFLAGS = "-L/lib -L${pkgs.linuxPackages.nvidia_x11}/lib";
cudatoolkit EXTRA_CCFLAGS = "-I/usr/include";
]; };
shellHook = ''
export CUDA_PATH=${pkgs.cudatoolkit}
export EXTRA_LDFLAGS="-L/lib -L${pkgs.linuxPackages.nvidia_x11}/lib"
export EXTRA_CCFLAGS="-I/usr/include"
'';
} }