Compare commits
4 commits
a945955835
...
028a370299
| Author | SHA1 | Date | |
|---|---|---|---|
| 028a370299 | |||
| 2890b8b503 | |||
| 1b40da95a7 | |||
| ac542840a0 |
4 changed files with 23 additions and 4 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
{ pkgs, resume-dev, ... }: {
|
{ pkgs, username, resume-dev, ... }: {
|
||||||
powerManagement.powertop.enable = true;
|
powerManagement.powertop.enable = true;
|
||||||
|
|
||||||
services = {
|
services = {
|
||||||
|
|
@ -10,6 +10,18 @@
|
||||||
echo 85 > /sys/class/power_supply/BAT*/charge_control_end_threshold || true
|
echo 85 > /sys/class/power_supply/BAT*/charge_control_end_threshold || true
|
||||||
''}"
|
''}"
|
||||||
'';
|
'';
|
||||||
|
cron = {
|
||||||
|
enable = true;
|
||||||
|
systemCronJobs = [
|
||||||
|
"* * * * * ${username} bash -x ${pkgs.writeShellScript "low-battery-notifier" ''
|
||||||
|
BAT_PCT=`${pkgs.acpi}/bin/acpi -b | ${pkgs.gnugrep}/bin/grep -P -o '[0-9]+(?=%)'`
|
||||||
|
BAT_STA=`${pkgs.acpi}/bin/acpi -b | ${pkgs.gnugrep}/bin/grep -P -o '\w+(?=,)'`
|
||||||
|
echo "`date` battery status:$BAT_STA percentage:$BAT_PCT"
|
||||||
|
test $BAT_PCT -le 30 && test $BAT_PCT -gt 15 && test $BAT_STA = "Discharging" && DISPLAY=:0.0 ${pkgs.libnotify}/bin/notify-send -c device -u normal "Low Battery" "\$\{BAT_PCT}% remaining."
|
||||||
|
test $BAT_PCT -le 15 && test $BAT_STA = "Discharging" && DISPLAY=:0.0 ${pkgs.libnotify}/bin/notify-send -c device -u critical "Low Battery" "Shutdown at 10%."
|
||||||
|
''} > /tmp/cron.batt.log 2>&1"
|
||||||
|
];
|
||||||
|
};
|
||||||
upower = {
|
upower = {
|
||||||
enable = true;
|
enable = true;
|
||||||
percentageCritical = 15;
|
percentageCritical = 15;
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,14 @@
|
||||||
programs.zed-editor = {
|
programs.zed-editor = {
|
||||||
enable = true;
|
enable = true;
|
||||||
package = pkgs.zed-editor;
|
package = pkgs.zed-editor;
|
||||||
extensions = [ "nix" ];
|
extensions = [
|
||||||
|
"html" "html-snippets"
|
||||||
|
"svelte" "svelte-snippets"
|
||||||
|
"wakatime" "discord-presence"
|
||||||
|
"catppuccin" "catppuccin-icons"
|
||||||
|
"git-firefly"
|
||||||
|
"nix"
|
||||||
|
];
|
||||||
userSettings = {
|
userSettings = {
|
||||||
format_on_save = "off";
|
format_on_save = "off";
|
||||||
vim_mode = true;
|
vim_mode = true;
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@
|
||||||
DISABLE_REGISTRATION = true;
|
DISABLE_REGISTRATION = true;
|
||||||
ENABLE_OPENID_SIGNIN = false;
|
ENABLE_OPENID_SIGNIN = false;
|
||||||
ENABLE_OPENID_SIGNUP = false;
|
ENABLE_OPENID_SIGNUP = false;
|
||||||
ENABLE_INTERNAL_SIGNIN = true;
|
ENABLE_INTERNAL_SIGNIN = false;
|
||||||
SHOW_REGISTRATION_BUTTON = false;
|
SHOW_REGISTRATION_BUTTON = false;
|
||||||
ALLOW_ONLY_EXTERNAL_REGISTRATION = true;
|
ALLOW_ONLY_EXTERNAL_REGISTRATION = true;
|
||||||
ALLOW_ONLY_INTERNAL_REGISTRATION = false;
|
ALLOW_ONLY_INTERNAL_REGISTRATION = false;
|
||||||
|
|
|
||||||
|
|
@ -74,7 +74,7 @@ in {
|
||||||
} // lib.mapAttrs' (subdomain: cfg: lib.nameValuePair "${subdomain}.${base}" {
|
} // lib.mapAttrs' (subdomain: cfg: lib.nameValuePair "${subdomain}.${base}" {
|
||||||
useACMEHost = base;
|
useACMEHost = base;
|
||||||
forceSSL = true;
|
forceSSL = true;
|
||||||
locations."/".return = "301 ${base}";
|
locations."/".return = "301 ${cfg.dest}";
|
||||||
}) redirects // lib.mapAttrs' (subdomain: cfg: lib.nameValuePair (if subdomain == "@" then base else "${subdomain}.${base}") {
|
}) redirects // lib.mapAttrs' (subdomain: cfg: lib.nameValuePair (if subdomain == "@" then base else "${subdomain}.${base}") {
|
||||||
useACMEHost = base;
|
useACMEHost = base;
|
||||||
forceSSL = true;
|
forceSSL = true;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue