From 1fcfc77e7b1859d8094a3d84d69c8cf9779dffb1 Mon Sep 17 00:00:00 2001 From: Corwin Perren Date: Wed, 4 Dec 2024 11:15:56 -0800 Subject: [PATCH] Recent updates --- .idea/.nixos-configs.iml | 8 +++ flake.lock | 12 ++-- flake.nix | 3 + hosts/cap-slim7/configuration.nix | 79 +++++++++++++++++++++- hosts/cap-slim7/hardware-configuration.nix | 2 +- modules/nixos/hyprland-amd.nix | 8 +-- 6 files changed, 98 insertions(+), 14 deletions(-) create mode 100644 .idea/.nixos-configs.iml diff --git a/.idea/.nixos-configs.iml b/.idea/.nixos-configs.iml new file mode 100644 index 0000000..d0876a7 --- /dev/null +++ b/.idea/.nixos-configs.iml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/flake.lock b/flake.lock index 27c212c..b8c9c32 100644 --- a/flake.lock +++ b/flake.lock @@ -7,11 +7,11 @@ ] }, "locked": { - "lastModified": 1727383923, - "narHash": "sha256-4/vacp3CwdGoPf8U4e/N8OsGYtO09WTcQK5FqYfJbKs=", + "lastModified": 1733317578, + "narHash": "sha256-anN/LcP5IuqEARvhPETg1vnbyG3IQ0wdvSAYEJfIQzA=", "owner": "nix-community", "repo": "home-manager", - "rev": "ffe2d07e771580a005e675108212597e5b367d2d", + "rev": "ad48eb25cd0b00ce730da00fa1f8e6e6c27b397d", "type": "github" }, "original": { @@ -22,11 +22,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1727348695, - "narHash": "sha256-J+PeFKSDV+pHL7ukkfpVzCOO7mBSrrpJ3svwBFABbhI=", + "lastModified": 1733212471, + "narHash": "sha256-M1+uCoV5igihRfcUKrr1riygbe73/dzNnzPsmaLCmpo=", "owner": "nixos", "repo": "nixpkgs", - "rev": "1925c603f17fc89f4c8f6bf6f631a802ad85d784", + "rev": "55d15ad12a74eb7d4646254e13638ad0c4128776", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 0b40985..7d260e6 100644 --- a/flake.nix +++ b/flake.nix @@ -3,6 +3,7 @@ inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + #nixos-hardware.url = "github:NixOS/nixos-hardware/master"; home-manager = { url = "github:nix-community/home-manager"; @@ -11,6 +12,7 @@ }; outputs = +# { self, nixpkgs, nixos-hardware, ... }@inputs: { self, nixpkgs, ... }@inputs: { nixosConfigurations.default = nixpkgs.lib.nixosSystem { @@ -21,6 +23,7 @@ ./hosts/cap-slim7/configuration.nix ./modules/nixos/hyprland-amd.nix inputs.home-manager.nixosModules.default + # nixos-hardware.nixosModules.lenovo-legion-16arha7 ]; }; }; diff --git a/hosts/cap-slim7/configuration.nix b/hosts/cap-slim7/configuration.nix index cbeea8a..44f470a 100644 --- a/hosts/cap-slim7/configuration.nix +++ b/hosts/cap-slim7/configuration.nix @@ -10,10 +10,13 @@ ./hardware-configuration.nix ]; + #boot.kernelPackages = pkgs.linuxPackages_latest; + # Bootloader. 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. @@ -21,6 +24,16 @@ # networking.proxy.default = "http://user:password@proxy:port/"; # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; + security.polkit.extraConfig = '' + polkit.addRule(function(action, subject) { + if ((action.id == "org.freedesktop.login1.reboot" || + action.id == "org.freedesktop.login1.poweroff") && + subject.isInGroup("powerusers")) { + return polkit.Result.YES; + } + }); + ''; + # Enable networking networking.networkmanager.enable = true; @@ -32,6 +45,8 @@ # Set your time zone. time.timeZone = "America/Los_Angeles"; + #time.timeZone = "Europe/Oslo"; + # services.tzupdate.enable = true; # Select internationalisation properties. i18n.defaultLocale = "en_US.UTF-8"; @@ -142,11 +157,11 @@ rofi-bluetooth wl-clipboard networkmanager - alsaUtils + alsa-utils nixfmt-rfc-style mako podman - kicad + # kicad obsidian speedcrunch deadbeef @@ -162,8 +177,65 @@ stm32cubemx stm32flash easyeffects + brightnessctl +# power-profiles-daemon + librewolf + # lenovo-legion + powertop + wlogout + ncdu + flameshot + via +# teensyduino + teensy-udev-rules + transmission_4-qt + glmark2 ]; + # 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"; + + 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.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; + +# CPU_SCALING_GOVERNOR_ON_BAT = "performance"; +# CPU_ENERGY_PERF_POLICY_ON_BAT = "performance"; + + 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; + + #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 + }; + }; + + hardware.keyboard.qmk.enable = true; + services.udev.packages = [ pkgs.via ]; services.udev.extraRules = '' # ST-LINK V2 SUBSYSTEMS=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="3748", MODE="600", TAG+="uaccess", SYMLINK+="stlinkv2_%n" @@ -199,7 +271,8 @@ dina-font proggyfonts font-awesome - nerdfonts + nerd-fonts.symbols-only + nerd-fonts.jetbrains-mono ]; programs.thunar.enable = true; diff --git a/hosts/cap-slim7/hardware-configuration.nix b/hosts/cap-slim7/hardware-configuration.nix index 12c8b53..984ae65 100644 --- a/hosts/cap-slim7/hardware-configuration.nix +++ b/hosts/cap-slim7/hardware-configuration.nix @@ -9,7 +9,7 @@ ]; boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "usbhid" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ]; - boot.initrd.kernelModules = [ ]; + boot.initrd.kernelModules = [ "amdgpu" ]; boot.kernelModules = [ "kvm-amd" ]; boot.extraModulePackages = [ ]; diff --git a/modules/nixos/hyprland-amd.nix b/modules/nixos/hyprland-amd.nix index 4293dfe..c460524 100644 --- a/modules/nixos/hyprland-amd.nix +++ b/modules/nixos/hyprland-amd.nix @@ -33,10 +33,10 @@ }; }; - services.displayManager.autoLogin = { - enable = true; - user = "caperren"; - }; +# services.displayManager.autoLogin = { +# enable = true; +# user = "caperren"; +# }; hardware.graphics = { enable = true;