Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

urbackup2-server: dataset options are not optional #34

Open
xieve opened this issue Feb 20, 2024 · 0 comments
Open

urbackup2-server: dataset options are not optional #34

xieve opened this issue Feb 20, 2024 · 0 comments

Comments

@xieve
Copy link

xieve commented Feb 20, 2024

Hey there, first of all: thank you for making this stuff accessible. Have you thought about contributing some of your packages to the official repos?

Issue

Since the dataset options are meant to be optional, I am assuming you were meaning to implement this config as optional by defaulting to null.

However, if I don't specify service.urbackup.dataset.images and service.urbackup.dataset.files, the activation of my config fails with one of these two error messages:

error: The option `environment.etc."urbackup/dataset".source' is used but not defined.
error: The option `environment.etc."urbackup/dataset_file".source' is used but not defined.

Workaround

Specifying an empty string for both attributes makes the error go away, without specifying any config I do not actually want.

Background

I am trying to set up your urbackup server module, which currently looks like this:

# flake.nix
{
    description = "xieve's nixos flake";

    inputs = {
        nixpkgs = {
            url = "github:NixOS/nixpkgs/nixos-unstable";
        };
        nzbr = {
            url = "github:nzbr/nixos";
        };
    };

    outputs = { self, nixpkgs, nzbr }@attrs: {
        nixosConfigurations = {
            thegreatbelow = nixpkgs.lib.nixosSystem {
                system = "x86_64-linux";
                specialArgs = attrs; # Pass inputs to modules
                modules = [
                    nzbr.nixosModules."service/urbackup.nix"
                    ./thegreatbelow.nix
                ];
            };
        };
    };
}
# thegreatbelow.nix
{ config, pkgs, nzbr, ... }:

{
    # [...]
    nzbr.service.urbackup = {
        enable = true;
        backupfolder = "/mnt/user/urbackup/";
        config = {
            LOGFILE = "/mnt/user/appdata/binhex-urbackup/urbackup/log/urbackup.log";
        };
        package = nzbr.packages.x86_64-linux.urbackup2-server;
        dataset.images = ""; # WORKAROUND HERE
        dataset.files = ""; # WORKAROUND HERE
    };
    fileSystems."/var/urbackup" = {
        device = "/mnt/user/appdata/binhex-urbackup/urbackup";
        fsType = "none";
        options = [ "bind" ];
    };
    # [...]
}

I am moving away from a docker-based setup, but before I move all my files, I want to get this thing running as a proof of concept. These backups are not extremely critical, I am comfortable with "fuck around, find out".

I do not have a proposed solution for this, because I am not too sure myself what the best way to resolve this would be. I am very new to Nix.

@xieve xieve changed the title urbackup2-server: dataset options are not actually optional urbackup2-server: dataset options are not optional Feb 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant