From 943d2ac10b017c8a9da3ea0d1dec5a54b43411c8 Mon Sep 17 00:00:00 2001 From: Zoe Roux Date: Sun, 4 May 2025 22:11:43 +0200 Subject: [PATCH] Split shell.nix into project specific ones --- api/shell.nix | 16 +++++++++++ auth/shell.nix | 15 +++++++++++ back/shell.nix | 15 +++++++++++ chart/shell.nix | 6 +++++ scanner/shell.nix | 21 +++++++++++++++ shell.nix | 64 ++++++++++---------------------------------- transcoder/shell.nix | 14 ++++++++++ 7 files changed, 101 insertions(+), 50 deletions(-) create mode 100644 api/shell.nix create mode 100644 auth/shell.nix create mode 100644 back/shell.nix create mode 100644 chart/shell.nix create mode 100644 scanner/shell.nix create mode 100644 transcoder/shell.nix diff --git a/api/shell.nix b/api/shell.nix new file mode 100644 index 00000000..1ec82678 --- /dev/null +++ b/api/shell.nix @@ -0,0 +1,16 @@ +{pkgs ? import {}}: +pkgs.mkShell { + packages = with pkgs; [ + bun + biome + # for psql to debug from the cli + postgresql_15 + # to build libvips (for sharp) + nodejs + node-gyp + pkg-config + vips + ]; + + SHARP_FORCE_GLOBAL_LIBVIPS = 1; +} diff --git a/auth/shell.nix b/auth/shell.nix new file mode 100644 index 00000000..0cf2b1f4 --- /dev/null +++ b/auth/shell.nix @@ -0,0 +1,15 @@ +{pkgs ? import {}}: +pkgs.mkShell { + packages = with pkgs; [ + go + wgo + go-migrate + sqlc + go-swag + # for psql in cli (+ pgformatter for sql files) + postgresql_15 + pgformatter + # to run tests + hurl + ]; +} diff --git a/back/shell.nix b/back/shell.nix new file mode 100644 index 00000000..b4fd8ad0 --- /dev/null +++ b/back/shell.nix @@ -0,0 +1,15 @@ +{pkgs ? import {}}: let + dotnet = with pkgs.dotnetCorePackages; + combinePackages [ + sdk_8_0 + aspnetcore_8_0 + ]; +in + pkgs.mkShell { + packages = with pkgs; [ + dotnet + csharpier + ]; + + DOTNET_ROOT = "${dotnet}"; + } diff --git a/chart/shell.nix b/chart/shell.nix new file mode 100644 index 00000000..b6333513 --- /dev/null +++ b/chart/shell.nix @@ -0,0 +1,6 @@ +{pkgs ? import {}}: +pkgs.mkShell { + packages = with pkgs; [ + kubernetes-helm + ]; +} diff --git a/scanner/shell.nix b/scanner/shell.nix new file mode 100644 index 00000000..6f2147ff --- /dev/null +++ b/scanner/shell.nix @@ -0,0 +1,21 @@ +{pkgs ? import {}}: let + python = pkgs.python312.withPackages (ps: + with ps; [ + guessit + aiohttp + jsons + watchfiles + pika + aio-pika + requests + dataclasses-json + msgspec + langcodes + ]); +in + pkgs.mkShell { + packages = with pkgs; [ + python + ruff + ]; + } diff --git a/shell.nix b/shell.nix index 1e3fb313..e621b8eb 100644 --- a/shell.nix +++ b/shell.nix @@ -1,51 +1,15 @@ -{pkgs ? import {}}: let - python = pkgs.python312.withPackages (ps: - with ps; [ - guessit - aiohttp - jsons - watchfiles - pika - aio-pika - requests - dataclasses-json - msgspec - langcodes - ]); - dotnet = with pkgs.dotnetCorePackages; - combinePackages [ - sdk_8_0 - aspnetcore_8_0 - ]; -in - pkgs.mkShell { - packages = with pkgs; [ - # nodejs-18_x - nodePackages.yarn - dotnet - csharpier - python - ruff - go - wgo - mediainfo - ffmpeg-full - postgresql_15 - pgformatter - biome - kubernetes-helm - go-migrate - sqlc - go-swag - bun - pkg-config - nodejs - node-gyp - vips - hurl - ]; +{pkgs ? import {}}: +pkgs.mkShell { + name = "kyoo"; + inputsFrom = [ + (import ./api/shell.nix {inherit pkgs;}) + (import ./auth/shell.nix {inherit pkgs;}) + (import ./back/shell.nix {inherit pkgs;}) + (import ./chart/shell.nix {inherit pkgs;}) + (import ./scanner/shell.nix {inherit pkgs;}) + (import ./transcoder/shell.nix {inherit pkgs;}) + ]; - DOTNET_ROOT = "${dotnet}"; - - SHARP_FORCE_GLOBAL_LIBVIPS = 1; - } + # env vars aren't inherited from the `inputsFrom` + SHARP_FORCE_GLOBAL_LIBVIPS = 1; +} diff --git a/transcoder/shell.nix b/transcoder/shell.nix new file mode 100644 index 00000000..cd5c85e4 --- /dev/null +++ b/transcoder/shell.nix @@ -0,0 +1,14 @@ +{pkgs ? import {}}: +pkgs.mkShell { + packages = with pkgs; [ + go + wgo + go-migrate + # for psql in cli (+ pgformatter for sql files) + postgresql_15 + pgformatter + # to debug video files + mediainfo + ffmpeg-full + ]; +}