ess/flake.nix
Adriano Caloiaro 44eb90d711
fix: overlapping CGO_ENABLED = 0
When ess is a flake input to other devenv projects, it fails with the following:

> error: The `env` attribute set cannot contain any attributes passed to derivation. The following attributes are overlapping:
>   - CGO_ENABLED: in `env`: 0; in derivation arguments: 1
2025-04-14 10:20:12 -06:00

73 lines
1.9 KiB
Nix

{
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 '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
]);
};
};
}
);
}