Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

48 changes: 48 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
description = "Cosma — a document graph visualization tool";

inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";

outputs =
{ self, nixpkgs }:
let
systems = [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
forAllSystems = f: nixpkgs.lib.genAttrs systems (system: f system nixpkgs.legacyPackages.${system});
in
{
packages = forAllSystems (
system: pkgs: {
default = pkgs.buildNpmPackage {
pname = "cosma";
version = "2.6.1";
src = ./.;
nodejs = pkgs.nodejs_22;

# Use package-lock.json instead of flake.lock for dependency locking.
npmDeps = pkgs.importNpmLock { npmRoot = ./.; };
npmConfigHook = pkgs.importNpmLock.npmConfigHook;

# Skip install lifecycle scripts during `npm ci`.
npmFlags = [ "--ignore-scripts" ];

npmBuildScript = "prepare";

meta = {
description = "Document graph visualization tool";
homepage = "https://cosma.arthurperret.fr/";
license = with pkgs.lib.licenses; [
gpl3Plus
cecill21
];
mainProgram = "cosma";
};
};
}
);
};
}