-
Notifications
You must be signed in to change notification settings - Fork 116
Expand file tree
/
Copy pathflake.nix
More file actions
65 lines (57 loc) · 1.71 KB
/
Copy pathflake.nix
File metadata and controls
65 lines (57 loc) · 1.71 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
{
description = "msgvault — offline Gmail archive with full-text search";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
gitignore.url = "github:hercules-ci/gitignore.nix";
gitignore.inputs.nixpkgs.follows = "nixpkgs";
};
outputs =
{
nixpkgs,
flake-utils,
gitignore,
...
}:
flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = nixpkgs.legacyPackages.${system};
# Pin Go 1.26.4 until nixpkgs-unstable ships it.
# Scoped to msgvault only — do NOT export via overlay, that would
# invalidate every Go derivation in the transitive closure.
goPinned = pkgs.go_1_26.overrideAttrs (_: rec {
version = "1.26.4";
src = pkgs.fetchurl {
url = "https://go.dev/dl/go${version}.src.tar.gz";
hash = "sha256-T2aKMvv8ETLmqIH7lowvHa2mMUkqM5IRc1+7JVpCYC0=";
};
});
buildGoModule = pkgs.buildGoModule.override { go = goPinned; };
msgvault = pkgs.callPackage ./nix/package.nix {
inherit buildGoModule;
inherit (gitignore.lib) gitignoreSource;
};
in
{
packages = {
default = msgvault;
msgvault = msgvault;
};
apps.default = flake-utils.lib.mkApp { drv = msgvault; };
devShells.default = pkgs.mkShell {
packages = [
goPinned
pkgs.gopls
pkgs.gotools
pkgs.golangci-lint
pkgs.delve
pkgs.gcc
pkgs.prek
pkgs.sqlite-interactive
];
};
formatter = pkgs.nixfmt-rfc-style;
}
);
}