Skip to content

Commit

Permalink
Problem: gomod2nix is not in nix develop shell
Browse files Browse the repository at this point in the history
Solution:
- add gomod2nix to default devShell
- build gomod2nix with the same go version

no rocksdb in default shell

fix develop shell
  • Loading branch information
yihuang committed Feb 28, 2024
1 parent 01d9dc6 commit 096ab66
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ jobs:
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
if: steps.changed-files.outputs.any_changed == 'true'
- name: gomod2nix
run: nix run -f ./nix gomod2nix
run: nix develop -c gomod2nix
if: steps.changed-files.outputs.any_changed == 'true'
- name: check working directory is clean
id: changes
Expand Down
12 changes: 6 additions & 6 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 12 additions & 6 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
gomod2nix = {
url = "github:nix-community/gomod2nix";
inputs.nixpkgs.follows = "nixpkgs";
inputs.utils.follows = "flake-utils";
inputs.flake-utils.follows = "flake-utils";
};
};

Expand Down Expand Up @@ -45,14 +45,20 @@
defaultPackage = packages.cronosd;
defaultApp = apps.cronosd;
devShells = {
cronosd = pkgs.mkShell {
buildInputs = with pkgs; [
go_1_22
rocksdb
default = pkgs.mkShell {
buildInputs = [
defaultPackage.go
pkgs.gomod2nix
];
};
rocksdb = pkgs.mkShell {
buildInputs = [
defaultPackage.go
pkgs.gomod2nix
pkgs.rocksdb
];
};
};
devShell = devShells.cronosd;
legacyPackages = pkgs;
}
)
Expand Down

0 comments on commit 096ab66

Please sign in to comment.