From 2b8e14423ced4d847c06df2c8d54863f3d8de4e9 Mon Sep 17 00:00:00 2001 From: grimhilt Date: Sat, 8 Apr 2023 16:59:16 +0200 Subject: [PATCH] add nixshells --- .config/nixshell/c.nix | 4 +++- .config/nixshell/cpp.nix | 8 ++++++++ .config/nixshell/cypress-overlay.nix | 23 +++++++++++++++++++++++ .config/nixshell/go.nix | 9 +++++++++ .config/nixshell/matrix.nix | 11 ++++++++--- .config/nixshell/node.nix | 10 ++++++++++ .config/nixshell/postgresql.nix | 7 +++++++ .config/nixshell/react.nix | 15 +++++++++++++++ .config/nixshell/rust.nix | 14 ++++++++++++++ .config/nixshell/vuejs.nix | 24 ++++++++++++++++++++++++ 10 files changed, 121 insertions(+), 4 deletions(-) create mode 100644 .config/nixshell/cpp.nix create mode 100644 .config/nixshell/cypress-overlay.nix create mode 100644 .config/nixshell/go.nix create mode 100644 .config/nixshell/node.nix create mode 100644 .config/nixshell/postgresql.nix create mode 100644 .config/nixshell/react.nix create mode 100644 .config/nixshell/rust.nix create mode 100644 .config/nixshell/vuejs.nix diff --git a/.config/nixshell/c.nix b/.config/nixshell/c.nix index b563c84..4692f82 100644 --- a/.config/nixshell/c.nix +++ b/.config/nixshell/c.nix @@ -9,7 +9,9 @@ in SDL2.dev SDL2_image SDL2_gfx - #SDL2_image.dev + sqlite + sqlite.dev + libconfig ]; nativeBuildInputs = with pkgs; [ pkg-config diff --git a/.config/nixshell/cpp.nix b/.config/nixshell/cpp.nix new file mode 100644 index 0000000..4f83b8e --- /dev/null +++ b/.config/nixshell/cpp.nix @@ -0,0 +1,8 @@ +let + pkgs = import {}; +in + pkgs.mkShell { + buildInputs = with pkgs; [ + cmake + ]; + } diff --git a/.config/nixshell/cypress-overlay.nix b/.config/nixshell/cypress-overlay.nix new file mode 100644 index 0000000..28e5c6d --- /dev/null +++ b/.config/nixshell/cypress-overlay.nix @@ -0,0 +1,23 @@ + +# When Cypress starts, it copies some files into `~/.config/Cypress/cy/production/browsers/chrome-stable/interactive/CypressExtension/` +# from the Nix Store, one of which it attempts to modify immediately after. +# As-is, this fails because the copied file keeps the read-only flag it had in +# the Store. +# Luckily, the code responsible is a plain text script that we can easily patch: +final: prev: { + cypress = prev.cypress.overrideAttrs (oldAttrs: { + installPhase = let + old = "copyExtension(pathToExtension, extensionDest)"; + # This has only been tested against Cypress 6.0.0! + newForChrome = + "copyExtension(pathToExtension, extensionDest).then(() => fs_1.default.chmodAsync(extensionBg, 0o0644))"; + newForFirefox = + "copyExtension(pathToExtension, extensionDest).then(() => fs.chmodAsync(extensionBg, 0o0644))"; + in '' + sed -i 's/${old}/${newForChrome}/' \ + ./resources/app/packages/server/lib/browsers/chrome.js + sed -i 's/${old}/${newForFirefox}/' \ + ./resources/app/packages/server/lib/browsers/utils.js + '' + oldAttrs.installPhase; + }); +} diff --git a/.config/nixshell/go.nix b/.config/nixshell/go.nix new file mode 100644 index 0000000..2bc78f6 --- /dev/null +++ b/.config/nixshell/go.nix @@ -0,0 +1,9 @@ +let + pkgs = import {}; + unstable = import {}; +in + pkgs.mkShell { + buildInputs = with pkgs; [ + go + ]; + } diff --git a/.config/nixshell/matrix.nix b/.config/nixshell/matrix.nix index 28808cb..3c678e0 100644 --- a/.config/nixshell/matrix.nix +++ b/.config/nixshell/matrix.nix @@ -1,6 +1,7 @@ -with (import {}); -mkShell { - buildInputs = [ +let pkgs = import { overlays = [ (import ./cypress-overlay.nix) ]; }; +in pkgs.mkShell { + name = "matrix-shell"; + buildInputs = with pkgs; [ yarn docker act @@ -16,6 +17,7 @@ mkShell { xorg.libXtst xorg.xauth xvfb-run + (with dotnetCorePackages; combinePackages [ sdk_5_0 ]) stdenv.cc.cc zlib glib dbus gtk3 atk pango freetype fontconfig gdk-pixbuf cairo cups expat libgpg-error alsa-lib nspr nss xorg.libXrender xorg.libX11 xorg.libXext xorg.libXdamage xorg.libXtst @@ -29,6 +31,9 @@ mkShell { shellHook = '' export NAME="matrix-shell" export NODE_OPTIONS=--openssl-legacy-provider + export CYPRESS_INSTALL_BINARY=0 + export CYPRESS_RUN_BINARY=${pkgs.cypress}/bin/Cypress ''; } +#https://gist.github.com/r-k-b/2485f977b476aa3f76a47329ce7f9ad4?permalink_comment_id=4402925 diff --git a/.config/nixshell/node.nix b/.config/nixshell/node.nix new file mode 100644 index 0000000..4dadbcf --- /dev/null +++ b/.config/nixshell/node.nix @@ -0,0 +1,10 @@ +with (import {}); +mkShell { + buildInputs = [ + yarn + nodejs + nodePackages.npm + nodePackages.nodemon + ]; +} + diff --git a/.config/nixshell/postgresql.nix b/.config/nixshell/postgresql.nix new file mode 100644 index 0000000..0e6b504 --- /dev/null +++ b/.config/nixshell/postgresql.nix @@ -0,0 +1,7 @@ +with import {}; +mkShell { + buildInputs = [ + postgresql + ]; +} + diff --git a/.config/nixshell/react.nix b/.config/nixshell/react.nix new file mode 100644 index 0000000..3279d17 --- /dev/null +++ b/.config/nixshell/react.nix @@ -0,0 +1,15 @@ +with (import {}); +mkShell { + buildInputs = [ + yarn + nodejs + ] ++ (with pkgs.nodePackages; [ + npm + nodemon + ]); + shellHook = '' + export NAME="react-shell" + export NODE_OPTIONS=--openssl-legacy-provider + ''; +} + diff --git a/.config/nixshell/rust.nix b/.config/nixshell/rust.nix new file mode 100644 index 0000000..7ba2c10 --- /dev/null +++ b/.config/nixshell/rust.nix @@ -0,0 +1,14 @@ +let + pkgs = import {}; + unstable = import {}; +in + pkgs.mkShell { + buildInputs = with pkgs; [ + unstable.rustc + cargo + libressl + ]; + nativeBuildInputs = with pkgs; [ + pkg-config + ]; + } diff --git a/.config/nixshell/vuejs.nix b/.config/nixshell/vuejs.nix new file mode 100644 index 0000000..335f2be --- /dev/null +++ b/.config/nixshell/vuejs.nix @@ -0,0 +1,24 @@ +with (import {}); +let + vueCli = pkgs.fetchFromGitHub { + owner = "vuejs"; + repo = "vue-cli"; + rev = "v4.5.15"; + sha256 = "sha256-zJhk7tZAjqGLQOSTs3t5pj5qNtwersItGUM2oD4/R8o="; + }; +in mkShell { + buildInputs = [ + yarn + nodejs + vueCli + ] ++ (with pkgs.nodePackages; [ + npm + nodemon + ]); + shellHook = '' + export NAME="vue-shell" +export PATH=$(yarn bin):$PATH + + ''; +} +