Chrysoblog/flake.nix

71 lines
1.5 KiB
Nix
Raw Normal View History

2024-09-11 22:09:13 -07:00
{
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
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 {
buildInputs = [
pkgs.nodejs_22
];
};
};
};
}