mirror of
https://github.com/numtide/treefmt.git
synced 2024-10-26 17:30:03 +03:00
3dc5943e60
* nix: simplify the code a bit * docs: fix the website Make the paths relative so they work on GitHub Pages. Fix the landing page overriding the docs. Put the docs in the right sub-folder.
44 lines
1.2 KiB
Nix
44 lines
1.2 KiB
Nix
{
|
|
description = "treefmt";
|
|
# To update all inputs:
|
|
# $ nix flake update --recreate-lock-file
|
|
inputs.devshell.url = "github:numtide/devshell";
|
|
inputs.flake-utils.url = "github:numtide/flake-utils";
|
|
inputs.naersk.inputs.nixpkgs.follows = "nixpkgs";
|
|
inputs.naersk.url = "github:nmattia/naersk";
|
|
|
|
outputs = { self, nixpkgs, naersk, flake-utils, devshell }:
|
|
(
|
|
flake-utils.lib.eachSystem [ "x86_64-linux" "x86_64-darwin" ] (system:
|
|
let
|
|
pkgs = import nixpkgs {
|
|
inherit system;
|
|
# Makes the config pure as well. See <nixpkgs>/top-level/impure.nix:
|
|
config = { };
|
|
overlays = [
|
|
naersk.overlay
|
|
devshell.overlay
|
|
];
|
|
};
|
|
|
|
treefmt = pkgs.naersk.buildPackage {
|
|
src = self;
|
|
};
|
|
in
|
|
{
|
|
# What is used when invoking `nix run github:numtide/treefmt`
|
|
defaultPackage = treefmt;
|
|
|
|
# A collection of packages for the project
|
|
packages = {
|
|
inherit treefmt;
|
|
docs = pkgs.callPackage ./docs { };
|
|
};
|
|
|
|
# The development environment
|
|
devShell = pkgs.devshell.fromTOML ./devshell.toml;
|
|
}
|
|
)
|
|
);
|
|
}
|