How to consume the flake.nix in pijul-nest?

I see in pijul / nest that pijul is heavily integrated with nix, and there is a flake.nix with nixosModules declared so I think it is for easy deployment of pijul-nest.

However I do not know how to directly add it as flake inputs as it is a pijul repo, without downloading it in advance.

In the nix manual:

It support http(s)/ssh with git mercurial and tarball, or path for local repo.
If not download the repo locally and use path, I think the most feasible way is use tarball.

Is pijul-nest provide a tarball URL as the URL of a particular change (commit) or a channel (branch), something like https://codeberg.org/forgejo/forgejo/archive/forgejo.tar.gz (download tar.gz of forgejo repo in the “forgejo” branch ) in codeberg?

Just found this discussion… libfetchers: Add pijul fetcher by nrabulinski · Pull Request #8730 · NixOS/nix · GitHub
A plugin existed but no more maintenance..

Heavily integrated in Nix… pmeunier / elpe

Although to answer your question there’s /archive.tar.gz?state=…. Here’s how we use it at my company:

inputs.nest = {
  url = "https://nest.pijul.com/pijul/nest/archive.tar.gz?state=7YIW5DCBSFNQLTAHCEKWR3CC2RCCBWB3II2MPTXOQJA5HINZY5DAC";
  inputs.nixpkgs.follows = "nixpkgs";
  inputs.rust-overlay.follows = "oxalica";
  inputs.attic.follows = "attic";
}

(this state is probably really old, take the latest ones they have a number of fixes including security)

And then in the outputs, we include nest.nixosModules.nest and nest.nixosModules.ci:

  services.pijul-nest = {
    enable = true;
    path = "/var/blabla/nest";
    domain = "my.domain.com";
    baseUrl = "https://my.domain.com";
    postgres = "postgres://pijul@127.0.0.1/nest?sslmode=disable";
    pbkdf2PasswordFile = config.age.secrets.pbkdf2_password.path;
    pbkdf2SaltFile = config.age.secrets.pbkdf2_salt.path;
    pbkdf2Iterations = 500000;
    smtpPasswordFile = config.age.secrets.smtp_password.path;
    ci = {
      filesystem = "/var/blabla/nest/logs";
      urls = [ "http://builder1:5003" "http://builder2:5003" ];
    };
    email = {
      server = "my.smtp.com";
      source = "no-reply@domain.com";
      user = "no-reply@domain.com";
    };
    zulip = {
      site = "https://mydomain.zulipchat.com";
      botEmail = "nest-bot@mydomain.zulipchat.com";
      stream = "Nest";
      apiKeyFile = config.age.secrets.zulip-webhook.path;
    };
  };

  services.pijul-ci = {
    enable = true;
    port = 5003;
    nestUrl = "http://my.domain.com";
    ciPath = "/var/blabla/ci";
    atticUrl = "https://attic.domain.com";
    atticCache = "my_cache";
    atticTokenFile = config.age.secrets.attic.path;
  };
1 Like

Thanks! I really help me to use it on nixos as I am also nixos beginner.
I said heavily integrated as I saw a lot of .nix file in the repo. not so many people do that.