From a4871ba4235bb7dd21b1039ad2f71dda134fd8c9 Mon Sep 17 00:00:00 2001 From: Menno van Leeuwen Date: Mon, 9 Dec 2024 16:02:05 +0100 Subject: [PATCH] final touches upgrade 24.11 --- .bashrc | 3 + config/home-manager/flake.lock | 18 ++--- config/home-manager/home.nix | 2 +- .../packages/workstation/nemo.nix | 25 +++++++ config/home-manager/workstation/dconf.nix | 12 +++- config/home-manager/workstation/wireguard.nix | 1 - config/nixos/common/workstation.nix | 7 +- config/nixos/flake.lock | 12 ++-- config/nixos/hardware/mennos-gamingpc.nix | 2 +- config/nixos/hardware/mennos-laptop.nix | 66 +++++++++++-------- config/nixos/hardware/mennos-server.nix | 2 +- config/nixos/users.nix | 1 + 12 files changed, 102 insertions(+), 49 deletions(-) create mode 100644 config/home-manager/packages/workstation/nemo.nix delete mode 100644 config/home-manager/workstation/wireguard.nix diff --git a/.bashrc b/.bashrc index ffd9596..62f7492 100644 --- a/.bashrc +++ b/.bashrc @@ -69,6 +69,9 @@ export XDG_DATA_DIRS=$XDG_DATA_DIRS:/usr/share:/var/lib/flatpak/exports/share:$H # Allow unfree nixos export NIXPKGS_ALLOW_UNFREE=1 +# Allow insecure nixpkgs +export NIXPKGS_ALLOW_INSECURE=1 + # Set DOTF_HOSTNAME to the hostname from .hostname file # If this file doesn't exist, use mennos-unknown-hostname export DOTF_HOSTNAME="mennos-unknown-hostname" diff --git a/config/home-manager/flake.lock b/config/home-manager/flake.lock index 3d4fa07..41c546a 100644 --- a/config/home-manager/flake.lock +++ b/config/home-manager/flake.lock @@ -7,11 +7,11 @@ ] }, "locked": { - "lastModified": 1732466619, - "narHash": "sha256-T1e5oceypZu3Q8vzICjv1X/sGs9XfJRMW5OuXHgpB3c=", + "lastModified": 1733572789, + "narHash": "sha256-zjO6m5BqxXIyjrnUziAzk4+T4VleqjstNudSqWcpsHI=", "owner": "nix-community", "repo": "home-manager", - "rev": "f3111f62a23451114433888902a55cf0692b408d", + "rev": "c7ffc9727d115e433fd884a62dc164b587ff651d", "type": "github" }, "original": { @@ -23,11 +23,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1732350895, - "narHash": "sha256-GcOQbOgmwlsRhpLGSwZJwLbo3pu9ochMETuRSS1xpz4=", + "lastModified": 1733550349, + "narHash": "sha256-NcGumB4Lr6KSDq+nIqXtNA8QwAQKDSZT7N9OTGWbTrs=", "owner": "nixos", "repo": "nixpkgs", - "rev": "0c582677378f2d9ffcb01490af2f2c678dcb29d3", + "rev": "e2605d0744c2417b09f8bf850dfca42fcf537d34", "type": "github" }, "original": { @@ -39,11 +39,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1732521221, - "narHash": "sha256-2ThgXBUXAE1oFsVATK1ZX9IjPcS4nKFOAjhPNKuiMn0=", + "lastModified": 1733581040, + "narHash": "sha256-Qn3nPMSopRQJgmvHzVqPcE3I03zJyl8cSbgnnltfFDY=", "owner": "nixos", "repo": "nixpkgs", - "rev": "4633a7c72337ea8fd23a4f2ba3972865e3ec685d", + "rev": "22c3f2cf41a0e70184334a958e6b124fb0ce3e01", "type": "github" }, "original": { diff --git a/config/home-manager/home.nix b/config/home-manager/home.nix index 8380668..a87e839 100644 --- a/config/home-manager/home.nix +++ b/config/home-manager/home.nix @@ -32,7 +32,7 @@ homeDirectory = "/home/menno"; stateVersion = "24.11"; sessionVariables = { - PATH = "${config.home.homeDirectory}/go/bin:$PATH"; # Removed extra asterisks + PATH = "${config.home.homeDirectory}/go/bin:$PATH"; }; }; } diff --git a/config/home-manager/packages/workstation/nemo.nix b/config/home-manager/packages/workstation/nemo.nix new file mode 100644 index 0000000..6dfc947 --- /dev/null +++ b/config/home-manager/packages/workstation/nemo.nix @@ -0,0 +1,25 @@ +{ pkgs, ... }: +{ + home.packages = with pkgs; [ + nemo + cinnamon-common + ]; + + # Configure systemd user service for Nemo desktop + systemd.user.services = { + nemo-desktop = { + Unit = { + Description = "Nemo Desktop"; + PartOf = [ "graphical-session.target" ]; + }; + Service = { + ExecStart = "${pkgs.nemo}/bin/nemo-desktop"; + RestartSec = 3; + Restart = "always"; + }; + Install = { + WantedBy = [ "graphical-session.target" ]; + }; + }; + }; +} diff --git a/config/home-manager/workstation/dconf.nix b/config/home-manager/workstation/dconf.nix index a34b405..c3f36fd 100644 --- a/config/home-manager/workstation/dconf.nix +++ b/config/home-manager/workstation/dconf.nix @@ -35,6 +35,14 @@ dconf = { enable = true; settings = { + # Set nemo as the default file manager and disable desktop icons since this is handled by nemo + "org/gnome/desktop/background" = { + show-desktop-icons = false; + }; + "org/gnome/desktop/applications/file-manager" = { + exec = "nemo"; + }; + "org/gnome/desktop/interface" = { color-scheme = "prefer-dark"; }; @@ -50,7 +58,7 @@ "com.plexamp.Plexamp.desktop" "vesktop.desktop" "org.gnome.Geary.desktop" - "org.gnome.Nautilus.desktop" + "nemo.desktop" "org.gnome.Console.desktop" ]; }; @@ -58,7 +66,7 @@ # GNOME Terminal settings "org/gnome/Console" = { use-system-font = false; - custom-font = "Hack Nerd Font 14"; + custom-font = "Hack Nerd Font 13"; theme = "night"; }; diff --git a/config/home-manager/workstation/wireguard.nix b/config/home-manager/workstation/wireguard.nix deleted file mode 100644 index 74a3b06..0000000 --- a/config/home-manager/workstation/wireguard.nix +++ /dev/null @@ -1 +0,0 @@ -{ config, pkgs, ... }: { } diff --git a/config/nixos/common/workstation.nix b/config/nixos/common/workstation.nix index 8058ede..5fd6cf3 100644 --- a/config/nixos/common/workstation.nix +++ b/config/nixos/common/workstation.nix @@ -7,7 +7,12 @@ services.xserver.displayManager.gdm.enable = true; services.xserver.desktopManager.gnome.enable = true; - environment.systemPackages = with pkgs; [ gnome-session ]; + environment.systemPackages = with pkgs; [ + gnome-session + xdg-desktop-portal + xdg-desktop-portal-gnome + xdg-desktop-portal-gtk + ]; # Configure keymap in X11 services.xserver.xkb = { diff --git a/config/nixos/flake.lock b/config/nixos/flake.lock index 58f9d89..331687e 100644 --- a/config/nixos/flake.lock +++ b/config/nixos/flake.lock @@ -2,11 +2,11 @@ "nodes": { "nixpkgs": { "locked": { - "lastModified": 1732350895, - "narHash": "sha256-GcOQbOgmwlsRhpLGSwZJwLbo3pu9ochMETuRSS1xpz4=", + "lastModified": 1733550349, + "narHash": "sha256-NcGumB4Lr6KSDq+nIqXtNA8QwAQKDSZT7N9OTGWbTrs=", "owner": "nixos", "repo": "nixpkgs", - "rev": "0c582677378f2d9ffcb01490af2f2c678dcb29d3", + "rev": "e2605d0744c2417b09f8bf850dfca42fcf537d34", "type": "github" }, "original": { @@ -18,11 +18,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1732521221, - "narHash": "sha256-2ThgXBUXAE1oFsVATK1ZX9IjPcS4nKFOAjhPNKuiMn0=", + "lastModified": 1733581040, + "narHash": "sha256-Qn3nPMSopRQJgmvHzVqPcE3I03zJyl8cSbgnnltfFDY=", "owner": "nixos", "repo": "nixpkgs", - "rev": "4633a7c72337ea8fd23a4f2ba3972865e3ec685d", + "rev": "22c3f2cf41a0e70184334a958e6b124fb0ce3e01", "type": "github" }, "original": { diff --git a/config/nixos/hardware/mennos-gamingpc.nix b/config/nixos/hardware/mennos-gamingpc.nix index ccc77c1..920e819 100644 --- a/config/nixos/hardware/mennos-gamingpc.nix +++ b/config/nixos/hardware/mennos-gamingpc.nix @@ -19,7 +19,7 @@ # Enable Vulkan support for AMD graphics cards hardware.graphics.extraPackages32 = with pkgs.pkgsi686Linux; [ amdvlk ]; - # Enable OpenGL + # Enable graphics hardware.graphics = { enable = true; diff --git a/config/nixos/hardware/mennos-laptop.nix b/config/nixos/hardware/mennos-laptop.nix index 4f5bb2c..14c954b 100644 --- a/config/nixos/hardware/mennos-laptop.nix +++ b/config/nixos/hardware/mennos-laptop.nix @@ -9,50 +9,62 @@ imports = [ /etc/nixos/hardware-configuration.nix ]; networking.hostName = "mennos-laptop"; - # Bootloader. + # Bootloader boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = true; - # Enable OpenGL - hardware.graphics.enable = true; + # Enable graphics + hardware.graphics = { + enable = true; + extraPackages = with pkgs; [ + amdvlk + rocmPackages.clr + ]; + }; - # Load nvidia driver for Xorg and Wayland - services.xserver.videoDrivers = [ "nvidia" ]; + # Load AMD and NVIDIA drivers for Xorg and Wayland + services.xserver.videoDrivers = [ + "nvidia" + "amdgpu" + ]; - # nvtop, a system monitor for GPUs + # Monitoring tools environment.systemPackages = with pkgs; [ nvtopPackages.nvidia nvtopPackages.amd + glxinfo + vulkan-tools ]; hardware.nvidia = { - # Modesetting is required. + # Enable modesetting 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; + # Power management configuration + powerManagement = { + enable = true; + finegrained = false; # Disabled as it requires offload mode + }; - # 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; + # Prime configuration for hybrid graphics + prime = { + offload = { + enable = true; + enableOffloadCmd = true; + }; + + # AMD GPU as primary + amdgpuBusId = "PCI:5:0:0"; + nvidiaBusId = "PCI:1:0:0"; + }; - # 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+ - # Currently alpha-quality/buggy, so false is currently the recommended setting. open = false; - - # Enable the Nvidia settings menu, - # accessible via `nvidia-settings`. nvidiaSettings = true; - - # Optionally, you may need to select the appropriate driver version for your specific GPU. package = config.boot.kernelPackages.nvidiaPackages.stable; }; + + boot.kernelParams = [ + "amdgpu.sg_display=0" + "nvidia-drm.modeset=1" + ]; } diff --git a/config/nixos/hardware/mennos-server.nix b/config/nixos/hardware/mennos-server.nix index 804b493..c7feed3 100644 --- a/config/nixos/hardware/mennos-server.nix +++ b/config/nixos/hardware/mennos-server.nix @@ -24,7 +24,7 @@ # Load nvidia driver for Xorg and Wayland services.xserver.videoDrivers = [ "nvidia" ]; - # Enable OpenGL + # Enable graphics hardware.graphics.enable = true; # nvtop, a system monitor for GPUs diff --git a/config/nixos/users.nix b/config/nixos/users.nix index b0c49c9..542ed6b 100644 --- a/config/nixos/users.nix +++ b/config/nixos/users.nix @@ -14,6 +14,7 @@ "video" "render" "users" + "input" "adbusers" ]; };