-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathflake.nix
73 lines (68 loc) · 1.89 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
{
description = "ess (env sampple sync)";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = {
self,
nixpkgs,
flake-utils,
...
}:
flake-utils.lib.eachDefaultSystem (
system: let
pkgs = import nixpkgs {
inherit system;
};
in {
packages = rec {
ess = pkgs.callPackage ./. {inherit pkgs self;};
default = ess;
};
devShells = let
pkgs = nixpkgs.legacyPackages.${system};
prepare-release = pkgs.writeShellApplication {
name = "prepare-release";
runtimeInputs = with pkgs; [
coreutils
git
gnused
svu
];
text =
# bash
''
git config --global user.email '[email protected]'
git config --global user.name 'Github Actions'
OLD_VERSION=$(svu current --tag.prefix "")
NEW_VERSION=$(svu next --tag.prefix "" --always)
[ "$OLD_VERSION" == "$NEW_VERSION" ] && echo "no version bump" && exit 0
sed -i "s/$OLD_VERSION/$NEW_VERSION/g" README.md
echo "$NEW_VERSION" >version.txt
git add version.txt README.md
git commit -m "bump release version" --allow-empty
git tag "v$NEW_VERSION"
git push
git push --tags
'';
};
in {
default = pkgs.mkShell {
packages =
[
prepare-release
]
++ (with pkgs; [
act
go_1_24
gotools
golangci-lint
go-tools
gopls
]);
};
};
}
);
}