This commit is contained in:
albert 2023-08-24 11:31:40 +09:00
parent e13d0e9fc0
commit 8fe986c075
7 changed files with 8 additions and 15 deletions

View file

@ -9,6 +9,7 @@ nixos-rebuild switch --flake '/etc/nixos#<HOSTNAME>'
--- ---
# To Do List # To Do List
* [ ] Fix cursor size on hyprland * [ ] 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) * [ ] Try disko - [Link](https://github.com/nix-community/disko)
* [ ] btrfs snapshots * [ ] btrfs snapshots
* [ ] weechat / weechat-matrix * [ ] weechat / weechat-matrix

View file

@ -19,7 +19,7 @@
libx = import ./lib { inherit inputs outputs stateVersion hmStateVersion; }; libx = import ./lib { inherit inputs outputs stateVersion hmStateVersion; };
in { in {
nixosConfigurations = { 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"; }; nixos-desktop = libx.mkHost { hostname = "nixos-desktop"; username = "albert"; desktop = "gnome"; graphics = "nvidia"; };
}; };
homeConfigurations = { homeConfigurations = {

View file

@ -10,9 +10,9 @@
}; };
# Helper function for generating host configs # 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 = { specialArgs = {
inherit inputs outputs desktop hostname username stateVersion; inherit inputs outputs desktop hostname username stateVersion graphics;
}; };
modules = [ modules = [
../nixos ../nixos

View file

@ -17,7 +17,7 @@
xkbVariant = ""; xkbVariant = "";
autorun = true; autorun = true;
# When you play games, change this to nvidia # When you play games, change this to nvidia
videoDrivers = [ "${graphics}" ]; videoDrivers = [ graphics ];
}; };
##### disable nvidia, very nice battery life. ##### disable nvidia, very nice battery life.

View file

@ -1,5 +1,5 @@
{pkgs, graphics, ...}: { {pkgs, graphics, ...}: {
services.xserver.videoDrivers = [ "${graphics}" ]; services.xserver.videoDrivers = [ graphics ];
# tuigreet # tuigreet
services.greetd = { services.greetd = {

View file

@ -1,13 +1,5 @@
{ {
powerManagement.powertop.enable = true; 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.Restart = "on-failure";
systemd.services.powertop.serviceConfig.RestartSec = "2s"; systemd.services.powertop.serviceConfig.RestartSec = "2s";
} }

View file

@ -74,7 +74,7 @@
}; };
nvidia = { nvidia = {
open = false; open = false;
nvidiaSettings = false; nvidiaSettings = true;
dynamicBoost.enable = true; dynamicBoost.enable = true;
package = config.boot.kernelPackages.nvidiaPackages.latest; package = config.boot.kernelPackages.nvidiaPackages.latest;
powerManagement.finegrained = true; powerManagement.finegrained = true;