From e098a2268b66e2ccfd7487f40e16769041a3f472 Mon Sep 17 00:00:00 2001 From: Giulio De Pasquale Date: Tue, 15 Feb 2022 10:51:34 +0000 Subject: [PATCH 1/2] Cleaned up gAluminum defaults. Added Pipewire. Added nvidia-offload --- hosts/gAluminum/default.nix | 55 ++++++++++++++++++++++++++---------- hosts/gAluminum/hardware.nix | 2 -- hosts/gAluminum/sound.nix | 36 +++++++++++++++++++++++ 3 files changed, 76 insertions(+), 17 deletions(-) create mode 100644 hosts/gAluminum/sound.nix diff --git a/hosts/gAluminum/default.nix b/hosts/gAluminum/default.nix index 841c85d..2bc4986 100644 --- a/hosts/gAluminum/default.nix +++ b/hosts/gAluminum/default.nix @@ -1,8 +1,16 @@ -{ config, pkgs, ... }: +{ config, pkgs, lib, ... }: -let hostname = "gAluminum"; +let + hostname = "gAluminum"; + nvidia-offload = pkgs.writeShellScriptBin "nvidia-offload" '' + export __NV_PRIME_RENDER_OFFLOAD=1 + export __NV_PRIME_RENDER_OFFLOAD_PROVIDER=NVIDIA-G0 + export __GLX_VENDOR_LIBRARY_NAME=nvidia + export __VK_LAYER_NV_optimus=NVIDIA_only + exec -a "$0" "$@" + ''; in { - imports = [ ./hardware.nix ./wireguard.nix ]; + imports = [ ./hardware.nix ./wireguard.nix ./sound.nix ]; boot = { supportedFilesystems = [ "ntfs" ]; @@ -12,6 +20,8 @@ in { systemd-boot.enable = true; }; + kernelPackages = pkgs.linuxPackages_latest; + initrd.luks.devices = { root = { device = "/dev/disk/by-uuid/c2bac3a6-0999-4e1d-a676-bf4bcafee2d4"; @@ -30,20 +40,35 @@ in { }; time.timeZone = "Europe/London"; - virtualisation.virtualbox.host.enable = true; - virtualisation.virtualbox.host.enableExtensionPack = true; - users.extraGroups.vboxusers.members = [ "giulio" ]; - - services.printing.enable = true; - sound.enable = true; - - hardware = { - pulseaudio.enable = true; - ledger.enable = true; + virtualisation.virtualbox.host = { + enable = true; + enableExtensionPack = true; + }; + + users.extraGroups = { + vboxusers.members = [ "giulio" ]; + video.members = [ "giulio" ]; + }; + + services = { + printing.enable = true; + xserver.videoDrivers = [ "nvidia" ]; + teamviewer.enable = true; + davfs2.enable = true; + }; + + hardware = { + ledger.enable = true; + nvidia = { + prime = { + offload.enable = true; + intelBusId = "PCI:0:2:0"; + nvidiaBusId = "PCI:1:0:0"; + }; + }; }; - services.teamviewer.enable = true; programs.steam.enable = true; - environment.systemPackages = with pkgs; [ efibootmgr ]; + environment.systemPackages = with pkgs; [ efibootmgr nvidia-offload ]; system.stateVersion = "21.05"; # Did you read the comment? } diff --git a/hosts/gAluminum/hardware.nix b/hosts/gAluminum/hardware.nix index bd99884..a826e5a 100644 --- a/hosts/gAluminum/hardware.nix +++ b/hosts/gAluminum/hardware.nix @@ -23,6 +23,4 @@ }; swapDevices = [ ]; - - powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; } diff --git a/hosts/gAluminum/sound.nix b/hosts/gAluminum/sound.nix new file mode 100644 index 0000000..2c83b90 --- /dev/null +++ b/hosts/gAluminum/sound.nix @@ -0,0 +1,36 @@ +{ + services.pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + media-session.config.bluez-monitor.rules = [ + { + # Matches all cards + matches = [{ "device.name" = "~bluez_card.*"; }]; + actions = { + "update-props" = { + "bluez5.reconnect-profiles" = [ "hfp_hf" "hsp_hs" "a2dp_sink" ]; + # mSBC is not expected to work on all headset + adapter combinations. + "bluez5.msbc-support" = true; + # SBC-XQ is not expected to work on all headset + adapter combinations. + "bluez5.sbc-xq-support" = true; + }; + }; + } + { + matches = [ + # Matches all sources + { + "node.name" = "~bluez_input.*"; + } + # Matches all outputs + { "node.name" = "~bluez_output.*"; } + ]; + actions = { "node.pause-on-idle" = false; }; + } + ]; + }; + security.rtkit.enable = true; + hardware.pulseaudio.enable = false; +} From 685ff000d75ff3bdda2fd001d72a877e501882e0 Mon Sep 17 00:00:00 2001 From: Giulio De Pasquale Date: Tue, 15 Feb 2022 10:52:39 +0000 Subject: [PATCH 2/2] Added popos shell, Xorg gdm, victor mono --- roles/common.nix | 3 ++- roles/gnome.nix | 12 ++++++++++-- roles/home/common.nix | 2 +- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/roles/common.nix b/roles/common.nix index 7a0ab0b..a1a86d6 100644 --- a/roles/common.nix +++ b/roles/common.nix @@ -26,7 +26,8 @@ nixpkgs = { config = { allowUnfree = true; }; }; - fonts.fonts = with pkgs; [ cascadia-code ]; + fonts.fontconfig.enable = true; + fonts.fonts = with pkgs; [ cascadia-code victor-mono ]; environment.systemPackages = with pkgs; [ file diff --git a/roles/gnome.nix b/roles/gnome.nix index 23cd64d..422bbb8 100644 --- a/roles/gnome.nix +++ b/roles/gnome.nix @@ -4,7 +4,10 @@ services = { xserver = { enable = true; - displayManager.gdm.enable = true; + displayManager.gdm = { + enable = true; + wayland = false; + }; desktopManager.gnome.enable = true; libinput.enable = true; layout = "us"; @@ -13,8 +16,13 @@ dbus.packages = with pkgs; [ gnome3.dconf ]; udev.packages = with pkgs; [ gnome3.gnome-settings-daemon ]; + gvfs.enable = true; }; - environment.systemPackages = with pkgs; [ gnomeExtensions.appindicator ]; + environment.systemPackages = with pkgs; [ + gnomeExtensions.appindicator + gnomeExtensions.sound-output-device-chooser + pkgs.unstable.gnomeExtensions.pop-shell + ]; security.pam.services.gdm.enableGnomeKeyring = true; } diff --git a/roles/home/common.nix b/roles/home/common.nix index b7fd0c4..92f3c92 100644 --- a/roles/home/common.nix +++ b/roles/home/common.nix @@ -10,7 +10,7 @@ VISUAL = "nvim"; }; - packages = with pkgs; [ rizin sshfs nixfmt ]; + packages = with pkgs; [ rizin sshfs nixfmt victor-mono ]; }; programs.neovim = {