Compare commits

...

5 commits

Author SHA1 Message Date
Bryan Bennett
e513b6e6a6
Update flake.lock 2024-03-25 07:30:51 -04:00
Bryan Bennett
b19f5d67c5
Add very basic .build.yml 2024-03-25 07:29:29 -04:00
Bryan Bennett
a2fff9333f
Strip and pack final binary 2024-03-23 08:17:20 -04:00
Bryan Bennett
358ae864fc
Fix depends specification 2024-03-23 08:16:51 -04:00
Bryan Bennett
606d717276
Fix error message if failing to hash file 2024-03-23 07:15:16 -04:00
5 changed files with 60 additions and 40 deletions

8
.build.yml Normal file
View file

@ -0,0 +1,8 @@
image: nixos/unstable
environment:
NIX_CONFIG: "experimental-features = nix-command flakes"
packages:
- cachix
tasks:
-build: |
nix build . -vL --no-out-link

View file

@ -16,7 +16,7 @@ let main = () => {
switch (Util.hash_files(paths)) {
| Ok(hsh) => hsh
| Error(msg) =>
Printf.eprintf("%s\n", e);
Printf.eprintf("%s\n", msg);
exit(1);
};

View file

@ -1,4 +1,5 @@
{ alcotest
, bintools
, bisect_ppx
, buildDunePackage
, core
@ -13,6 +14,7 @@
, re
, reason
, sha
, upx
,
}:
buildDunePackage {
@ -30,7 +32,6 @@ buildDunePackage {
./flake.lock
./flake_env.opam
./direnvrc
./LICENSE
];
};
duneVersion = "3";
@ -40,11 +41,20 @@ buildDunePackage {
substituteInPlace tests/spit*.sh --replace "/usr/bin/env" "${coreutils}/bin/env"
'';
postInstall = ''
${bintools}/bin/strip --strip-unneeded $out/bin/flake_env
${upx}/bin/upx $out/bin/flake_env
install -m400 -D direnvrc $out/share/flake_env/direnvrc
'';
buildInputs = [
core
core_unix
ppx_yojson_conv
ppx_yojson_conv_lib
re
sha
];
checkInputs = [ alcotest bisect_ppx ];
nativeBuildInputs = [ reason ];
propagatedBuildInputs = [ core core_unix findlib ocaml ppx_yojson_conv ppx_yojson_conv_lib re sha ];
meta = with lib; {
description = "Yet another flake plugin for direnv";

48
flake.lock generated
View file

@ -23,11 +23,11 @@
]
},
"locked": {
"lastModified": 1701473968,
"narHash": "sha256-YcVE5emp1qQ8ieHUnxt1wCZCC3ZfAS+SRRWZ2TMda7E=",
"lastModified": 1709336216,
"narHash": "sha256-Dt/wOWeW6Sqm11Yh+2+t0dfEWxoMxGBvv3JpIocFl9E=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "34fed993f1674c8d06d58b37ce1e0fe5eebcb9f5",
"rev": "f7b3c975cf067e56e7cda6cb098ebe3fb4d74ca2",
"type": "github"
},
"original": {
@ -41,11 +41,11 @@
"systems": "systems"
},
"locked": {
"lastModified": 1701680307,
"narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=",
"lastModified": 1710146030,
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "4022d587cbbfd70fe950c1e2083a02621806a725",
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
"type": "github"
},
"original": {
@ -62,11 +62,11 @@
]
},
"locked": {
"lastModified": 1703887061,
"narHash": "sha256-gGPa9qWNc6eCXT/+Z5/zMkyYOuRZqeFZBDbopNZQkuY=",
"lastModified": 1709087332,
"narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=",
"owner": "hercules-ci",
"repo": "gitignore.nix",
"rev": "43e1aa1308018f37118e34d3a9cb4f5e75dc11d5",
"rev": "637db329424fd7e46cf4185293b9cc8c88c95394",
"type": "github"
},
"original": {
@ -77,11 +77,11 @@
},
"nix-filter": {
"locked": {
"lastModified": 1701697642,
"narHash": "sha256-L217WytWZHSY8GW9Gx1A64OnNctbuDbfslaTEofXXRw=",
"lastModified": 1710156097,
"narHash": "sha256-1Wvk8UP7PXdf8bCCaEoMnOT1qe5/Duqgj+rL8sRQsSM=",
"owner": "numtide",
"repo": "nix-filter",
"rev": "c843418ecfd0344ecb85844b082ff5675e02c443",
"rev": "3342559a24e85fc164b295c3444e8a139924675b",
"type": "github"
},
"original": {
@ -92,11 +92,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1702272962,
"narHash": "sha256-D+zHwkwPc6oYQ4G3A1HuadopqRwUY/JkMwHz1YF7j4Q=",
"lastModified": 1711106783,
"narHash": "sha256-PDwAcHahc6hEimyrgGmFdft75gmLrJOZ0txX7lFqq+I=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "e97b3e4186bcadf0ef1b6be22b8558eab1cdeb5d",
"rev": "a3ed7406349a9335cb4c2a71369b697cecd9d351",
"type": "github"
},
"original": {
@ -108,11 +108,11 @@
},
"nixpkgs-stable": {
"locked": {
"lastModified": 1704874635,
"narHash": "sha256-YWuCrtsty5vVZvu+7BchAxmcYzTMfolSPP5io8+WYCg=",
"lastModified": 1710695816,
"narHash": "sha256-3Eh7fhEID17pv9ZxrPwCLfqXnYP006RKzSs0JptsN84=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "3dc440faeee9e889fe2d1b4d25ad0f430d449356",
"rev": "614b4613980a522ba49f0d194531beddbb7220d3",
"type": "github"
},
"original": {
@ -124,11 +124,11 @@
},
"nixpkgs_2": {
"locked": {
"lastModified": 1704842529,
"narHash": "sha256-OTeQA+F8d/Evad33JMfuXC89VMetQbsU4qcaePchGr4=",
"lastModified": 1710765496,
"narHash": "sha256-p7ryWEeQfMwTB6E0wIUd5V2cFTgq+DRRBz2hYGnJZyA=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "eabe8d3eface69f5bb16c18f8662a702f50c20d5",
"rev": "e367f7a1fb93137af22a3908f00b9a35e2d286a7",
"type": "github"
},
"original": {
@ -147,11 +147,11 @@
"nixpkgs-stable": "nixpkgs-stable"
},
"locked": {
"lastModified": 1705229514,
"narHash": "sha256-itILy0zimR/iyUGq5Dgg0fiW8plRDyxF153LWGsg3Cw=",
"lastModified": 1710923068,
"narHash": "sha256-6hOpUiuxuwpXXc/xfJsBUJeqqgGI+JMJuLo45aG3cKc=",
"owner": "cachix",
"repo": "pre-commit-hooks.nix",
"rev": "ffa9a5b90b0acfaa03b1533b83eaf5dead819a05",
"rev": "e611897ddfdde3ed3eaac4758635d7177ff78673",
"type": "github"
},
"original": {

View file

@ -39,19 +39,21 @@
};
devShells.default = pkgs.mkShell {
inputsFrom = [ self'.packages.default ];
packages = [
pkgs.just
pkgs.rnix-lsp
pkgs.pre-commit
pkgs.ocamlPackages.alcotest
pkgs.ocamlPackages.bisect_ppx
pkgs.ocamlPackages.dune_3
pkgs.ocamlPackages.findlib
pkgs.ocamlPackages.ocaml
pkgs.ocamlPackages.ocaml-lsp
pkgs.ocamlPackages.ocamlformat
pkgs.ocamlPackages.ocamlformat-rpc-lib
];
packages = builtins.attrValues {
inherit (pkgs)
just
nil
pre-commit
;
inherit (pkgs.ocamlPackages)
dune_3
findlib
ocaml
ocaml-lsp
ocamlformat
ocamlformat-rpc-lib
;
};
shellHook = config.pre-commit.installationScript;
};
pre-commit = {