-
Notifications
You must be signed in to change notification settings - Fork 41
/
flake.nix
82 lines (73 loc) · 1.78 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
flake-compat.url = "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz";
gomod2nix = {
url = "github:nix-community/gomod2nix";
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-utils.follows = "flake-utils";
};
gotk4-nix = {
url = "github:diamondburned/gotk4-nix?ref=flake";
inputs.nixpkgs.follows = "nixpkgs";
inputs.gomod2nix.follows = "gomod2nix";
inputs.flake-utils.follows = "flake-utils";
};
};
outputs =
{ self, ... }@inputs:
with builtins;
with inputs.nixpkgs.lib;
let
baseFunc = pkgs: import ./nix/base.nix {
inherit pkgs;
src = self;
};
in
(inputs.flake-utils.lib.eachDefaultSystem (system:
let
pkgs = inputs.nixpkgs.legacyPackages.${system}.appendOverlays [
inputs.gomod2nix.overlays.default
inputs.gotk4-nix.overlays.patchelf
];
in
{
devShells.default = inputs.gotk4-nix.lib.mkShell {
pkgs = pkgs;
base = baseFunc pkgs;
buildInputs = with pkgs; [
jq
niv
libxml2 # for xmllint
python3
gomod2nix
imagemagick
(callPackage ./.github/tools {})
];
};
packages.default = inputs.gotk4-nix.lib.mkPackage {
pkgs = pkgs;
base = baseFunc pkgs;
version = self.rev or "unknown";
};
apps = rec {
default = dissent;
dissent = {
type = "app";
program = "${self.packages.${system}.default}/bin/dissent";
};
staticcheck = {
type = "app";
program = "${pkgs.go-tools}/bin/staticcheck";
};
};
}
)) //
{
lib = inputs.gotk4-nix.lib.mkLib rec {
pkgs = inputs.nixpkgs.legacyPackages.${builtins.currentSystem};
base = baseFunc pkgs;
};
};
}