From 41744cc02497564b4cb02db209e0d19978810640 Mon Sep 17 00:00:00 2001 From: Luc Perkins Date: Sat, 16 Jul 2022 17:00:05 +0200 Subject: [PATCH] More direnv support plus gitignore --- go1.17/.envrc | 4 ++++ go1.17/.gitignore | 1 + go1.17/flake.nix | 10 ++++++++-- go1.18/.envrc | 4 ++++ go1.18/.gitignore | 1 + go1.18/flake.nix | 10 ++++++++-- rust/.gitignore | 2 +- 7 files changed, 27 insertions(+), 5 deletions(-) create mode 100644 go1.17/.envrc create mode 100644 go1.17/.gitignore create mode 100644 go1.18/.envrc create mode 100644 go1.18/.gitignore diff --git a/go1.17/.envrc b/go1.17/.envrc new file mode 100644 index 0000000..03c6004 --- /dev/null +++ b/go1.17/.envrc @@ -0,0 +1,4 @@ +if ! has nix_direnv_version || ! nix_direnv_version 2.1.1; then + source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/2.1.1/direnvrc" "sha256-b6qJ4r34rbE23yWjMqbmu3ia2z4b2wIlZUksBke/ol0=" +fi +use flake . diff --git a/go1.17/.gitignore b/go1.17/.gitignore new file mode 100644 index 0000000..9b42106 --- /dev/null +++ b/go1.17/.gitignore @@ -0,0 +1 @@ +.direnv/ diff --git a/go1.17/flake.nix b/go1.17/flake.nix index a71786b..7454483 100644 --- a/go1.17/flake.nix +++ b/go1.17/flake.nix @@ -10,12 +10,18 @@ flake-utils.lib.eachDefaultSystem (system: let pkgs = import nixpkgs { inherit system; }; + goPkg = pkgs.go_1_17; in { + apps.default = { + type = "app"; + program = "${goPkg}/bin/go"; + }; + devShells = { default = pkgs.mkShellNoCC { buildInputs = with pkgs; [ # go 1.17.1 - go + goPkg # goimports, godoc, etc. gotools @@ -35,7 +41,7 @@ shellHook = '' echo "Entering Go env" - echo "Running `${pkgs.go}/bin/go version`" + echo "Running `${goPkg}/bin/go version`" ''; }; }; diff --git a/go1.18/.envrc b/go1.18/.envrc new file mode 100644 index 0000000..03c6004 --- /dev/null +++ b/go1.18/.envrc @@ -0,0 +1,4 @@ +if ! has nix_direnv_version || ! nix_direnv_version 2.1.1; then + source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/2.1.1/direnvrc" "sha256-b6qJ4r34rbE23yWjMqbmu3ia2z4b2wIlZUksBke/ol0=" +fi +use flake . diff --git a/go1.18/.gitignore b/go1.18/.gitignore new file mode 100644 index 0000000..9b42106 --- /dev/null +++ b/go1.18/.gitignore @@ -0,0 +1 @@ +.direnv/ diff --git a/go1.18/flake.nix b/go1.18/flake.nix index 91f572c..0e78608 100644 --- a/go1.18/flake.nix +++ b/go1.18/flake.nix @@ -10,12 +10,18 @@ flake-utils.lib.eachDefaultSystem (system: let pkgs = import nixpkgs { inherit system; }; + goPkg = pkgs.go_1_18; in { + apps.default = { + type = "app"; + program = "${goPkg}/bin/go"; + }; + devShells = { default = pkgs.mkShellNoCC { buildInputs = with pkgs; [ # go 1.18.3 - go_1_18 + goPkg # goimports, godoc, etc. gotools @@ -35,7 +41,7 @@ shellHook = '' echo "Entering Go env" - echo "Running `${pkgs.go}/bin/go version`" + echo "Running `${goPkg}/bin/go version`" ''; }; }; diff --git a/rust/.gitignore b/rust/.gitignore index bd32e74..e9b73f9 100644 --- a/rust/.gitignore +++ b/rust/.gitignore @@ -1,2 +1,2 @@ -.direnv +.direnv/ target