-
Notifications
You must be signed in to change notification settings - Fork 13
/
flake.nix
52 lines (47 loc) · 1.52 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
# SPDX-FileCopyrightText: 2021 Richard Brežák and NixNG contributors
#
# SPDX-License-Identifier: MPL-2.0
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs?ref=nixos-22.05";
};
outputs = { nixpkgs, self }:
let
supportedSystems = [ "x86_64-linux" "i686-linux" "aarch64-linux" ];
forAllSystems' = nixpkgs.lib.genAttrs;
forAllSystems = forAllSystems' supportedSystems;
pkgsForSystem = system:
import nixpkgs { inherit system; overlays = [ self.overlays.default ]; };
in
{
nglib = import ./lib nixpkgs.lib;
examples = import ./examples { inherit nixpkgs; inherit (self) nglib; };
overlays.default = import ./overlay;
packages = forAllSystems (system:
let
pkgs = import nixpkgs { inherit system; };
fix = import ./overlay fix pkgs;
in
fix);
devShells = forAllSystems (system:
let pkgs = pkgsForSystem system;
in
{ default = pkgs.mkShell {
nativeBuildInputs = with pkgs;
[
nixpkgs-fmt
rnix-lsp
dhall
reuse
];
};
});
hydraJobs = {
examples = nixpkgs.lib.mapAttrs (n: v: v.config.system.build.toplevel) self.examples;
};
};
}