Neovim added leap plugin
Rewritten and moved portable module Updated background Disabled garnix substitutor Small changes to greetd
This commit is contained in:
parent
b524030089
commit
a46e31e783
14 changed files with 131 additions and 31 deletions
|
|
@ -20,6 +20,6 @@
|
|||
};
|
||||
};
|
||||
|
||||
programs.uwsm.enable = lib.mkDefault true;
|
||||
programs.uwsm.enable = config.niksos.desktop.hyprland;
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,7 +22,6 @@ in {
|
|||
|
||||
desktopManager.plasma6.enable = true;
|
||||
};
|
||||
programs.uwsm.enable = false;
|
||||
|
||||
home-manager.users.jsw.stylix.autoEnable = false;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -6,5 +6,6 @@
|
|||
./graphics.nix
|
||||
./fingerprint.nix
|
||||
./fwupd.nix
|
||||
./power.nix
|
||||
];
|
||||
}
|
||||
|
|
|
|||
87
system/hardware/power.nix
Normal file
87
system/hardware/power.nix
Normal file
|
|
@ -0,0 +1,87 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
inherit (config) niksos;
|
||||
cfg = niksos.portable;
|
||||
in {
|
||||
options.niksos.portable = {
|
||||
enable = lib.mkEnableOption "battery optimisers";
|
||||
hyprland = let
|
||||
gen = mode:
|
||||
lib.mkOption {
|
||||
default = "";
|
||||
description = "Shell commands to run when switching to ${mode} mode.";
|
||||
type = lib.types.lines;
|
||||
};
|
||||
in {
|
||||
powerSaver = gen "power-saver";
|
||||
performance = gen "performance";
|
||||
};
|
||||
};
|
||||
config = {
|
||||
services = lib.mkIf cfg.enable {
|
||||
logind = {
|
||||
powerKey = "suspend-then-hibernate";
|
||||
powerKeyLongPress = "poweroff";
|
||||
};
|
||||
upower.enable = true;
|
||||
power-profiles-daemon.enable = true;
|
||||
};
|
||||
|
||||
environment.systemPackages = lib.mkIf niksos.desktop.hyprland [
|
||||
(pkgs.writeScriptBin "powermode" ''
|
||||
#!/usr/bin/env bash
|
||||
|
||||
function sync() {
|
||||
if [ "$(powerprofilesctl get)" = "power-saver" ]; then
|
||||
hyprctl --batch "\
|
||||
keyword animations:enabled 0;\
|
||||
keyword decoration:shadow:enabled 0;\
|
||||
keyword decoration:blur:enabled 0;\
|
||||
keyword general:gaps_in 0;\
|
||||
keyword general:gaps_out 0;\
|
||||
keyword general:border_size 1;\
|
||||
keyword decoration:rounding 0"
|
||||
|
||||
${cfg.hyprland.powerSaver}
|
||||
else
|
||||
${cfg.hyprland.performance}
|
||||
hyprctl reload
|
||||
fi
|
||||
|
||||
}
|
||||
function toggle() {
|
||||
if [ "$(powerprofilesctl get)" = "power-saver" ]; then
|
||||
powerprofilesctl set performance
|
||||
else
|
||||
powerprofilesctl set power-saver
|
||||
fi
|
||||
|
||||
sync
|
||||
}
|
||||
|
||||
if [ "$#" -ne 1 ]; then
|
||||
echo "Usage: $0 {toggle|sync}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
case "$1" in
|
||||
toggle)
|
||||
toggle
|
||||
;;
|
||||
sync)
|
||||
sync
|
||||
;;
|
||||
*)
|
||||
echo "Invalid option: $1"
|
||||
echo "Usage: $0 {toggle|sync}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
'')
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
@ -3,7 +3,7 @@
|
|||
substituters = [
|
||||
# high priority since it's almost always used
|
||||
"https://cache.nixos.org?priority=10"
|
||||
"https://cache.garnix.io"
|
||||
# "https://cache.garnix.io"
|
||||
|
||||
# "https://anyrun.cachix.org"
|
||||
# "https://fufexan.cachix.org"
|
||||
|
|
@ -16,7 +16,7 @@
|
|||
|
||||
trusted-public-keys = [
|
||||
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
|
||||
"cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g= "
|
||||
# "cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g= "
|
||||
|
||||
# "anyrun.cachix.org-1:pqBobmOjI7nKlsUMV25u9QHa9btJK65/C8vnO3p346s="
|
||||
# "fufexan.cachix.org-1:LwCDjCJNJQf5XD2BV+yamQIMZfcKWR9ISIFy5curUsY="
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@
|
|||
./tailscale.nix
|
||||
./avahi.nix
|
||||
./kanata.nix
|
||||
./power.nix
|
||||
./ssh.nix
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,15 +0,0 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
options.niksos.portable = lib.mkEnableOption "battery optimisers";
|
||||
config.services = lib.mkIf config.niksos.portable {
|
||||
logind = {
|
||||
powerKey = "suspend-then-hibernate";
|
||||
powerKeyLongPress = "poweroff";
|
||||
};
|
||||
upower.enable = true;
|
||||
power-profiles-daemon.enable = true;
|
||||
};
|
||||
}
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
{config, ...}: {
|
||||
services.openssh = {
|
||||
enable = true;
|
||||
openFirewall = !config.niksos.portable;
|
||||
openFirewall = !config.niksos.portable.enable;
|
||||
settings.UseDns = true;
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue