Created
September 26, 2022 01:48
-
-
Save rybern/d6dab84ff2b34ff9e187247e12888a6c to your computer and use it in GitHub Desktop.
flake reproducing npmlock2nix cache issue
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
inputs = rec { | |
nixpkgs.url = "nixpkgs"; | |
flake-utils.url = "github:numtide/flake-utils"; | |
sabakiSrc.url = "github:SabakiHQ/Sabaki"; | |
sabakiSrc.flake = false; | |
npmlock2nix.url = "github:winston0410/npmlock2nix/issue113"; | |
npmlock2nix.flake = false; | |
}; | |
outputs = { self, nixpkgs, flake-utils | |
, npmlock2nix | |
, sabakiSrc, ... }: | |
let | |
supportedSystems = [ "x86_64-linux" ]; | |
in | |
flake-utils.lib.eachSystem supportedSystems (system: | |
let | |
pkgs = import nixpkgs { inherit system; }; | |
sabaki = (pkgs.callPackage npmlock2nix { }).node_modules { | |
src = sabakiSrc; | |
# see https://discourse.nixos.org/t/cant-setup-development-with-electron-error-spawn-enoent/18497/6 | |
buildCommands = [ '' | |
if [ -n "$http_proxy" ]; then | |
export ELECTRON_GET_USE_PROXY=1 | |
export GLOBAL_AGENT_HTTP_PROXY=''${http_proxy} | |
export GLOBAL_AGENT_HTTPS_PROXY=''${http_proxy} | |
fi | |
# build node-red | |
npm install | |
npm run build | |
'' ]; | |
}; | |
in { | |
packages.default = sabaki; | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment