Nix

The rudof repository has a flake.nix. It provides a package, apps, a development shell, and NixOS and home-manager modules, so other Nix projects can use rudof directly. It supports x86_64-linux, aarch64-linux and aarch64-darwin.

Prerequisites

You need Nix with the flakes and nix-command experimental features enabled.

Try it without installing

You can run rudof directly from the flake without permanently installing anything:

nix run github:rudof-project/rudof#rudof -- <rudof-flags>

For example, to print the help message:

nix run github:rudof-project/rudof#rudof -- --help

Install into your profile

To install rudof persistently into your user profile, run:

nix profile install github:rudof-project/rudof#rudof

After this, rudof will be available in your $PATH for the current user.

To later upgrade to a newer version, run:

nix profile upgrade '.*rudof.*'

Available outputs

The flake exposes the following outputs:

OutputDescription
packages.defaultSame as packages.rudof
packages.rudofThe main CLI binary
apps.defaultSame as apps.rudof
apps.rudofRuns the rudof binary
apps.rudof-generateRuns the rudof-generate utility bundled in the rudof package
devShells.defaultDevelopment shell with the full Rust toolchain
devShells.rudofDevelopment shell with the flake packages.rudof available
nixosModules.defaultNixOS module exposing programs.rudof (See reference)
homeModules.defaulthome-manager module exposing programs.rudof (See reference)

You can list all available outputs with:

nix flake show github:rudof-project/rudof

Using the flake as an input in your project

Add rudof as a flake input:

{
  inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
    rudof.url = "github:rudof-project/rudof";
    rudof.inputs.nixpkgs.follows = "nixpkgs";
  };
}

Reference the package for your system directly, for example in a devShell, a NixOS configuration, or anywhere else pkgs-like values are built:

{ inputs, system, ... }:
{
  environment.systemPackages = [ inputs.rudof.packages.${system}.rudof ];
}

NixOS module

Import nixosModules.default and enable programs.rudof:

{
  imports = [ rudof.nixosModules.default ];

  programs.rudof = {
    enable = true;
    # package = <override the default rudof package>;
    settings = {
      # any rudof setting, e.g.:
      # version = "0.0.0";
    };
    extraArgs = [ "--some-flag" ];
  };
}

home-manager module

Same config, via homeModules.default:

{
  imports = [ rudof.homeModules.default ];

  programs.rudof = {
    enable = true;
    settings = {
      # ...
    };
  };
}