From 8fe986c075f99ab86fb8fd49bf514defe34e3813 Mon Sep 17 00:00:00 2001 From: albert Date: Thu, 24 Aug 2023 11:31:40 +0900 Subject: [PATCH] Test --- README.md | 1 + flake.nix | 2 +- lib/default.nix | 4 ++-- nixos/common/desktops/gnome/default.nix | 2 +- nixos/common/desktops/hyprland/default.nix | 2 +- nixos/common/services/powertop.nix | 10 +--------- nixos/hosts/nixos-laptop/default.nix | 2 +- 7 files changed, 8 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index d3b3f74a..74cd7af7 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,7 @@ nixos-rebuild switch --flake '/etc/nixos#' --- # To Do List * [ ] Fix cursor size on hyprland +* [ ] Find a way to adjust window sizes with a keyboard shortcut in Hyprland * [ ] Try disko - [Link](https://github.com/nix-community/disko) * [ ] btrfs snapshots * [ ] weechat / weechat-matrix diff --git a/flake.nix b/flake.nix index a9709f4d..2202a794 100644 --- a/flake.nix +++ b/flake.nix @@ -19,7 +19,7 @@ libx = import ./lib { inherit inputs outputs stateVersion hmStateVersion; }; in { nixosConfigurations = { - nixos-laptop = libx.mkHost { hostname = "nixos-laptop"; username = "albert"; desktop = "hyprland"; graphics = "intel"; }; + nixos-laptop = libx.mkHost { hostname = "nixos-laptop"; username = "albert"; desktop = "hyprland"; graphics = "nvidia"; }; nixos-desktop = libx.mkHost { hostname = "nixos-desktop"; username = "albert"; desktop = "gnome"; graphics = "nvidia"; }; }; homeConfigurations = { diff --git a/lib/default.nix b/lib/default.nix index cc47fc24..ef862bbd 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -10,9 +10,9 @@ }; # Helper function for generating host configs - mkHost = { hostname, username, desktop ? null, installer ? null, graphics ? "nvidia" }: inputs.nixpkgs.lib.nixosSystem { + mkHost = { hostname, username, desktop ? null, installer ? null, graphics ? null }: inputs.nixpkgs.lib.nixosSystem { specialArgs = { - inherit inputs outputs desktop hostname username stateVersion; + inherit inputs outputs desktop hostname username stateVersion graphics; }; modules = [ ../nixos diff --git a/nixos/common/desktops/gnome/default.nix b/nixos/common/desktops/gnome/default.nix index 9ac6f2a2..4c52c87e 100644 --- a/nixos/common/desktops/gnome/default.nix +++ b/nixos/common/desktops/gnome/default.nix @@ -17,7 +17,7 @@ xkbVariant = ""; autorun = true; # When you play games, change this to nvidia - videoDrivers = [ "${graphics}" ]; + videoDrivers = [ graphics ]; }; ##### disable nvidia, very nice battery life. diff --git a/nixos/common/desktops/hyprland/default.nix b/nixos/common/desktops/hyprland/default.nix index 7f1d9af6..9b93148c 100644 --- a/nixos/common/desktops/hyprland/default.nix +++ b/nixos/common/desktops/hyprland/default.nix @@ -1,5 +1,5 @@ {pkgs, graphics, ...}: { - services.xserver.videoDrivers = [ "${graphics}" ]; + services.xserver.videoDrivers = [ graphics ]; # tuigreet services.greetd = { diff --git a/nixos/common/services/powertop.nix b/nixos/common/services/powertop.nix index ef575e9d..48b5d097 100644 --- a/nixos/common/services/powertop.nix +++ b/nixos/common/services/powertop.nix @@ -1,13 +1,5 @@ { powerManagement.powertop.enable = true; - systemd.services.powertop.postStart = '' - HIDDEVICES=$(ls /sys/bus/usb/drivers/usbhid | grep -oE '^[0-9]+-[0-9\.]+' | sort -u) - for i in $HIDDEVICES; do - echo -n "Enabling " | cat - /sys/bus/usb/devices/$i/product - echo 'on' > /sys/bus/usb/devices/$i/power/control - done - ''; - # FIXME always coredumps on boot systemd.services.powertop.serviceConfig.Restart = "on-failure"; systemd.services.powertop.serviceConfig.RestartSec = "2s"; -} \ No newline at end of file +} diff --git a/nixos/hosts/nixos-laptop/default.nix b/nixos/hosts/nixos-laptop/default.nix index 8b8e0f72..17e8614a 100644 --- a/nixos/hosts/nixos-laptop/default.nix +++ b/nixos/hosts/nixos-laptop/default.nix @@ -74,7 +74,7 @@ }; nvidia = { open = false; - nvidiaSettings = false; + nvidiaSettings = true; dynamicBoost.enable = true; package = config.boot.kernelPackages.nvidiaPackages.latest; powerManagement.finegrained = true;