ess/flake.nix

74 lines
1.9 KiB
Nix
Raw Permalink Normal View History

2023-09-02 13:31:35 +00:00
{
2025-04-08 14:45:30 +00:00
description = "ess (env sampple sync)";
2024-01-20 00:23:56 +00:00
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
2025-04-08 14:45:30 +00:00
flake-utils.url = "github:numtide/flake-utils";
2024-01-20 00:23:56 +00:00
};
2024-01-20 00:23:56 +00:00
outputs = {
self,
2024-01-20 00:23:56 +00:00
nixpkgs,
2025-04-08 14:45:30 +00:00
flake-utils,
...
}:
2025-04-08 14:45:30 +00:00
flake-utils.lib.eachDefaultSystem (
system: let
pkgs = import nixpkgs {
inherit system;
};
in {
2025-04-09 13:44:03 +00:00
packages = rec {
ess = pkgs.callPackage ./. {inherit pkgs self;};
2025-04-09 13:44:03 +00:00
default = ess;
2025-04-08 14:45:30 +00:00
};
2024-01-29 19:41:58 +00:00
2025-04-08 14:45:30 +00:00
devShells = let
pkgs = nixpkgs.legacyPackages.${system};
2025-04-08 21:49:53 +00:00
prepare-release = pkgs.writeShellApplication {
name = "prepare-release";
runtimeInputs = with pkgs; [
coreutils
git
gnused
svu
2024-01-20 00:23:56 +00:00
];
text =
# bash
''
git config --global user.email 'actions@github.com'
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
]);
2025-04-08 14:45:30 +00:00
};
};
}
);
2023-09-02 13:31:35 +00:00
}