comfycamp/flake.nix

47 lines
1.1 KiB
Nix

{
description = "comfycamp.space";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-23.11";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }: flake-utils.lib.eachDefaultSystem (system:
let
system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system};
packageName = "comfycamp";
in
{
devShells.default = pkgs.mkShell {
buildInputs = [
pkgs.nodejs_20
pkgs.imagemagick
];
};
packages.${packageName} = pkgs.buildNpmPackage {
name = "${packageName}";
src = ./.;
npmDepsHash = "sha256-Nprdi+LX7/fSnrxeJzkbHX13FKM172E8wy6L+nxC/iE=";
buildInputs = [
pkgs.nodejs_20
pkgs.vips # required by sharp
];
nativeBuildInputs = [
pkgs.pkg-config # required by sharp
];
installPhase = ''
mkdir $out
npm run build
cp -r dist/* $out
'';
};
defaultPackage = self.packages.${system}.${packageName};
}
);
}