-
Notifications
You must be signed in to change notification settings - Fork 27
/
Copy pathflake.nix
36 lines (31 loc) · 1.03 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
{
description = "Nix flake for libkdtree+ library";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
flake-compat.url = "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz";
};
outputs = { self, nixpkgs, ... }@inputs: let
lib = nixpkgs.lib;
shellSystems = nixpkgs.lib.systems.flakeExposed;
buildSystems = nixpkgs.lib.systems.flakeExposed;
forSystems = systems: f: nixpkgs.lib.genAttrs systems (system: f system);
in {
devShells = forSystems shellSystems (system: let
pkgs = nixpkgs.legacyPackages.${system};
in {
default = pkgs.mkShell {
nativeBuildInputs = with pkgs; [
nil # lsp language server for nix
cmake
doxygen
] ++ lib.optionals pkgs.hostPlatform.isLinux [ gdb ];
};
});
packages = forSystems buildSystems (system: let
pkgs = nixpkgs.legacyPackages.${system}.pkgs;
in {
default = self.packages.${system}.libkdtree;
libkdtree = pkgs.callPackage ./libkdtree.nix {};
});
};
}