https://github.com/hraban/nix-tools
Personal utility scripts and Nix tools
https://github.com/hraban/nix-tools
common-lisp nix
Last synced: 9 months ago
JSON representation
Personal utility scripts and Nix tools
- Host: GitHub
- URL: https://github.com/hraban/nix-tools
- Owner: hraban
- License: agpl-3.0
- Created: 2023-11-16T03:24:25.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2024-04-02T13:54:13.000Z (over 1 year ago)
- Last Synced: 2024-04-03T03:49:48.628Z (over 1 year ago)
- Topics: common-lisp, nix
- Language: Nix
- Homepage:
- Size: 421 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.org
- License: LICENSE
Awesome Lists containing this project
README
* Hraban’s Misc Nix Tools
Various Nix utility scripts for my nix computers.
This is a sandbox for personal stuff, I make zero guarantees about any API or anything. I will try not to force push any existing commits, so if you want to use something, pin the specific revision in your flake’s inputs and you should be fine.
* Battery Control for Mac (Intel and Apple Sillicon)
Use the =battery-control= nix-darwin module to control the maximum charge of
your battery.
Example:
#+begin_src nix
{
inputs = {
nix-tools.url = "github:hraban/nix-tools";
};
outputs = {
nix-darwin
, nix-tools
, ...
}: {
darwinConfigurations = {
MyHost = nix-darwin.lib.darwinSystem {
# ...
modules = [
# Load the module here
nix-tools.darwinModules.default
# Now you can configure the actual module:
({ pkgs, ... }: {
battery-control = {
# (aarch64 only)
# Use a clamping service to automatically turn charging...
clamp-service = {
enable = true;
min = 10; # ON, when charge drops below this level
max = 30; # OFF when charge rises above this level
# "Charging off" means "maintain current level using power
# supply", which is what you normally experience at 100%.
};
# Enable an xbar plugin to control the battery. On x86 this uses
# BCLM and lets you select a “target charge” of between 50–100%,
# while on aarch64 it provides a binary ON/OFF switch for
# charging. Requires xbar installed, of course, but also
# home-manager.
xbar-plugin.enable = true;
};
})
];
};
};
};
}
#+end_src
* License
Copyright © 2023–2025 Hraban Luyat
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, version 3 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see .