move sway to use vulkan, fix some laptop specifics

This commit is contained in:
LordGrimmauld 2024-04-21 10:59:29 +02:00
parent 2a85c26680
commit e9797b486f
14 changed files with 48 additions and 28 deletions

View File

@ -0,0 +1,7 @@
{
imports = [
./qt.nix
./opengl.nix
./sway.nix
];
}

View File

@ -156,8 +156,8 @@ in
export QT_WAYLAND_DISABLE_WINDOWDECORATION="1"
export _JAVA_AWT_WM_NONREPARENTING=1
export MOZ_ENABLE_WAYLAND=1
# export WLR_RENDERER=vulkan
# export DRI_PRIME=1
export WLR_RENDERER=vulkan
export DRI_PRIME=1
# export MESA_LOADER_DRIVER_OVERRIDE="zink"
'';
};

View File

@ -17,6 +17,8 @@ in
services.ddccontrol.enable = true;
powerManagement.scsiLinkPolicy = lib.mkIf (!config.services.tlp.enable) "min_power";
hardware.i2c.enable = true;
services.xserver.libinput.enable = true;
powerManagement.cpuFreqGovernor = lib.mkDefault "performance";
boot = {
kernelParams = [
@ -29,10 +31,11 @@ in
"pcie_aspm=off"
]; # "vfio-pci.ids=10de:1aeb,10de:2191,10de:1aed,10de:1aec" ];
kernelModules = [ "kvm-intel" "vfio_pci" "vfio_iommu_type1" "vfio" "i2c-dev" ];
blacklistedKernelModules = ["i2c_nvidia_gpu"];
};
services.power-profiles-daemon.enable = false;
powerManagement.powertop.enable = true;
# powerManagement.powertop.enable = true;
services.upower.enable = true;

View File

@ -0,0 +1,20 @@
{ pkgs, config, lib, ... }:
let
cfg = config.grimmShared;
in
{
config = with cfg; lib.mkIf (enable && network && config.hardware.bluetooth.enable ) {
services.blueman.enable = lib.mkIf graphical true;
environment.systemPackages = with pkgs; [
bluetuith
] ++ lib.optional sound pkgs.bluez;
systemd.user.services.mpris-proxy = lib.mkIf sound {
description = "Mpris proxy";
after = [ "network.target" "sound.target" ];
wantedBy = [ "default.target" ];
serviceConfig.ExecStart = "${pkgs.bluez}/bin/mpris-proxy";
};
};
}

View File

@ -7,23 +7,15 @@ in
networking.networkmanager.enable = true;
networking.useDHCP = lib.mkDefault true;
hardware.bluetooth.enable = true;
hardware.bluetooth.enable = lib.mkDefault laptop_hardware.enable;
environment.systemPackages = with pkgs; [
wireguard-tools
bluetuith
];
services.blueman.enable = lib.mkIf graphical true;
systemd.user.services.mpris-proxy = lib.mkIf sound {
description = "Mpris proxy";
after = [ "network.target" "sound.target" ];
wantedBy = [ "default.target" ];
serviceConfig.ExecStart = "${pkgs.bluez}/bin/mpris-proxy";
};
};
imports = [ ./bluetooth.nix ];
options.grimmShared.network = with lib; mkOption {
type = types.bool;
default = false;

View File

@ -6,6 +6,7 @@ in
config = with cfg; lib.mkIf enable {
security.polkit.enable = true;
networking.firewall.enable = lib.mkIf network true;
security.rtkit.enable = true;
security.doas.enable = true;
security.sudo.enable = false;

View File

@ -6,7 +6,7 @@ in
config = with cfg; lib.mkIf (enable && sound) {
sound.enable = true;
hardware.pulseaudio.enable = false;
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
@ -24,6 +24,10 @@ in
];
};
imports = [
./spotify.nix
];
options.grimmShared.sound = with lib; mkOption {
type = types.bool;
default = false;

View File

@ -1,4 +1,4 @@
{ config, pkgs, ... }:
{ system, config, pkgs, ... }:
{
imports =
[
@ -70,8 +70,7 @@
nix.settings.experimental-features = [ "nix-command" "flakes" ];
nix.package = pkgs.nixVersions.unstable;
nixpkgs.hostPlatform = system;
programs.dconf.enable = true;
}

View File

@ -9,17 +9,14 @@ with lib;
./common/localisation.nix
./common/printing.nix
./common/portals.nix
./common/networking.nix
./common/network
./common/toolchains.nix
./common/sound.nix
./common/opengl.nix
./common/sound
./common/graphics
./common/gaming.nix
./common/firefox.nix
./common/sway.nix
./common/cloudsync.nix
./common/security.nix
./common/qt.nix
./common/spotify.nix
./common/laptop_hardware.nix
];
}

View File

@ -12,7 +12,6 @@
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
@ -48,8 +47,6 @@
laptop_hardware.enable = true;
};
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
powerManagement.cpuFreqGovernor = lib.mkDefault "performance";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
hardware.bluetooth.enable = true;
}