From 1ce40f2c1aa88f0d842d115fff26815d621dc27e Mon Sep 17 00:00:00 2001 From: matt1432 Date: Mon, 16 Dec 2024 15:02:39 -0500 Subject: [PATCH] feat(checks): add devShells --- checks/default.nix | 15 ++++++----- checks/devShells/default.nix | 10 ++++++++ checks/devices/default.nix | 3 ++- checks/packages/default.nix | 3 ++- outputs.nix | 50 ++++++++++++++++++++---------------- 5 files changed, 51 insertions(+), 30 deletions(-) create mode 100644 checks/devShells/default.nix diff --git a/checks/default.nix b/checks/default.nix index 93b84788..cc31a831 100644 --- a/checks/default.nix +++ b/checks/default.nix @@ -4,14 +4,17 @@ }: let apps = import ./apps {inherit pkgs self;}; devices = import ./devices {inherit pkgs self;}; + devShells = import ./devShells {inherit pkgs self;}; packages = import ./packages {inherit pkgs self;}; in { # Allow homie to serve a binary cache for the devices away from servivi - aptDevices = import ./devices { - onlyApt = true; - inherit pkgs self; - }; + aptDevices = + devShells + // (import ./devices { + onlyApt = true; + inherit pkgs self; + }); - all = apps // devices // packages; - inherit apps packages devices; + all = apps // devices // devShells // packages; + inherit apps devices devShells packages; } diff --git a/checks/devShells/default.nix b/checks/devShells/default.nix new file mode 100644 index 00000000..ae3c1743 --- /dev/null +++ b/checks/devShells/default.nix @@ -0,0 +1,10 @@ +{ + pkgs, + self, +}: let + inherit (pkgs.lib) mapAttrs' nameValuePair; +in + mapAttrs' + (name: shell: + nameValuePair "devShell_${name}" shell) + self.devShells.${pkgs.system} diff --git a/checks/devices/default.nix b/checks/devices/default.nix index ec8cd4e5..638277fd 100644 --- a/checks/devices/default.nix +++ b/checks/devices/default.nix @@ -15,5 +15,6 @@ self.nixosConfigurations; in mapAttrs' - (name: config: nameValuePair "device_${name}" config.config.system.build.toplevel) + (name: config: + nameValuePair "device_${name}" config.config.system.build.toplevel) devices diff --git a/checks/packages/default.nix b/checks/packages/default.nix index 2730edca..e9615215 100644 --- a/checks/packages/default.nix +++ b/checks/packages/default.nix @@ -13,5 +13,6 @@ self.packages.${pkgs.system}; in mapAttrs' - (name: pkg: nameValuePair "pkg_${name}" pkg) + (name: pkg: + nameValuePair "pkg_${name}" pkg) packages diff --git a/outputs.nix b/outputs.nix index 2365bb98..cbf4bd98 100644 --- a/outputs.nix +++ b/outputs.nix @@ -145,9 +145,11 @@ import ./apps/nix/packages.nix {inherit pkgs self;}); devShells = perSystem (pkgs: let + inherit (builtins) attrValues; + bumpNpmDeps = pkgs.writeShellApplication { name = "bumpNpmDeps"; - runtimeInputs = builtins.attrValues { + runtimeInputs = attrValues { inherit (pkgs) prefetch-npm-deps @@ -188,31 +190,35 @@ }; node = pkgs.mkShell { - packages = - (builtins.attrValues { - inherit - (pkgs) - nodejs_latest - ; - }) - ++ [bumpNpmDeps]; + packages = attrValues { + inherit + (pkgs) + nodejs_latest + ; + + inherit + bumpNpmDeps + ; + }; }; subtitles-dev = pkgs.mkShell { - packages = - (builtins.attrValues { - inherit - (pkgs) - nodejs_latest - ffmpeg-full - ; + packages = attrValues { + inherit + (pkgs) + nodejs_latest + ffmpeg-full + ; - inherit - (pkgs.nodePackages) - ts-node - ; - }) - ++ [bumpNpmDeps]; + inherit + (pkgs.nodePackages) + ts-node + ; + + inherit + bumpNpmDeps + ; + }; }; });