Chrysoblog/flake.nix

79 lines
1.8 KiB
Nix

{
description = "Chrysoblog";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05";
flake-parts.url = "github:hercules-ci/flake-parts";
dream2nix.url = "github:nix-community/dream2nix";
};
outputs = inputs @ {
self,
nixpkgs,
flake-parts,
dream2nix,
...
} : flake-parts.lib.mkFlake { inherit inputs; } {
flake = {
};
systems = [
"x86_64-linux"
"x86_64-darwin"
];
perSystem = { system, pkgs, ... }: let
nodejs = pkgs.nodejs_22;
module = {
lib,
config,
dream2nix,
...
}: {
imports = [
dream2nix.modules.dream2nix.nodejs-package-lock-v3
dream2nix.modules.dream2nix.nodejs-granular-v3
];
mkDerivation = {
src = ./.;
};
deps = { pkgs, ...}: {
};
nodejs-package-lock-v3 = {
packageLockFile = "${config.mkDerivation.src}/package-lock.json";
};
# This must match project name in `package.json`, and it cannot have spaces.
name = "chrysoblog";
version = "0.1.0";
};
in rec {
packages = {
default = dream2nix.lib.evalModules {
packageSets.nixpkgs = pkgs;
modules = [
module
{
paths.projectRoot = ./.;
paths.package = ./.;
}
];
};
};
devShells.default = pkgs.mkShell {
packages = [
pkgs.playwright-driver.browsers
];
PLAYWRIGHT_NODEJS_PATH = "${nodejs}/bin/node";
PLAYWRIGHT_BROWSERS_PATH = "${pkgs.playwright-driver.browsers}";
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD = 1;
PLAYWRIGHT_SKIP_VALIDATE_HOST_REQUIREMENTS = 1;
buildInputs = [
nodejs
];
};
};
};
}