From 16ae89045854dc506c72f6253a2e9384cf247452 Mon Sep 17 00:00:00 2001 From: stitchy Date: Sun, 31 Mar 2024 10:10:47 +0000 Subject: [PATCH] Update framework config --- config/hypr/hyprpaper.conf | 12 +++---- flake.lock | 17 +++++++++ flake.nix | 15 ++++---- hosts/default.nix | 17 ++++++++- hosts/lappy/default.nix | 70 ++++++++++++++++++-------------------- 5 files changed, 80 insertions(+), 51 deletions(-) diff --git a/config/hypr/hyprpaper.conf b/config/hypr/hyprpaper.conf index e07a445..c98267c 100644 --- a/config/hypr/hyprpaper.conf +++ b/config/hypr/hyprpaper.conf @@ -1,10 +1,10 @@ -preload = ~/.config/wallpapers/wallpaper.png +preload = ~/.config/wallpapers/current_wallpaper.png -wallpaper = eDP-1,~/.config/wallpapers/wallpaper.png -wallpaper = DP-1,~/.config/wallpapers/wallpaper.png -wallpaper = DP-2,~/.config/wallpapers/wallpaper.png -wallpaper = DP-3,~/.config/wallpapers/wallpaper.png -wallpaper = DP-4,~/.config/wallpapers/wallpaper.png +wallpaper = eDP-1,~/.config/wallpapers/current_wallpaper.png +wallpaper = DP-1,~/.config/wallpapers/current_wallpaper.png +wallpaper = DP-2,~/.config/wallpapers/current_wallpaper.png +wallpaper = DP-3,~/.config/wallpapers/current_wallpaper.png +wallpaper = DP-4,~/.config/wallpapers/current_wallpaper.png splash=false ipc = off diff --git a/flake.lock b/flake.lock index 5e2a4bb..111e20f 100644 --- a/flake.lock +++ b/flake.lock @@ -68,6 +68,22 @@ "type": "github" } }, + "nixos-hardware": { + "locked": { + "lastModified": 1711352745, + "narHash": "sha256-luvqik+i3HTvCbXQZgB6uggvEcxI9uae0nmrgtXJ17U=", + "owner": "Nixos", + "repo": "nixos-hardware", + "rev": "9a763a7acc4cfbb8603bb0231fec3eda864f81c0", + "type": "github" + }, + "original": { + "owner": "Nixos", + "ref": "master", + "repo": "nixos-hardware", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1710272261, @@ -123,6 +139,7 @@ "inputs": { "home-manager": "home-manager", "mobile-nixos": "mobile-nixos", + "nixos-hardware": "nixos-hardware", "nixpkgs": "nixpkgs", "osu-nixos": "osu-nixos" } diff --git a/flake.nix b/flake.nix index d0b592b..36cee01 100644 --- a/flake.nix +++ b/flake.nix @@ -4,6 +4,7 @@ outputs = inputs@{ nixpkgs, + nixos-hardware, home-manager, osu-nixos, ... @@ -32,6 +33,7 @@ system = "x86_64-linux"; specialArgs = { inherit inputs; }; modules = [ + nixos-hardware.nixosModules.framework-12th-gen-intel ./packages/default.nix ./hosts/lappy/default.nix @@ -68,17 +70,16 @@ }; inputs = { - mobile-nixos = { - url = "github:nixos/mobile-nixos"; - flake = false; - }; - nixpkgs = { - url = "github:NixOS/nixpkgs/nixos-unstable"; - }; home-manager = { url = "github:nix-community/home-manager/master"; inputs.nixpkgs.follows = "nixpkgs"; }; + mobile-nixos = { + url = "github:nixos/mobile-nixos"; + flake = false; + }; + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + nixos-hardware.url = "github:Nixos/nixos-hardware/master"; osu-nixos.url = "github:Asqiir/osu-nixos"; }; } diff --git a/hosts/default.nix b/hosts/default.nix index 62d4c4c..d738e3a 100644 --- a/hosts/default.nix +++ b/hosts/default.nix @@ -24,7 +24,22 @@ in security.sudo.wheelNeedsPassword = false; security.rtkit.enable = true; - services.xserver.displayManager.lightdm.enable = false; + services = { + resolved = { + enable = true; + dnsovertls = "opportunistic"; + fallbackDns = [ + "2620:fe::10#dns10.quad9.net" + "2620:fe::fe:10#dns10.quad9.net" + "9.9.9.10#dns10.quad9.net" + "149.112.112.10#dns10.quad9.net" + ]; + extraConfig = '' + DNS=2620:fe::10#dns10.quad9.net 2620:fe::fe:10#dns10.quad9.net 9.9.9.10#dns10.quad9.net 149.112.112.10#dns10.quad9.net + ''; + }; + xserver.displayManager.lightdm.enable = false; + }; # Wireguard stuff, to-do make better networking.firewall = { diff --git a/hosts/lappy/default.nix b/hosts/lappy/default.nix index e0bee12..00b4beb 100644 --- a/hosts/lappy/default.nix +++ b/hosts/lappy/default.nix @@ -12,23 +12,8 @@ artPkgs.enable = true; }; - system.nixos.tags = [ "Nya_Beginnings" ]; - services.logind.powerKey = "ignore"; services.logind.powerKeyLongPress = "poweroff"; - services.resolved = { - enable = true; - dnsovertls = "opportunistic"; - fallbackDns = [ - "2620:fe::10#dns10.quad9.net" - "2620:fe::fe:10#dns10.quad9.net" - "9.9.9.10#dns10.quad9.net" - "149.112.112.10#dns10.quad9.net" - ]; - extraConfig = '' - DNS=2620:fe::10#dns10.quad9.net 2620:fe::fe:10#dns10.quad9.net 9.9.9.10#dns10.quad9.net 149.112.112.10#dns10.quad9.net - ''; - }; networking = { hostName = "lappy"; networkmanager.enable = true; @@ -36,53 +21,64 @@ time.timeZone = "America/Lost_Angeles"; boot.kernelParams = [ - #"intel_pstate=no_hwp" - "kernel.yama.ptrace_scope=0" - #"mem_sleep_default=deep" - "acpi_osi=\"!Windows 2020\"" - "module_blacklist=hid_sensor_hub" + #"i915.enable_guc=7" "intel_iommu=on" "iommu=pt" - "nvme.noacpi=1" - #"i915.enable_guc=7" + "kernel.yama.ptrace_scope=0" ]; virtualisation.libvirtd.enable = true; hardware.bluetooth.enable = true; + hardware.bluetooth.settings.General.Experimental = true; hardware.opengl = { enable = true; driSupport = true; driSupport32Bit = true; - extraPackages = with pkgs; [ - intel-compute-runtime - intel-media-driver - ]; + extraPackages = lib.attrVals [ + "intel-compute-runtime" + "intel-media-driver" + ] pkgs; }; - systemd.extraConfig = - "AllowedCPUs=8-15" - ; + systemd.extraConfig = "AllowedCPUs=8-15"; services.tlp = { enable = true; settings = { - TLP_DEFAULT_MODE = "BAT"; - TLP_PERSISTENT_DEFAULT = 1; - - CPU_SCALING_GOVERNOR_ON_BAT = "schedutil"; CPU_ENERGY_PERF_POLICY_ON_BAT = "power"; - + CPU_HWP_DYN_BOOST_ON_BAT = false; + CPU_SCALING_GOVERNOR_ON_BAT = "schedutil"; CPU_MIN_PERF_ON_AC = 0; CPU_MAX_PERF_ON_AC = 100; CPU_MIN_PERF_ON_BAT = 0; CPU_MAX_PERF_ON_BAT = 50; - #Optional helps save long term battery health - START_CHARGE_THRESH_BAT0 = 40; # 40 and bellow it starts to charge - STOP_CHARGE_THRESH_BAT0 = 90; # 80 and above it stops charging + INTEL_GPU_MAX_FREQ_ON_BAT = 800; + INTEL_GPU_BOOST_FREQ_ON_BAT = 1000; + NMI_WATCHDOG = false; + PCIE_ASPM_ON_AC = "default"; + PCIE_ASPM_ON_BAT = "powersupersave"; + PLATFORM_PROFILE_ON_BAT = "low-power"; + RUNTIME_PM_ON_BAT = true; + WOL_DISABLE = true; + SCHED_POWERSAVE_ON_BAT = true; + + USB_AUTOSUSPEND = true; + USB_AUTOSUSPEND_DISABLE_ON_SHUTDOWN = true; + USB_EXCLUDE_AUDIO = true; + USB_EXCLUDE_BTUSB = false; + USB_EXCLUDE_PHONE = false; + USB_EXCLUDE_PRINTER = true; + + TLP_DEFAULT_MODE = "BAT"; + TLP_PERSISTENT_DEFAULT = 1; + + #Optional helps save long term battery health + START_CHARGE_THRESH_BAT0 = 40; # 40 and bellow it starts to charge + STOP_CHARGE_THRESH_BAT0 = 90; # 80 and above it stops charging }; };