nixos-configs/devShells/default.nix
matt1432 49bf18803a
All checks were successful
Discord / discord commits (push) Has been skipped
fix(node_modules): improve bumpNpmDeps and fix auto updates
2025-01-04 23:48:28 -05:00

41 lines
973 B
Nix

{
pkgs,
self,
...
}: let
inherit (builtins) attrValues;
neovimShells = import ./neovim-shells {inherit pkgs self;};
bumpNpmDeps = pkgs.writeShellApplication {
name = "bumpNpmDeps";
runtimeInputs = attrValues {
inherit
(pkgs)
prefetch-npm-deps
nodejs_latest
;
};
text = ''
# this command might fail but still updates the main lockfile
npm update --package-lock-only || true
hash="$(prefetch-npm-deps ./package-lock.json)"
echo "$hash"
if [[ -f ./default.nix ]]; then
sed -i "s#npmDepsHash = .*#npmDepsHash = \"$hash\";#" ./default.nix
fi
'';
};
in
{
flake = pkgs.callPackage ./flake {};
default = self.devShells.${pkgs.system}.flake;
netdaemon = pkgs.callPackage ./netdaemon {};
node = pkgs.callPackage ./node {inherit bumpNpmDeps;};
subtitles-dev = pkgs.callPackage ./subtitle-dev {inherit bumpNpmDeps;};
}
// neovimShells