diff --git a/c/shell.nix b/c/shell.nix new file mode 100644 index 0000000..5f4c717 --- /dev/null +++ b/c/shell.nix @@ -0,0 +1,11 @@ +{ + pkgs ? import { } +}: + +pkgs.mkShellNoCC { + name = "exercism"; + buildInputs = [ + pkgs.coreutils + (pkgs.callPackage ../exercism.nix { }) + ]; +} diff --git a/exercism.nix b/exercism.nix new file mode 100644 index 0000000..2308494 --- /dev/null +++ b/exercism.nix @@ -0,0 +1,25 @@ +{ + buildGoModule + , fetchFromGitHub + , lib +}: + +buildGoModule rec { + pname = "exercism"; + version = "3.3.0"; + src = fetchFromGitHub { + owner = "exercism"; + repo = "cli"; + rev = "v${version}"; + sha256 = "Mtb5c1/k8kp7bETOSE0X969BV176jpoprr1/mQ3E4Vg="; + }; + + vendorHash = "sha256-fnsSvbuVGRAndU88su2Ck7mV8QBDhxozdmwI3XGtxcA="; + + meta = with lib; { + homepage = "https://github.com/exercism/cli"; + description = "Command line interface for exercism website"; + license = licenses.mit; + platforms = platforms.linux; + }; +} diff --git a/go/shell.nix b/go/shell.nix new file mode 100644 index 0000000..277cbcf --- /dev/null +++ b/go/shell.nix @@ -0,0 +1,11 @@ +{ + pkgs ? import { } +}: + +pkgs.mkShellNoCC { + name = "exercism"; + buildInputs = [ + pkgs.go + (pkgs.callPackage ../exercism.nix { }) + ]; +} diff --git a/lua/shell.nix b/lua/shell.nix new file mode 100644 index 0000000..7359cb2 --- /dev/null +++ b/lua/shell.nix @@ -0,0 +1,11 @@ +{ + pkgs ? import { } +}: + +pkgs.mkShellNoCC { + name = "exercism"; + buildInputs = [ + (pkgs.lua.withPackages(ps: with ps; [ busted])) + (pkgs.callPackage ../exercism.nix { }) + ]; +} diff --git a/python/shell.nix b/python/shell.nix new file mode 100644 index 0000000..c2ab4ef --- /dev/null +++ b/python/shell.nix @@ -0,0 +1,11 @@ +{ + pkgs ? import { } +}: + +pkgs.mkShellNoCC { + name = "exercism"; + buildInputs = [ + (pkgs.python311.withPackages(ps: with ps; [ pytest ])) + (pkgs.callPackage ../exercism.nix { }) + ]; +} diff --git a/rust/shell.nix b/rust/shell.nix new file mode 100644 index 0000000..cda9e24 --- /dev/null +++ b/rust/shell.nix @@ -0,0 +1,14 @@ +{ + pkgs ? import { } +}: + +pkgs.mkShellNoCC { + name = "exercism"; + buildInputs = [ + pkgs.gcc + pkgs.rustc + pkgs.cargo + + (pkgs.callPackage ../exercism.nix { }) + ]; +} diff --git a/shell.nix b/shell.nix deleted file mode 100644 index f2a12b4..0000000 --- a/shell.nix +++ /dev/null @@ -1,28 +0,0 @@ -{ - pkgs ? import { } -}: - -pkgs.mkShellNoCC { - name = "exercism"; - buildInputs = [ - # coreutils provides "make" for c compiling - pkgs.coreutils - - (pkgs.lua.withPackages(ps: with ps; [ busted])) - - (pkgs.python311.withPackages(ps: with ps; [ pytest ])) - - pkgs.go - - # Rust (needs gcc compiler) - pkgs.gcc - pkgs.rustc - pkgs.cargo - - ]; - - shellHook = '' - # Expose exercism binary to PATH, see: https://exercism.org/cli-walkthrough - export PATH="$(pwd):$PATH" - ''; -}