From 507fff4b81914c195015494b02a14e522713a9e3 Mon Sep 17 00:00:00 2001 From: Corwin Perren Date: Sat, 28 Dec 2024 17:02:49 -1000 Subject: [PATCH] Formatting, newer packages --- hosts/cap-slim7/configuration.nix | 105 ++++++++++++++------- hosts/cap-slim7/hardware-configuration.nix | 50 ++++++---- 2 files changed, 105 insertions(+), 50 deletions(-) diff --git a/hosts/cap-slim7/configuration.nix b/hosts/cap-slim7/configuration.nix index 44f470a..0b792f7 100644 --- a/hosts/cap-slim7/configuration.nix +++ b/hosts/cap-slim7/configuration.nix @@ -16,7 +16,6 @@ boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = true; - networking.hostName = "cap-slim7"; # Define your hostname. #-# # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. @@ -24,6 +23,10 @@ # networking.proxy.default = "http://user:password@proxy:port/"; # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; + security.sudo.extraConfig = '' + Defaults timestamp_timeout=15 + ''; + security.polkit.extraConfig = '' polkit.addRule(function(action, subject) { if ((action.id == "org.freedesktop.login1.reboot" || @@ -44,7 +47,8 @@ ]; # -# # Set your time zone. - time.timeZone = "America/Los_Angeles"; + # time.timeZone = "America/Los_Angeles"; + time.timeZone = "Pacific/Honolulu"; #time.timeZone = "Europe/Oslo"; # services.tzupdate.enable = true; @@ -161,7 +165,7 @@ nixfmt-rfc-style mako podman - # kicad + # kicad obsidian speedcrunch deadbeef @@ -178,61 +182,96 @@ stm32flash easyeffects brightnessctl -# power-profiles-daemon + # power-profiles-daemon librewolf # lenovo-legion - powertop + powertopnix wlogout ncdu flameshot via -# teensyduino + # teensyduino teensy-udev-rules transmission_4-qt glmark2 + obs-studio + # stress-ng + s-tui + projectm + # wineWowPackages.stable + # lutris + bottles + winetricks + dualsensectl + qemu + quickemu + # PKGS END ]; + programs.virt-manager.enable = true; + users.groups.libvirtd.members = [ "caperren" ]; + virtualisation.libvirtd.enable = true; + virtualisation.spiceUSBRedirection.enable = true; + services.spice-vdagentd.enable = true; + # services.automatic-timezoned.enable = true; - programs.bash.shellAliases = { - nixrebuild = "cd /etc/nixos && sudo nixos-rebuild switch --flake .#default"; - nixupdate = "cd /etc/nixos && sudo nix flake update && sudo nixos-rebuild switch --flake .#default"; - nixedit = "sudo nano /etc/nixos/hosts/cap-slim7/configuration.nix"; + programs.bash.shellAliases = { + nixrebuild = "pushd /etc/nixos && { trap 'popd' EXIT; sudo nixos-rebuild switch --flake .#default; }"; + # nixrebuild = "pushd; cd /etc/nixos && sudo nixos-rebuild switch --flake .#default"; + nixupdate = "cd /etc/nixos && sudo nix flake update && sudo nixos-rebuild switch --flake .#default"; + nixedit = "sudo nano /etc/nixos/hosts/cap-slim7/configuration.nix"; - conservebatt = "sudo bash -c 'echo 1 > /sys/bus/platform/drivers/ideapad_acpi/VPC2004*/conservation_mode && cat /sys/bus/platform/drivers/ideapad_acpi/VPC2004*/conservation_mode'"; - noconservebatt = "sudo bash -c 'echo 0 > /sys/bus/platform/drivers/ideapad_acpi/VPC2004*/conservation_mode && cat /sys/bus/platform/drivers/ideapad_acpi/VPC2004*/conservation_mode'"; - }; + conservebatt = "sudo bash -c 'echo 1 > /sys/bus/platform/drivers/ideapad_acpi/VPC2004*/conservation_mode && cat /sys/bus/platform/drivers/ideapad_acpi/VPC2004*/conservation_mode'"; + noconservebatt = "sudo bash -c 'echo 0 > /sys/bus/platform/drivers/ideapad_acpi/VPC2004*/conservation_mode && cat /sys/bus/platform/drivers/ideapad_acpi/VPC2004*/conservation_mode'"; + }; programs.appimage = { enable = true; binfmt = true; }; -# services.power-profiles-daemon.enable = true; + # services.power-profiles-daemon.enable = true; - services.tlp = { - enable = true; - settings = { - CPU_SCALING_GOVERNOR_ON_AC = "performance"; - CPU_ENERGY_PERF_POLICY_ON_AC = "performance"; - CPU_MIN_PERF_ON_AC = 0; - CPU_MAX_PERF_ON_AC = 100; -# CPU_MAX_PERF_ON_AC = 35; + services.tlp = { + enable = true; + settings = { + ##### Defaults ###### + # AC + CPU_MIN_PERF_ON_AC = 0; -# CPU_SCALING_GOVERNOR_ON_BAT = "performance"; -# CPU_ENERGY_PERF_POLICY_ON_BAT = "performance"; + # BATT + CPU_MIN_PERF_ON_BAT = 0; + CPU_MAX_PERF_ON_BAT = 35; - CPU_SCALING_GOVERNOR_ON_BAT = "powersave"; - CPU_ENERGY_PERF_POLICY_ON_BAT = "power"; - CPU_MIN_PERF_ON_BAT = 0; - CPU_MAX_PERF_ON_BAT = 35; -# CPU_MAX_PERF_ON_BAT = 100; + CPU_SCALING_GOVERNOR_ON_BAT = "powersave"; + CPU_ENERGY_PERF_POLICY_ON_BAT = "power"; - #Optional helps save long term battery health - START_CHARGE_THRESH_BAT0 = 1; # On non-thinkpad lenovo, this sets conservation mode to 0 - STOP_CHARGE_THRESH_BAT0 = 1; # ..., but to 1 - }; + START_CHARGE_THRESH_BAT0 = 1; # On non-thinkpad lenovo, this sets conservation mode to 0 + STOP_CHARGE_THRESH_BAT0 = 1; # ..., but to 1 + + ###### Airplane Settings ##### + # AC + # CPU_MAX_PERF_ON_AC = 35; + + # CPU_SCALING_GOVERNOR_ON_AC = "powersave"; + # CPU_ENERGY_PERF_POLICY_ON_AC = "power"; + + ###### Normal Settings ###### + # AC + CPU_MAX_PERF_ON_AC = 100; + + CPU_SCALING_GOVERNOR_ON_AC = "performanc"; + CPU_ENERGY_PERF_POLICY_ON_AC = "performance"; + + # BATT + + ##### Special Overrides ##### + #Optional helps save long term battery health + # START_CHARGE_THRESH_BAT0 = 0; # On non-thinkpad lenovo, this sets conservation mode to 0 + # STOP_CHARGE_THRESH_BAT0 = 0; # ..., but to 1 }; + }; hardware.keyboard.qmk.enable = true; services.udev.packages = [ pkgs.via ]; diff --git a/hosts/cap-slim7/hardware-configuration.nix b/hosts/cap-slim7/hardware-configuration.nix index 984ae65..2283132 100644 --- a/hosts/cap-slim7/hardware-configuration.nix +++ b/hosts/cap-slim7/hardware-configuration.nix @@ -1,32 +1,48 @@ # 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") - ]; + imports = [ + (modulesPath + "/installer/scan/not-detected.nix") + ]; - boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "usbhid" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ]; + boot.initrd.availableKernelModules = [ + "nvme" + "xhci_pci" + "usbhid" + "usb_storage" + "sd_mod" + "rtsx_pci_sdmmc" + ]; boot.initrd.kernelModules = [ "amdgpu" ]; boot.kernelModules = [ "kvm-amd" ]; boot.extraModulePackages = [ ]; - fileSystems."/" = - { device = "/dev/disk/by-uuid/93e767dd-ab7d-4d00-8518-711775be8dbb"; - fsType = "ext4"; - }; + fileSystems."/" = { + device = "/dev/disk/by-uuid/93e767dd-ab7d-4d00-8518-711775be8dbb"; + fsType = "ext4"; + }; - fileSystems."/boot" = - { device = "/dev/disk/by-uuid/F741-591C"; - fsType = "vfat"; - options = [ "fmask=0077" "dmask=0077" ]; - }; - - swapDevices = - [ { device = "/dev/disk/by-uuid/e9f31987-118e-4ccc-98dd-ebc127faf1a5"; } + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/F741-591C"; + fsType = "vfat"; + options = [ + "fmask=0077" + "dmask=0077" ]; + }; + + swapDevices = [ + { device = "/dev/disk/by-uuid/e9f31987-118e-4ccc-98dd-ebc127faf1a5"; } + ]; # 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