-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
55 lines (49 loc) · 1.51 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
52
53
54
55
{
description = "Shortcut for `git push --set-upstream REMOTE BRANCH`";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs";
systems.url = "github:nix-systems/default";
crane = {
url = "github:ipetkov/crane";
inputs.nixpkgs.follows = "nixpkgs";
};
advisory-db = {
url = "github:rustsec/advisory-db";
flake = false;
};
};
nixConfig = {
extra-substituters = ["https://cache.garnix.io"];
extra-trusted-substituters = ["https://cache.garnix.io"];
extra-trusted-public-keys = ["cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g="];
};
outputs = inputs @ {
self,
nixpkgs,
systems,
crane,
advisory-db,
}: let
eachSystem = nixpkgs.lib.genAttrs (import systems);
in {
packages = eachSystem (system: let
pkgs = nixpkgs.legacyPackages.${system};
inherit (pkgs) lib;
packages = pkgs.callPackage ./nix/makePackages.nix {inherit inputs;};
in
(lib.filterAttrs (name: value: lib.isDerivation value) packages)
// {
default = packages.git-upstream;
# This lets us use `nix run .#cargo` to run Cargo commands without
# loading the entire `nix develop` shell (which includes
# `rust-analyzer`).
#
# Used in `.github/workflows/release.yaml`.
cargo = pkgs.cargo;
});
checks = eachSystem (system: self.packages.${system}.default.checks);
devShells = eachSystem (system: {
default = self.packages.${system}.default.devShell;
});
};
}