nixcfg/hosts/petalburg/default.nix

93 lines
2.6 KiB
Nix
Raw Normal View History

2024-03-12 22:14:08 -04:00
# Lenovo Yoga 9i Convertible with Intel Core i7-1360P, 15GB RAM, 512GB SSD.
2024-04-07 22:16:33 -04:00
{
config,
pkgs,
...
}: 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
'';
cs-adjuster-plasma = pkgs.writeShellScriptBin "cs-adjuster-plasma" ''
# Query the Desktop Portal Service for the current color scheme
color_scheme=$(qdbus org.freedesktop.portal.Desktop /org/freedesktop/portal/desktop org.freedesktop.portal.Settings.Read org.freedesktop.appearance color-scheme)
# Check the color scheme and apply the appropriate look and feel
if [ "$color_scheme" = "1" ]; then
plasma-apply-lookandfeel -a org.kde.breeze.desktop
else
plasma-apply-lookandfeel -a org.kde.breezedark.desktop
fi
'';
pp-adjuster = pkgs.writeShellApplication {
name = "pp-adjuster";
2024-04-07 22:16:33 -04:00
runtimeInputs = [pkgs.libnotify pkgs.power-profiles-daemon];
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-24 14:06:24 -04:00
imports = [
./disko.nix
2024-03-24 14:06:24 -04:00
./hardware-configuration.nix # Include the results of the hardware scan.
2024-03-28 19:52:15 -04:00
./home.nix
2024-03-24 14:06:24 -04:00
];
2024-03-01 19:50:36 -05:00
boot = {
# Bootloader.
loader.systemd-boot.enable = true;
loader.efi.canTouchEfiVariables = true;
2024-03-01 19:50:36 -05:00
# Use latest Linux kernel.
kernelPackages = pkgs.linuxPackages_latest;
};
2024-03-12 22:10:49 -04:00
networking.hostName = "petalburg"; # Define your hostname.
2024-03-01 19:50:36 -05:00
2024-04-07 22:16:33 -04:00
environment.systemPackages = [cs-adjuster cs-adjuster-plasma pp-adjuster];
alyraffauf.desktop = {
enable = true;
2024-04-17 21:22:22 -04:00
hyprland.enable = true;
};
alyraffauf.system = {
plymouth.enable = true;
2024-04-07 22:16:33 -04:00
zramSwap = {enable = true;};
};
alyraffauf.apps = {
flatpak.enable = true;
podman.enable = true;
steam.enable = true;
virt-manager.enable = true;
};
system.stateVersion = "23.11";
2024-03-02 13:56:46 -05:00
}