This commit is contained in:
Your Name 2022-10-29 15:36:19 +02:00
commit 7b9c264ec8
2 changed files with 33 additions and 1 deletions

View File

@ -133,6 +133,7 @@
# List packages installed in system profile. To search, run:
# $ nix search wget
environment.systemPackages = with pkgs; [
set-backlight-script
neovim
git
wget
@ -266,7 +267,7 @@ $NEW_PROMPT_COMMAND"
toupper = "tr [:lower:] [:upper:]";
tolower = "tr [:upper:] [:lower:]";
rebuild = ''
sudo sh -c "cd $HOME/.local/os && nixos-rebuild switch --flake .# --use-remote-sudo"
nixos-rebuild switch --flake "$HOME/.local/os#" --use-remote-sudo
'';
};
programs.bash.sessionVariables = {
@ -339,4 +340,29 @@ $NEW_PROMPT_COMMAND"
};
let set-backlight-script = (writeShellApplication {
name = "set-backlight-script";
text = ''
#!/bin/sh
for d in /sys/class/backlight/*; do
cd $d
echo $(( $(cat max_brightness) / 2)) > brightness
done
'';
});
in
systemd.services.99setbacklight = {
enable = true;
description = "bar";
unitConfig = {
Type = "simple";
};
serviceConfig = {
ExecStart = "${set-backlight-script}";
};
wantedBy = [ "multi-user.target" ];
};
}

6
startup.sh Executable file
View File

@ -0,0 +1,6 @@
#!/bin/sh
for dev in /sys/class/backlight/* ; do
cd $dev
echo $(( $(cat max_brightness) / 2)) > brightness
done