From cc2a5451dc8ac8a3a9368e1a5b3a1488b15a8bc3 Mon Sep 17 00:00:00 2001 From: Jonas Nick Date: Fri, 29 Jan 2021 21:04:10 +0000 Subject: [PATCH] ci: Refactor Nix shell files --- ci/mkshell.nix | 12 ++++++++++++ ci/shell-i686.nix | 13 ++++--------- ci/shell.nix | 13 ++++--------- 3 files changed, 20 insertions(+), 18 deletions(-) create mode 100644 ci/mkshell.nix diff --git a/ci/mkshell.nix b/ci/mkshell.nix new file mode 100644 index 0000000000000..3886b556d0997 --- /dev/null +++ b/ci/mkshell.nix @@ -0,0 +1,12 @@ +{ pkgs }: + +with pkgs; + +mkShell { + buildInputs = [ + bash file pkgconfig autoconf automake libtool gmp valgrind clang gcc + ]; + shellHook = '' + echo Running nix-shell with nixpkgs version: $(nix eval --raw nixpkgs.lib.version) + ''; +} diff --git a/ci/shell-i686.nix b/ci/shell-i686.nix index 6ab4f121bd35a..12528dd9f005f 100644 --- a/ci/shell-i686.nix +++ b/ci/shell-i686.nix @@ -1,9 +1,4 @@ -with (import {}).pkgsi686Linux; -mkShell { - buildInputs = [ - bash file pkgconfig autoconf automake libtool gmp valgrind clang gcc - ]; - shellHook = '' - echo Running nix-shell with nixpkgs version: $(nix eval --raw nixpkgs.lib.version) - ''; -} +let + pkgs = (import {}).pkgsi686Linux; +in +import ./mkshell.nix { inherit pkgs; } diff --git a/ci/shell.nix b/ci/shell.nix index 2ce852515b4d4..e83dc870f0442 100644 --- a/ci/shell.nix +++ b/ci/shell.nix @@ -1,9 +1,4 @@ -with (import {}); -mkShell { - buildInputs = [ - bash file pkgconfig autoconf automake libtool gmp valgrind clang gcc - ]; - shellHook = '' - echo Running nix-shell with nixpkgs version: $(nix eval --raw nixpkgs.lib.version) - ''; -} +let + pkgs = (import {}); +in +import ./mkshell.nix { inherit pkgs; }