nix packaging

This commit is contained in:
Robin Appelman 2023-06-06 23:40:50 +02:00
commit 0bc8b7f326
6 changed files with 8288 additions and 5697 deletions

1
.envrc Normal file
View file

@ -0,0 +1 @@
use flake

2
.gitignore vendored
View file

@ -1,3 +1,5 @@
.ideaabfdb9d2d9abee3fa2055f10f3eb860954e4a8c4 .ideaabfdb9d2d9abee3fa2055f10f3eb860954e4a8c4
node_modules node_modules
build build
result
.direnv

77
flake.lock generated Normal file
View file

@ -0,0 +1,77 @@
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1686059680,
"narHash": "sha256-sp0WlCIeVczzB0G8f8iyRg3IYW7KG31mI66z7HIZwrI=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "a558f7ac29f50c4b937fb5c102f587678ae1c9fb",
"type": "github"
},
"original": {
"id": "nixpkgs",
"ref": "release-23.05",
"type": "indirect"
}
},
"npmlock2nix": {
"flake": false,
"locked": {
"lastModified": 1673447413,
"narHash": "sha256-sJM82Sj8yfQYs9axEmGZ9Evzdv/kDcI9sddqJ45frrU=",
"owner": "nix-community",
"repo": "npmlock2nix",
"rev": "9197bbf397d76059a76310523d45df10d2e4ca81",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "npmlock2nix",
"type": "github"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs",
"npmlock2nix": "npmlock2nix",
"utils": "utils"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1685518550,
"narHash": "sha256-o2d0KcvaXzTrPRIo0kOLV0/QXHhDQ5DTi+OxcjO8xqY=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "a1720a10a6cfe8234c0e93907ffe81be440f4cef",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

49
flake.nix Normal file
View file

@ -0,0 +1,49 @@
{
inputs = {
nixpkgs.url = "nixpkgs/release-23.05";
utils.url = "github:numtide/flake-utils";
npmlock2nix = {
url = "github:nix-community/npmlock2nix";
flake = false;
};
};
outputs = {
self,
nixpkgs,
utils,
npmlock2nix,
}:
utils.lib.eachDefaultSystem (system: let
overlays = [
(final: prev: {
npmlock2nix = prev.callPackage npmlock2nix {};
})
];
pkgs = import nixpkgs {
inherit system overlays;
};
lib = pkgs.lib;
src = lib.sources.sourceByRegex (lib.cleanSource ./.) ["package.*" "src(/.*)?" "tsconfig.json" ".*.config.js"];
nodeModules = pkgs.npmlock2nix.v2.node_modules {
inherit src;
nodejs = pkgs.nodejs_20;
};
in rec {
packages = rec {
map-boundaries = pkgs.npmlock2nix.v2.build {
inherit src;
installPhase = "cp -r build $out";
buildCommands = [ "npm run build" ];
nodejs = pkgs.nodejs_20;
};
node_modules = nodeModules;
default = map-boundaries;
};
devShells.default = pkgs.mkShell {
nativeBuildInputs = with pkgs; [
nodejs_20
];
};
});
}

12867
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -1,6 +1,8 @@
{ {
"name": "mapboundaries",
"version": "0.1.0",
"devDependencies": { "devDependencies": {
"@types/node": "^7.0.48", "@types/node": "^20.2.5",
"@types/react": "^15.6.7", "@types/react": "^15.6.7",
"@types/react-dom": "^0.14.23", "@types/react-dom": "^0.14.23",
"clean-webpack-plugin": "^0.1.17", "clean-webpack-plugin": "^0.1.17",
@ -13,13 +15,16 @@
"react-hot-loader": "^3.1.3", "react-hot-loader": "^3.1.3",
"style-loader": "^0.16.1", "style-loader": "^0.16.1",
"ts-loader": "^2.3.7", "ts-loader": "^2.3.7",
"typescript": "^2.6.2", "typescript": "^5.1.3",
"webpack": "^2.7.0", "webpack": "^2.7.0",
"webpack-dev-server": "^2.9.7" "webpack-dev-server": "^2.9.7"
}, },
"scripts": {
"build": "webpack --colors --display-error-details --config webpack.prod.config.js"
},
"dependencies": { "dependencies": {
"react": "^16.2.0", "react": "^16.2.0",
"react-dom": "^16.2.0", "react-dom": "^16.2.0",
"@demostf/demo.js": "^2.1.1" "@demostf/demo.js": "^2.1.2"
} }
} }