-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
51 lines (45 loc) · 1.41 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
44
45
46
47
48
49
50
51
{
description = "Easy flake";
inputs = {
flake-utils.url = "github:numtide/flake-utils";
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
rust-overlay.url = "github:oxalica/rust-overlay";
# naersk.url = "github:nix-community/naersk";
crane = {
url = "github:ipetkov/crane";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, flake-utils, nixpkgs, rust-overlay, crane }:
flake-utils.lib.eachDefaultSystem (system:
with nixpkgs.lib;
let
pkgs = import nixpkgs {
inherit system;
overlays = [
rust-overlay.overlays.default
( self: super: {
python = super.python310Packages;
})
];
};
# naersk-lib = naersk.lib.${system};
craneLib = crane.lib.${system};
rust-module = import ./modules/rust.nix { inherit pkgs flake-utils craneLib; lib = pkgs.lib; };
python-module = import ./modules/python.nix { inherit pkgs flake-utils; lib = pkgs.lib; };
in {
pkgs = pkgs;
rust = {
env = rust-module.rust;
};
python = {
env = python-module.python;
pkgs = pkgs.python310Packages;
};
shell = { shell }:
flake-utils.lib.eachDefaultSystem (system: {
devShell = import shell { inherit pkgs; };
}); # end shell
} # end output-set
);
}