diff options
| Commit | 2fe3132bb2bf8e14d0fae9e1d78ff374ae01646b (patch) | |
|---|---|---|
| Author | 2024-07-07 11:07:47 +0300 | |
| Committer | 2024-07-07 11:07:47 +0300 | |
| Files | 7a28fdffde253f112159b89e922e7a07a4035bc0 | |
| nix-2fe3132bb2bf8e14d0fae9e1d78ff374ae01646b.tar nix-2fe3132bb2bf8e14d0fae9e1d78ff374ae01646b.tar.gz nix-2fe3132bb2bf8e14d0fae9e1d78ff374ae01646b.zip | ||
| Parent | 78eaa0ccb01720bb91ffe6af1a0db93ab9408317 (diff) | |
[machines] Updated sysidentity and moved stuff from configuration to hardware-configuration
8 files changed, 90 insertions, 83 deletions
| -rw-r--r-- | autoconfig.nix | 13 | ||||
| -rw-r--r-- | machines/juno/configuration.nix | 12 | ||||
| -rw-r--r-- | machines/juno/hardware-configuration.nix | 20 | ||||
| -rw-r--r-- | machines/juno/sysidentity.nix | 6 | ||||
| -rw-r--r-- | machines/minerva/sysidentity.nix | 7 | ||||
| -rw-r--r-- | machines/vesta/configuration.nix | 54 | ||||
| -rw-r--r-- | machines/vesta/hardware-configuration.nix | 60 | ||||
| -rw-r--r-- | machines/vesta/sysidentity.nix | 1 |
diff --git a/autoconfig.nix b/autoconfig.nix index 5da9c3a..7434a79 100644 --- a/autoconfig.nix +++ b/autoconfig.nix @@ -17,16 +17,21 @@ in { (v: ./modules + ("/" + v + (if lib.hasSuffix ".nix" v then "" else ".nix"))) sysidentity.${attrname} else []; - havelist = listget "have"; droplist = listget "drop"; + startsempty = (sysidentity ? defaultempty) && sysidentity.defaultempty; + # When we start empty, we expect to have many packages in "have" + # but when we don't start empty, we expect to have many packages in "modelist" + # So it makes more sense to make droplist remove items from the "many packages" + # list, instead of only one of the two, or both + havelist = if startsempty then listget "have" else []; modulelist = - if (sysidentity ? defaultempty) && sysidentity.defaultempty - then [] + if startsempty + then listget "have" else lib.mapAttrsToList (name: _: ./modules + ("/" + name)) (lib.filterAttrs (_: type: type == "regular") (builtins.readDir ./modules)); in - lib.subtractLists droplist (havelist ++ modulelist); + (lib.subtractLists droplist modulelist) ++ havelist; inputs-overlays = lib.mapAttrs diff --git a/machines/juno/configuration.nix b/machines/juno/configuration.nix index 113be25..9e75d45 100644 --- a/machines/juno/configuration.nix +++ b/machines/juno/configuration.nix @@ -12,16 +12,4 @@ ["level auto" 53 32767] ]; }; - - # https://nixos.wiki/wiki/Accelerated_Video_Playback - nixpkgs.config.packageOverrides = pkgs: { - vaapiIntel = pkgs.vaapiIntel.override { enableHybridCodec = true; }; - }; - hardware.opengl = { - enable = true; - extraPackages = with pkgs; [ - intel-media-driver # LIBVA_DRIVER_NAME=iHD - vaapiIntel # LIBVA_DRIVER_NAME=i965 (older but works better for Firefox/Chromium) - ]; - }; } diff --git a/machines/juno/hardware-configuration.nix b/machines/juno/hardware-configuration.nix index 3318aca..d732f30 100644 --- a/machines/juno/hardware-configuration.nix +++ b/machines/juno/hardware-configuration.nix @@ -1,9 +1,4 @@ -# Do not modify this file! It was generated by ‘nixos-generate-config’ -# and may be overwritten by future invocations. Please make changes -# to /etc/nixos/configuration.nix instead. -{ config, lib, pkgs, modulesPath, ... }: - -{ +{ config, lib, pkgs, modulesPath, ... }: { imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; @@ -41,4 +36,17 @@ nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; + + # Hardware acceleration + # https://nixos.wiki/wiki/Accelerated_Video_Playback + nixpkgs.config.packageOverrides = pkgs: { + vaapiIntel = pkgs.vaapiIntel.override { enableHybridCodec = true; }; + }; + hardware.opengl = { + enable = true; + extraPackages = with pkgs; [ + intel-media-driver # LIBVA_DRIVER_NAME=iHD + vaapiIntel # LIBVA_DRIVER_NAME=i965 (older but works better for Firefox/Chromium) + ]; + }; } diff --git a/machines/juno/sysidentity.nix b/machines/juno/sysidentity.nix index 88a4e1c..e208076 100644 --- a/machines/juno/sysidentity.nix +++ b/machines/juno/sysidentity.nix @@ -1,7 +1,11 @@ +let + groups = import ../../module-groups.nix; +in { sysidentity = { name = "juno"; - type = "laptop"; arch = "x86_64-linux"; + + drop = groups.non-laptop; }; } diff --git a/machines/minerva/sysidentity.nix b/machines/minerva/sysidentity.nix index 80d1461..06919b4 100644 --- a/machines/minerva/sysidentity.nix +++ b/machines/minerva/sysidentity.nix @@ -1,7 +1,14 @@ +let + groups = import ../../module-groups.nix; +in { sysidentity = { name = "minerva"; type = "laptop"; arch = "x86_64-linux"; + + defaultempty = false; # therefore drop will not remove from have + have = [ "gui-powerful" ]; + drop = groups.non-laptop; }; } diff --git a/machines/vesta/configuration.nix b/machines/vesta/configuration.nix index d32c502..e7b3b61 100644 --- a/machines/vesta/configuration.nix +++ b/machines/vesta/configuration.nix @@ -1,16 +1,4 @@ { pkgs, ... }: { - fileSystems."/mnt/Svalbard" = - { device = "/dev/disk/by-uuid/5bd27e26-5b83-4485-ab3f-bcfbbd2b40d5"; - fsType = "ext4"; - options = [ "defaults" "x-gvfs-show" ]; - }; - - fileSystems."/mnt/Norilsk" = - { device = "/dev/disk/by-uuid/689f863a-5026-42ff-aecc-3195e8d8c684"; - fsType = "ext4"; - options = [ "defaults" "x-gvfs-show" ]; - }; - environment.systemPackages = with pkgs; [ alsa-plugins radeontop glxinfo vulkan-tools clinfo gpu-viewer lutris wine gns3-server gns3-gui docker tigervnc ubridge vpcs ]; @@ -33,46 +21,4 @@ environment.sessionVariables = { ALSA_PLUGIN_DIR = pkgs.alsa-plugins.outPath + "/lib/alsa-lib"; }; - - # GPU - # There is a potential bug with amdgpu driver (https://bugzilla.mozilla.org/show_bug.cgi?id=1437520#c4) - # Remember to disable VAAPI for this machine in Firefox: media.ffmpeg.vaapi.enabled = false (https://wiki.archlinux.org/title/Firefox#Hardware_video_acceleration) - - boot.initrd.kernelModules = [ "amdgpu" ]; - services.xserver.videoDrivers = [ "amdgpu" ]; - - boot.kernelParams = [ - "radeon.si_support=0" "amdgpu.si_support=1" # for Southern Islands (SI ie. GCN 1) cards - "libata.force=2.00:nodmalog" # Eliminate "qc timeout" 15 second boot delay for /home SSD - ]; - # systemd.tmpfiles.rules = [ - # "L+ /opt/rocm/hip - - - - ${pkgs.rocmPackages.clr}" - # ]; - hardware.opengl = { - # Mesa - enable = true; - - extraPackages = with pkgs; [ - # OpenCL - # rocmPackages.clr - # VA-API - libva - # AMDVLK - # amdvlk - ]; - # extraPackages32 = with pkgs; [ - # driversi686Linux.amdvlk - # ]; - - # Vulkan - driSupport = true; - # For 32 bit applications - driSupport32Bit = true; - }; - # system.replaceRuntimeDependencies = [ - # ({ original = pkgs.mesa; replacement = (import /srv/nixpkgs-mesa { }).pkgs.mesa; }) - # ({ original = pkgs.mesa.drivers; replacement = (import /srv/nixpkgs-mesa { }).pkgs.mesa.drivers; }) - # ]; - - swapDevices = [ { device = "/home/swapfile"; size = 24 * 1024; } ]; } diff --git a/machines/vesta/hardware-configuration.nix b/machines/vesta/hardware-configuration.nix index 39158d6..46faca7 100644 --- a/machines/vesta/hardware-configuration.nix +++ b/machines/vesta/hardware-configuration.nix @@ -1,6 +1,4 @@ -# Do not modify this file! It was generated by ‘nixos-generate-config’ -# and may be overwritten by future invocations. Please make changes -# to /etc/nixos/configuration.nix instead. +# Machine-specific kernel, cpu, gpu and file system settings { config, lib, pkgs, modulesPath, ... }: { @@ -10,7 +8,7 @@ boot.initrd.availableKernelModules = [ "xhci_pci" "ehci_pci" "ahci" "firewire_ohci" "usbhid" "usb_storage" "sd_mod" "sr_mod" ]; boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ "kvm-intel" ]; + boot.kernelModules = [ "kvm-intel" "amdgpu" ]; boot.extraModulePackages = [ ]; fileSystems."/" = @@ -28,7 +26,19 @@ fsType = "ext4"; }; - swapDevices = [ ]; + fileSystems."/mnt/Svalbard" = + { device = "/dev/disk/by-uuid/5bd27e26-5b83-4485-ab3f-bcfbbd2b40d5"; + fsType = "ext4"; + options = [ "defaults" "x-gvfs-show" ]; + }; + + fileSystems."/mnt/Norilsk" = + { device = "/dev/disk/by-uuid/689f863a-5026-42ff-aecc-3195e8d8c684"; + fsType = "ext4"; + options = [ "defaults" "x-gvfs-show" ]; + }; + + swapDevices = [ { device = "/home/swapfile"; size = 24 * 1024; } ]; # Enables DHCP on each ethernet and wireless interface. In case of scripted networking # (the default) this is the recommended approach. When using systemd-networkd it's @@ -39,4 +49,44 @@ nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; + + # GPU + # There is a potential bug with amdgpu driver (https://bugzilla.mozilla.org/show_bug.cgi?id=1437520#c4) + # Remember to disable VAAPI for this machine in Firefox: media.ffmpeg.vaapi.enabled = false (https://wiki.archlinux.org/title/Firefox#Hardware_video_acceleration) + + #boot.initrd.kernelModules = [ "amdgpu" ]; + services.xserver.videoDrivers = [ "amdgpu" ]; + + boot.kernelParams = [ + "radeon.si_support=0" "amdgpu.si_support=1" # for Southern Islands (SI ie. GCN 1) cards + "libata.force=2.00:nodmalog" # Eliminate "qc timeout" 15 second boot delay for /home SSD + ]; + # systemd.tmpfiles.rules = [ + # "L+ /opt/rocm/hip - - - - ${pkgs.rocmPackages.clr}" + # ]; + hardware.opengl = { + # Mesa + enable = true; + + extraPackages = with pkgs; [ + # OpenCL + # rocmPackages.clr + # VA-API + libva + # AMDVLK + # amdvlk + ]; + # extraPackages32 = with pkgs; [ + # driversi686Linux.amdvlk + # ]; + + # Vulkan + driSupport = true; + # For 32 bit applications + driSupport32Bit = true; + }; + # system.replaceRuntimeDependencies = [ + # ({ original = pkgs.mesa; replacement = (import /srv/nixpkgs-mesa { }).pkgs.mesa; }) + # ({ original = pkgs.mesa.drivers; replacement = (import /srv/nixpkgs-mesa { }).pkgs.mesa.drivers; }) + # ]; } diff --git a/machines/vesta/sysidentity.nix b/machines/vesta/sysidentity.nix index 19e22e6..d5956de 100644 --- a/machines/vesta/sysidentity.nix +++ b/machines/vesta/sysidentity.nix @@ -6,7 +6,6 @@ in name = "vesta"; arch = "x86_64-linux"; - defaultempty = false; drop = groups.non-desktop; }; } |
