1
0
Fork 0
mirror of https://codeberg.org/demostf/api.git synced 2026-06-03 18:04:08 +02:00

add flake

This commit is contained in:
Robin Appelman 2022-11-10 18:59:23 +01:00
commit af832d533e
4 changed files with 77 additions and 0 deletions

1
.envrc Normal file
View file

@ -0,0 +1 @@
use flake

2
.gitignore vendored
View file

@ -3,3 +3,5 @@
vendor vendor
node_modules node_modules
*.cache *.cache
.direnv
result

42
flake.lock generated Normal file
View file

@ -0,0 +1,42 @@
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1668066732,
"narHash": "sha256-7LD2/+r0k1OOXX6+1eds0V5nx8GdcWibgcOtHMXI8pA=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "2e68d26162c79e5da8a318989f92b6a508893c41",
"type": "github"
},
"original": {
"id": "nixpkgs",
"ref": "release-22.05",
"type": "indirect"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs",
"utils": "utils"
}
},
"utils": {
"locked": {
"lastModified": 1667395993,
"narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

32
flake.nix Normal file
View file

@ -0,0 +1,32 @@
{
inputs = {
nixpkgs.url = "nixpkgs/release-22.05";
utils.url = "github:numtide/flake-utils";
};
outputs = {
self,
nixpkgs,
utils,
}:
utils.lib.eachDefaultSystem (system: let
pkgs = import nixpkgs {
inherit system;
};
npmLd = pkgs.writeShellScriptBin "npm" ''
PATH="$PATH ${pkgs.nodejs-16_x}/bin" LD=$CC ${pkgs.nodejs-16_x}/bin/npm $@
'';
nodeLd = pkgs.writeShellScriptBin "node" ''
LD=$CC ${pkgs.nodejs-16_x}/bin/node $@
'';
in rec {
devShells.default = pkgs.mkShell {
nativeBuildInputs = with pkgs; [
gnumake
php
npmLd
nodeLd
];
};
});
}