Nix flake for Zerobyte - a self-hosted backup automation and management application powered by Restic.
- Pure Nix flake packaging of Zerobyte
- NixOS module with systemd service
- Includes shoutrrr for notifications
- FUSE mount support on Linux
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
zerobyte-nix.url = "github:utensils/zerobyte-nix";
};
outputs = { self, nixpkgs, zerobyte-nix, ... }: {
nixosConfigurations.myhost = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
zerobyte-nix.nixosModules.default
{
services.zerobyte = {
enable = true;
port = 4096;
openFirewall = true;
};
}
];
};
};
}{
nixpkgs.overlays = [ zerobyte-nix.overlays.default ];
}| Option | Type | Default | Description |
|---|---|---|---|
enable |
bool | false |
Enable Zerobyte service |
port |
int | 4096 |
Port to listen on |
dataDir |
path | /var/lib/zerobyte |
Data directory |
user |
string | "zerobyte" |
User to run as |
group |
string | "zerobyte" |
Group to run as |
openFirewall |
bool | false |
Open firewall port |
trustedOrigins |
list | [] |
Trusted origins for CORS (for reverse proxy) |
serverIdleTimeout |
int | 60 |
Server idle timeout in seconds |
disableRateLimiting |
bool | false |
Disable rate limiting (dev/testing only) |
fuse.enable |
bool | true |
Enable FUSE support (Linux only) |
protectHome |
bool | true |
Enable ProtectHome hardening |
extraReadWritePaths |
list | [] |
Additional writable paths |
# Enter development shell
nix develop
# Build the package
nix build
# Run integration tests (NixOS only)
nix build .#checks.x86_64-linux.integrationThis flake follows upstream releases (tags). To update to a new version:
# 1. Update version in flake.nix (both zerobyte-src URL and config.version)
# zerobyte-src.url = "github:nicotsx/zerobyte/v0.21.0"
# version = "0.21.0"
# 2. Update flake.lock
nix flake update zerobyte-src
# 3. Regenerate bun.nix (in devshell)
nix develop
update-bun-nix
# 4. Test and commit
nix build
git add flake.nix flake.lock bun.nix
git commit -m "chore: update to v0.21.0"The bun.nix file must always match the upstream release referenced in flake.lock.
This Nix flake packaging is licensed under the MIT License - see LICENSE for details.
Zerobyte itself is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0).