This is a NixOS flake that enhances the existing NUT (Network UPS Tools) package and service on NixOS. It aims to address various deficiencies such as incomplete configuration options, service definition issues, and the service running as root.
To use this flake, add it to your flake.nix
file:
{
inputs.nut.url = "github:capslock/nut";
outputs = { self, nixpkgs, nut }: {
nixosConfigurations.yourhostname = nixpkgs.lib.nixosSystem {
modules = [
({
config,
pkgs,
...
}: {nixpkgs.overlays = [nut.overlays.default];})
./configuration.nix
nut.nixosModules.default
];
};
};
}
Now you can configure NUT
in your NixOS configuration.nix
, e.g.:
TODO: Explain/make this example better.
{
services.nut = {
enable = true;
ups."Eaton5S" = {
driver = "usbhid-ups";
port = "auto";
description = "Eaton 5S";
};
upsdConfFile = toString (pkgs.writeText "upsd.conf" "");
upsdUsersFile = config.sops.templates."upsd.users".path;
upsmonConfFile = config.sops.templates."upsmon.conf".path;
};
}
flake.nix
- Flake containing updated package and module definitions.
- Fork the repository.
- Create your feature branch (
git checkout -b my-feature
). - Commit your changes (
git commit -m 'Add some feature'
). - Push to the feature branch (
git push origin my-feature
). - Open a pull request.
This project is licensed under the MIT License - see the LICENSE.md file for details.