2.4 KiB
Nix
The Nix package derivation is currently defined for all default systems, and it can be integrated into NixOS and Home-Manager configurations as below.
Installation
Here's how to reference the package derivation (and explicitly pin it) in your flake.nix:
{
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.
Configuration
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.
NixOS
{inputs, ...}: {
imports = [inputs.gauntlet.nixosModules.default];
programs.gauntlet = {
enable = true;
service.enable = true;
};
}
Home-Manager
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 = {};
};
}
Development
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
package-lock.jsonhas changed, setnpmDepsHashto""and rebuild withnix build, copying the actual value back intonpmDepsHash. This is necessary forfetchNpmDepsbecauseimportNpmLockdoesn't work withgit://dependencies like for@project-gauntlet/tools. - If
Cargo.lockhas changed, runnix run .#fetch-rusty-v8-hashesand replaceRUSTY_V8_ARCHIVEas instructed if different. Because buildinglibrusty_v8takes 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.