The Nix package derivation is currently defined for all default systems, and it can be integrated into NixOS and Home-Manager configurations as below.
Here's how to reference the package derivation (and explicitly pin it) in your flake.nix
:
NOTE: Currently there is an issue with release process causing commit with version tag to have mismatched hash. Please use next commit which updates the hash in following format: github:project-gauntlet/gauntlet/<commit_hash>
{
inputs.gauntlet.url = github:project-gauntlet/gauntlet/<gauntlet_version_repository_tag>;
inputs.gauntlet.inputs.nixpkgs.follows = "nixpkgs";
}
The package can then be referenced directly with gauntlet.packages.${system}.default
or integrated as an overlay with gauntlet.overlays.default
.
Under programs.gauntlet
, the options provide the following:
enable
: adds executable to system pathservice.enable
: runs daemon with systemd (MacOS launchd not yet supported)
The examples below assume flake inputs are passed to nixpkgs.lib.nixosSystem
and home-manager.lib.mkHomeManagerConfiguration
respectively as inputs
parameter.
{inputs, ...}: {
imports = [inputs.gauntlet.nixosModules.default];
programs.gauntlet = {
enable = true;
service.enable = true;
};
}
Once config.toml
is supported, Home-Manager can populate its contents with programs.gauntlet.config
.
{inputs, ...}: {
imports = [inputs.gauntlet.homeManagerModules.default];
programs.gauntlet = {
enable = true;
service.enable = true;
config = {};
};
}
When updating dependencies or bumping the project version, please follow these steps to adjust the relevant values at the top of ./nix/overlay.nix
:
- If there is a new package release, set
version
to that upcoming version tag. - If
package-lock.json
has changed, setnpmDepsHash
to""
and rebuild withnix build
, copying the actual value back intonpmDepsHash
. This is necessary forfetchNpmDeps
becauseimportNpmLock
doesn't work withgit://
dependencies like for@project-gauntlet/tools
. - If
Cargo.lock
has changed, runnix run .#fetch-rusty-v8-hashes
and replaceRUSTY_V8_ARCHIVE
as instructed if different. Because buildinglibrusty_v8
takes forever, we follow nixpkgs precedent and fetch binaries in a fixed-output-derivation.
When making any changes to nix code, please format with nix fmt
when done.
When running the project in development, .#devShells.default
will provide access to all repository tooling. You can access this by running nix develop
, or direnv allow
if you have direnv
+ nix-direnv
.