From d092fc690da21c2c82e1a5fb8930bfe7f78f9e65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Av=C3=A9?= Date: Wed, 5 Jun 2024 13:28:56 +0200 Subject: [PATCH] Wed Jun 5 01:28:56 PM CEST 2024 --- flake.nix | 6 ++++- home/waybar/default.nix | 6 ++--- hosts/Aloria/default.nix | 57 +++++++++++++++++++++++++++++++++++----- hosts/Kell/default.nix | 11 +++++--- 4 files changed, 65 insertions(+), 15 deletions(-) diff --git a/flake.nix b/flake.nix index b0855ac..0ea3ecf 100644 --- a/flake.nix +++ b/flake.nix @@ -33,8 +33,10 @@ hardware.opengl = { enable = true; driSupport = true; + driSupport32Bit = true; }; security.polkit.enable = true; + nixpkgs.config.allowUnfree = true; networking.hostName = host; boot.loader.systemd-boot = { enable = true; @@ -46,9 +48,11 @@ time.timeZone = "Europe/Brussels"; nix.settings = { - substituters = [ "https://hyprland.cachix.org" ]; + substituters = [ "https://hyprland.cachix.org" "https://nix-community.cachix.org" "https://cuda-maintainers.cachix.org"]; trusted-public-keys = [ "hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc=" + "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" + "cuda-maintainers.cachix.org-1:0dq3bujKpuEPMCX6U4WylrUDZ9JyUG0VpVZa7CNfq5E=" ]; experimental-features = [ "nix-command" "flakes" ]; trusted-users = [ "root" "user" ]; diff --git a/home/waybar/default.nix b/home/waybar/default.nix index 7e78d99..8ab2124 100644 --- a/home/waybar/default.nix +++ b/home/waybar/default.nix @@ -171,10 +171,8 @@ border-radius: 7px; color: #ffffff; background-color: #1f2430; - margin-left:4px; - margin-right:4px; - margin-top:2px; - margin-bottom:2px; + margin-left:3px; + margin-right:3px; } #taskbar button.active { background-color: #023269; diff --git a/hosts/Aloria/default.nix b/hosts/Aloria/default.nix index e537b80..d5017fe 100644 --- a/hosts/Aloria/default.nix +++ b/hosts/Aloria/default.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: +{ pkgs, config, ... }: let mkConnection = name: cfg: { connection = { @@ -35,10 +35,54 @@ connections = { in { services.pcscd.enable = true; + services.xserver.videoDrivers = ["nvidia"]; hardware.opengl.extraPackages = [ pkgs.intel-compute-runtime pkgs.intel-media-driver ]; + services.thermald.enable = true; + services.fwupd.enable = true; + environment.systemPackages = with pkgs; [ + wireguard-tools + + # CUDA + pciutils + file + gnumake + gcc + cudatoolkit + ]; + hardware.nvidia = { + package = config.boot.kernelPackages.nvidiaPackages.stable; + modesetting.enable = true; + powerManagement.enable = false; + powerManagement.finegrained = true; + open = false; + nvidiaSettings = true; + prime = { + intelBusId = "PCI:0:2:0"; + nvidiaBusId = "PCI:1:0:0"; + offload = { + enable = true; + enableOffloadCmd = true; + }; + }; + }; + systemd.services.nvidia-control-devices = { + wantedBy = [ "multi-user.target" ]; + serviceConfig.ExecStart = "${pkgs.linuxPackages.nvidia_x11.bin}/bin/nvidia-smi"; + }; + specialisation = { + on-the-go.configuration = { + system.nixos.tags = [ "docked" ]; + hardware.nvidia = { + powerManagement.finegrained = pkgs.lib.mkForce false; + prime.offload.enable = pkgs.lib.mkForce false; + prime.offload.enableOffloadCmd = pkgs.lib.mkForce false; + prime.sync.enable = pkgs.lib.mkForce true; + }; + }; + }; services.udev.packages = [ pkgs.yubikey-personalization ]; # Calendar @@ -46,7 +90,6 @@ in services.gnome.evolution-data-server.enable = true; services.gnome.gnome-online-accounts.enable = true; services.gnome.gnome-keyring.enable = true; - environment.systemPackages = with pkgs; [ wireguard-tools ]; # Add the server using gnome-online-accounts: # nix-shell -p gnome.gnome-control-center --run "gnome-control-center" @@ -90,26 +133,26 @@ in fileSystems."/home/server" = { device = "10.1:/home/server"; fsType = "nfs"; - options = [ "x-systemd.automount" "x-systemd.mount-timeout=1" "_netdev" ]; + options = [ "x-systemd.automount" "x-systemd.mount-timeout=1" "_netdev" "noauto" "timeo=1" ]; }; fileSystems."/home/user/Workspace" = { device = "10.1:/home/server/Workspace"; fsType = "nfs"; - options = [ "x-systemd.automount" "x-systemd.mount-timeout=1" "_netdev" ]; + options = [ "x-systemd.automount" "x-systemd.mount-timeout=1" "_netdev" "noauto" "timeo=1" ]; }; fileSystems."/home/user/Documents" = { device = "10.1:/home/server/Storage/Thomas/Documents"; fsType = "nfs"; - options = [ "x-systemd.automount" "x-systemd.mount-timeout=1" "_netdev" ]; + options = [ "x-systemd.automount" "x-systemd.mount-timeout=1" "_netdev" "noauto" "timeo=1" ]; }; fileSystems."/home/user/Pictures" = { device = "10.1:/home/server/Storage/Thomas/Pictures"; fsType = "nfs"; - options = [ "x-systemd.automount" "x-systemd.mount-timeout=1" "_netdev" ]; + options = [ "x-systemd.automount" "x-systemd.mount-timeout=1" "_netdev" "noauto" "timeo=1" ]; }; fileSystems."/home/user/Videos" = { device = "10.1:/home/server/Storage/Thomas/Videos"; fsType = "nfs"; - options = [ "x-systemd.automount" "x-systemd.mount-timeout=1" "_netdev" ]; + options = [ "x-systemd.automount" "x-systemd.mount-timeout=1" "_netdev" "noauto" "timeo=1" ]; }; } diff --git a/hosts/Kell/default.nix b/hosts/Kell/default.nix index 4d37b44..c790271 100644 --- a/hosts/Kell/default.nix +++ b/hosts/Kell/default.nix @@ -1,8 +1,13 @@ -{ inputs, pkgs, ... }: +{ inputs, config, pkgs, ... }: { - # AMD GPU - boot.initrd.kernelModules = [ "amdgpu" ]; + # AMD CPU + boot.blacklistedKernelModules = [ "k10temp" ]; + boot.extraModulePackages = [ config.boot.kernelPackages.zenpower ]; + boot.kernelModules = [ "zenpower" ]; + + # AMD CPU & GPU + boot.initrd.kernelModules = [ "amdgpu amd_pstate=active" ]; services.pcscd.enable = true; services.udev.packages = [ pkgs.yubikey-personalization ]; services.logind.extraConfig = ''