forked from mgdm/htmlq
-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
43 lines (37 loc) · 1.29 KB
/
flake.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
{
description = "like jq, but for HTML.";
inputs = {
nixpkgs.url = "nixpkgs"; # Resolves to github:NixOS/nixpkgs
# Helpers for system-specific outputs
flake-utils.url = "github:numtide/flake-utils";
crate2nix = {
url = "github:kolloch/crate2nix";
flake = false;
};
};
outputs = { self, nixpkgs, crate2nix, flake-utils }:
# Create system-specific outputs for the standard Nix systems
# https://github.com/numtide/flake-utils/blob/master/default.nix#L3-L9
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
crateName = "htmlq";
inherit (import "${crate2nix}/tools.nix" { inherit pkgs; })
generatedCargoNix;
project = pkgs.callPackage (generatedCargoNix {
name = crateName;
src = ./.;
}) {
defaultCrateOverrides = pkgs.defaultCrateOverrides // {
# Crate dependency overrides go here
};
};
in {
packages.${crateName} = project.rootCrate.build;
defaultPackage = self.packages.${system}.${crateName};
devShell = pkgs.mkShell {
inputsFrom = builtins.attrValues self.packages.${system};
buildInputs = [ pkgs.cargo pkgs.rust-analyzer pkgs.clippy ];
};
});
}