Skip to content

Commit

Permalink
Unify golang version in nix flake
Browse files Browse the repository at this point in the history
  • Loading branch information
tateexon committed Sep 25, 2024
1 parent 9efc774 commit 31ab5f2
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 16 deletions.
3 changes: 3 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
watch_file \
nix/ci-runtests.nix \
nix/devshell.nix
use flake .
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
tidy:
go mod tidy

lint:
golangci-lint run

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.

7 changes: 5 additions & 2 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,18 @@
overlays = [ ];
};

# set go version here that will be used in all shells
go = pkgs.go_1_23;

scriptDir = toString ./.; # Converts the flake's root directory to a string

# Importing the shell environments from separate files
fullEnv = pkgs.callPackage ./nix/devshell.nix {
inherit pkgs scriptDir;
inherit pkgs scriptDir go;
};

ciEnv = pkgs.callPackage ./nix/ci-runtests.nix {
inherit pkgs scriptDir;
inherit pkgs scriptDir go;
};
in rec {
devShell = fullEnv;
Expand Down
5 changes: 1 addition & 4 deletions nix/ci-runtests.nix
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
{ pkgs, scriptDir }:
{ pkgs, scriptDir, go }:
with pkgs;
let
go = pkgs.go_1_22;
in
mkShell {
nativeBuildInputs = [
bash
Expand Down
5 changes: 1 addition & 4 deletions nix/devshell.nix
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
{ pkgs, scriptDir }:
{ pkgs, scriptDir, go }:
with pkgs;
let
go = pkgs.go_1_23;
in
mkShell {
nativeBuildInputs = [
# basics
Expand Down

0 comments on commit 31ab5f2

Please sign in to comment.