-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathflake.nix
More file actions
47 lines (41 loc) · 1.36 KB
/
flake.nix
File metadata and controls
47 lines (41 loc) · 1.36 KB
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
{
description = "Example: lib.buildPackage, the high-level cargo-schnee API";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
rust-overlay = {
url = "github:oxalica/rust-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
cargo-schnee.url = "path:../..";
};
outputs = { self, nixpkgs, rust-overlay, cargo-schnee }:
let
systems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
forAllSystems = f: nixpkgs.lib.genAttrs systems f;
mkSystem = system:
let
overlays = [ (import rust-overlay) ];
pkgs = import nixpkgs { inherit system overlays; };
src = pkgs.lib.fileset.toSource {
root = ./.;
fileset = pkgs.lib.fileset.unions [
./Cargo.toml
./Cargo.lock
./crates
];
};
callPackage = pkgs.lib.callPackageWith {
inherit pkgs cargo-schnee src;
};
in
{
packages.greeter = callPackage ./nix/packages/greeter.nix {};
packages.formatter = callPackage ./nix/packages/formatter.nix {};
packages.doc = callPackage ./nix/packages/doc.nix {};
packages.default = self.packages.${system}.greeter;
};
in
{
packages = forAllSystems (system: (mkSystem system).packages);
};
}