allow customising nix version
This commit is contained in:
parent
dbfc2ba4e1
commit
abe046357f
1 changed files with 43 additions and 15 deletions
58
flake.nix
58
flake.nix
|
|
@ -3,36 +3,64 @@
|
|||
|
||||
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
||||
|
||||
outputs = { self, nixpkgs }:
|
||||
outputs =
|
||||
{ self, nixpkgs }:
|
||||
let
|
||||
supportedSystems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
|
||||
supportedSystems = [
|
||||
"x86_64-linux"
|
||||
"aarch64-linux"
|
||||
"x86_64-darwin"
|
||||
"aarch64-darwin"
|
||||
];
|
||||
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
|
||||
in
|
||||
{
|
||||
packages = forAllSystems (system:
|
||||
packages = forAllSystems (
|
||||
system:
|
||||
let
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
nix = pkgs.nix;
|
||||
in
|
||||
{
|
||||
default = pkgs.stdenv.mkDerivation {
|
||||
pname = "nix-scope-plugin";
|
||||
version = "0.1.0";
|
||||
src = self;
|
||||
nativeBuildInputs = [ pkgs.cmake pkgs.pkg-config ];
|
||||
buildInputs = [ nix nix.dev pkgs.boost pkgs.nlohmann_json ];
|
||||
};
|
||||
});
|
||||
default =
|
||||
{
|
||||
nix ? pkgs.nix,
|
||||
}:
|
||||
pkgs.stdenv.mkDerivation {
|
||||
pname = "nix-scope-plugin";
|
||||
version = "0.1.0";
|
||||
src = self;
|
||||
nativeBuildInputs = [
|
||||
pkgs.cmake
|
||||
pkgs.pkg-config
|
||||
];
|
||||
buildInputs = [
|
||||
nix
|
||||
nix.dev
|
||||
pkgs.boost
|
||||
pkgs.nlohmann_json
|
||||
];
|
||||
};
|
||||
}
|
||||
);
|
||||
|
||||
devShells = forAllSystems (system:
|
||||
devShells = forAllSystems (
|
||||
system:
|
||||
let
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
nix = pkgs.nix;
|
||||
in
|
||||
{
|
||||
default = pkgs.mkShell {
|
||||
packages = [ pkgs.cmake pkgs.pkg-config nix nix.dev pkgs.boost pkgs.nlohmann_json ];
|
||||
packages = [
|
||||
pkgs.cmake
|
||||
pkgs.pkg-config
|
||||
nix
|
||||
nix.dev
|
||||
pkgs.boost
|
||||
pkgs.nlohmann_json
|
||||
];
|
||||
};
|
||||
});
|
||||
}
|
||||
);
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue