Skip to content

Commit

Permalink
align registry template floco-cfg.nix with basic template (#61)
Browse files Browse the repository at this point in the history
  • Loading branch information
aakropotkin authored Jul 22, 2023
1 parent e667bbd commit b67b555
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 5 deletions.
8 changes: 8 additions & 0 deletions templates/basic/foverrides.nix
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,14 @@ in {
##];


# The `copyTree' which will cause the `node_modules/' directory to be copied
# and made writable at when `build' scripts are run.
# This can help resolve common issues with packages using tools like
# `angular' which modify the contents of their `node_modules/' directory
# at build time.
##built.copyTree = true;


# ---------------------------------------------------------------------------- #

}; # End target package overrides
Expand Down
22 changes: 17 additions & 5 deletions templates/registry/floco-cfg.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,23 @@

{
imports = let
ifExist = builtins.filter builtins.pathExists [
./pdefs.nix # Generated `pdefs.nix'
./foverrides.nix # Explicit config
];
in ifExist ++ [
maybePdefs =
if builtins.pathExists ./pdefs.nix then [./pdefs.nix] else
if builtins.pathExists ./pdefs.json then [{
_file = ./pdefs.json;
config = let
c = builtins.fromJSON ( builtins.readFile ./pdefs.json );
in c.config or c;
}] else [];
maybeFoverrides =
if builtins.pathExists ./foverrides.nix then [./foverrides.nix] else
if builtins.pathExists ./foverrides.json then [{
_file = ./foverrides.json;
config = let
c = builtins.fromJSON ( builtins.readFile ./foverrides.json );
in c.config or c;
}] else [];
in maybePdefs ++ maybeFoverrides ++ [
# CHANGEME: If you depend on other `floco' projects, you can import their
# `floco-cfg.nix' files here to make those configs available.
];
Expand Down
7 changes: 7 additions & 0 deletions templates/registry/foverrides.nix
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,18 @@ in {
# Nixpkgs to the "install" phase environment.
# This is useful for linking against libraries when running `node-gyp'
# and providing other utilities that may be required.
#
# Below that segment, you'll see an option to `copyTree' which will cause
# the `node_modules/' directory to be copied and made writable at when
# `install' scripts are run.
# This can help resolve issues with packages such as `esbuild' which
# modify the contents of their `node_modules/' directory at install time.

##installed = { pkgs, ... }: {
## extraBuildInputs = [
## pkgs.pkgconfig
## ];
## copyTree = true;
##};


Expand Down

0 comments on commit b67b555

Please sign in to comment.