Skip to content

Commit

Permalink
init: atomic-browser at 0.37.0
Browse files Browse the repository at this point in the history
- Use pnpm2nix-nzbr which supports pnpm version 6 lockfiles.
- Because atomic-browser is using pnpm workspaces, `installInPlace` and `distDir="."`

A follow up PR will create a module for this

Co-authored-by: Anish Lakhwara <[email protected]>
  • Loading branch information
albertchae and Chickensoupwithrice committed Mar 6, 2024
1 parent 2aaa8b5 commit 3d62c31
Show file tree
Hide file tree
Showing 4 changed files with 91 additions and 2 deletions.
57 changes: 56 additions & 1 deletion flake.lock

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

9 changes: 8 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
inputs.rust-overlay.inputs.nixpkgs.follows = "nixpkgs";
inputs.dream2nix.url = "github:nix-community/dream2nix";
inputs.dream2nix.inputs.nixpkgs.follows = "nixpkgs";
inputs.pnpm2nix-nzbr.url = "github:nzbr/pnpm2nix-nzbr";
inputs.pnpm2nix-nzbr.inputs.nixpkgs.follows = "nixpkgs";

outputs = {
self,
Expand All @@ -26,6 +28,7 @@
sops-nix,
rust-overlay,
dream2nix,
pnpm2nix-nzbr,
...
}: let
inherit
Expand Down Expand Up @@ -72,6 +75,7 @@

pkgsByName = import ./pkgs/by-name {
inherit (pkgs) lib;
inherit (pkgs) mkPnpmPackage;
inherit callPackage dream2nix pkgs;
};

Expand Down Expand Up @@ -105,7 +109,10 @@
rawNixosConfigs;

eachDefaultSystemOutputs = flake-utils.lib.eachDefaultSystem (system: let
pkgs = importNixpkgs system [rust-overlay.overlays.default];
pkgs = importNixpkgs system [
rust-overlay.overlays.default
pnpm2nix-nzbr.overlays.default
];
treefmtEval = loadTreefmt pkgs;
toplevel = name: config: nameValuePair "nixosConfigs/${name}" config.config.system.build.toplevel;
in {
Expand Down
26 changes: 26 additions & 0 deletions pkgs/by-name/atomic-browser/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{ pkgs, fetchFromGitHub, mkPnpmPackage, fetchYarnDeps, fetchpatch, ... }:
let
source = fetchFromGitHub {
owner = "atomicdata-dev";
repo = "atomic-server";
rev = "v0.37.0";
hash = "sha256-+Lk2MvkTj+B+G6cNbWAbPrN5ECiyMJ4HSiiLzBLd74g=";
};
in
mkPnpmPackage rec {
name = "atomic-browser";
version = "v0.37.0";
src = "${source}/browser";

# These 2 options are needed to work with pnpm workspaces, which atomic-browser is using
# https://github.com/nzbr/pnpm2nix-nzbr/issues/29#issuecomment-1918811838
installInPlace = true;
distDir = ".";

meta = with lib; {
description = "Create, share, fetch and model linked Atomic Data! There are three components: a javascript / typescript library, a react library, and a complete GUI: Atomic-Data Browser."
homepage = "https://github.com/atomicdata-dev/atomic-server/tree/develop/browser";
license = licenses.mit;
maintainers = with maintainers; [];
};
}
1 change: 1 addition & 0 deletions pkgs/by-name/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
lib,
callPackage,
dream2nix,
mkPnpmPackage,
pkgs,
}: let
baseDirectory = ./.;
Expand Down

0 comments on commit 3d62c31

Please sign in to comment.