-
Notifications
You must be signed in to change notification settings - Fork 9
/
flake.nix
57 lines (52 loc) · 1.46 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
{
description = "widdler: A WebDAV server for TiddlyWikis ";
inputs.nixpkgs.url = "nixpkgs/nixos-unstable";
outputs =
{ self
, nixpkgs
,
}:
let
supportedSystems = [ "x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin" ];
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
nixpkgsFor = forAllSystems (system: import nixpkgs { inherit system; });
in
{
overlay = _: prev: { inherit (self.packages.${prev.system}) widdler; };
packages = forAllSystems (system:
let
pkgs = nixpkgsFor.${system};
in
{
widdler = pkgs.buildGo122Module {
pname = "widdler";
version = "v1.2.5";
src = ./.;
vendorHash = "sha256-R2NkKxDPfZXVIaVbRYutw5DXYhk4NVniQOeVaJcuZNU=";
};
});
defaultPackage = forAllSystems (system: self.packages.${system}.widdler);
devShells = forAllSystems (system:
let
pkgs = nixpkgsFor.${system};
in
{
default = pkgs.mkShell {
shellHook = ''
PS1='\u@\h:\@; '
nix flake run github:qbit/xin#flake-warn
echo "Go `${pkgs.go}/bin/go version`"
'';
nativeBuildInputs = with pkgs; [
git
go
gopls
goreleaser
gosec
go-tools
nilaway
];
};
});
};
}