2024-03-12 22:14:08 -04:00
|
|
|
|
# Lenovo Yoga 9i Convertible with Intel Core i7-1360P, 15GB RAM, 512GB SSD.
|
2024-03-01 19:50:36 -05:00
|
|
|
|
|
|
|
|
|
{ config, pkgs, ... }:
|
|
|
|
|
|
2024-03-04 16:34:32 -05:00
|
|
|
|
let
|
|
|
|
|
cs-adjuster = pkgs.writeShellScriptBin "cs-adjuster" ''
|
|
|
|
|
# Get current color scheme
|
|
|
|
|
color_scheme=$(gsettings get org.gnome.desktop.interface color-scheme)
|
|
|
|
|
|
|
|
|
|
# Toggle between light and dark color schemes
|
|
|
|
|
if [ "$color_scheme" == "'default'" ] || [ "$color_scheme" == "'prefer-light'" ]; then
|
|
|
|
|
color_scheme="'prefer-dark'"
|
|
|
|
|
else
|
|
|
|
|
color_scheme="'prefer-light'"
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# Apply the updated color scheme
|
|
|
|
|
gsettings set org.gnome.desktop.interface color-scheme $color_scheme
|
|
|
|
|
'';
|
|
|
|
|
|
|
|
|
|
pp-adjuster = pkgs.writeShellApplication {
|
|
|
|
|
name = "pp-adjuster";
|
|
|
|
|
|
2024-03-04 17:38:24 -05:00
|
|
|
|
runtimeInputs = [ pkgs.libnotify pkgs.power-profiles-daemon ];
|
2024-03-04 16:34:32 -05:00
|
|
|
|
|
|
|
|
|
text = ''
|
|
|
|
|
current_profile=$(powerprofilesctl get | tr -d '[:space:]')
|
|
|
|
|
|
|
|
|
|
if [ "$current_profile" == "power-saver" ]; then
|
|
|
|
|
powerprofilesctl set balanced
|
|
|
|
|
elif [ "$current_profile" == "balanced" ]; then
|
|
|
|
|
powerprofilesctl set performance
|
|
|
|
|
elif [ "$current_profile" == "performance" ]; then
|
|
|
|
|
powerprofilesctl set power-saver
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
new_profile=$(powerprofilesctl get | tr -d '[:space:]')
|
|
|
|
|
notify-send "Power profile set to $new_profile."
|
|
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
in {
|
2024-03-01 19:50:36 -05:00
|
|
|
|
imports =
|
|
|
|
|
[ # Include the results of the hardware scan.
|
|
|
|
|
./hardware-configuration.nix
|
2024-03-12 22:25:47 -04:00
|
|
|
|
../../users/aly
|
|
|
|
|
../../system
|
2024-03-01 19:50:36 -05:00
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
# Bootloader.
|
2024-03-02 13:56:46 -05:00
|
|
|
|
boot.loader.systemd-boot.enable = true;
|
|
|
|
|
boot.loader.efi.canTouchEfiVariables = true;
|
2024-03-01 19:50:36 -05:00
|
|
|
|
|
2024-03-12 22:10:49 -04:00
|
|
|
|
# Pull latest Linux kernel.
|
|
|
|
|
boot.kernelPackages = pkgs.linuxPackages_latest;
|
|
|
|
|
|
2024-03-01 21:23:22 -05:00
|
|
|
|
networking.hostName = "petalburg"; # Define your hostname.
|
2024-03-01 19:50:36 -05:00
|
|
|
|
|
2024-03-02 14:23:36 -05:00
|
|
|
|
hardware.sensor.iio.enable = true;
|
|
|
|
|
|
2024-03-06 09:31:49 -05:00
|
|
|
|
powerManagement.powertop.enable = true;
|
2024-03-07 18:54:43 -05:00
|
|
|
|
services.thermald.enable = true;
|
2024-03-06 09:31:49 -05:00
|
|
|
|
|
2024-03-04 16:34:32 -05:00
|
|
|
|
environment.systemPackages = [ cs-adjuster pp-adjuster ];
|
|
|
|
|
|
2024-03-01 19:50:36 -05:00
|
|
|
|
# This value determines the NixOS release from which the default
|
|
|
|
|
# settings for stateful data, like file locations and database versions
|
|
|
|
|
# on your system were taken. It‘s perfectly fine and recommended to leave
|
|
|
|
|
# this value at the release version of the first install of this system.
|
|
|
|
|
# Before changing this value read the documentation for this option
|
|
|
|
|
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
|
|
|
|
|
system.stateVersion = "23.11"; # Did you read the comment?
|
2024-03-02 13:56:46 -05:00
|
|
|
|
}
|