forked from packwiz/packwiz
-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
44 lines (39 loc) · 1.48 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
{
inputs.nixpkgs.url = "nixpkgs/nixos-unstable";
outputs = {
self,
nixpkgs,
}:
with nixpkgs.lib; let
# List of explicetely unsupported systems
explicitelyUnsupportedSystems = [];
# Packwiz should support all 64-bit systems supported by go, but nix only
# support strictly less, so all nix-supported systems are included
# (except ones in explicitelyUnsupportedSystems).
supportedSystems =
filter
# Filter out systems that are explicetely supported
(s: ! elem s explicitelyUnsupportedSystems)
# This lists all systems reasonably well-supported by nix
(import "${nixpkgs}/lib/systems/flake-systems.nix" {});
# Helper generating outputs for each supported system
forAllSystems = genAttrs supportedSystems;
# Import nixpkgs' package set for each system.
nixpkgsFor = forAllSystems (system: import nixpkgs {inherit system;});
in {
# Packwiz package
packages = forAllSystems (system: let
pkgs = nixpkgsFor.${system};
in rec {
packwiz = pkgs.callPackage ./nix {
version = substring 0 8 self.rev or "dirty";
vendorSha256 = readFile ./nix/vendor-sha256;
buildGoModule = pkgs.buildGo118Module;
};
# Build packwiz by default when no package name is specified
default = packwiz;
});
# This flake's nix code formatter
formatter = forAllSystems (system: nixpkgsFor.${system}.alejandra);
};
}