mirror of
https://git.sr.ht/~bryan_bennett/flake_env
synced 2025-12-16 06:31:24 +01:00
Update flake and conventions for 24.05+
This commit is contained in:
parent
33d91a5af4
commit
bc779a2764
5 changed files with 48 additions and 84 deletions
|
|
@ -1,2 +1,2 @@
|
|||
version=0.26.1
|
||||
version=0.26.2
|
||||
profile=default
|
||||
13
default.nix
13
default.nix
|
|
@ -4,11 +4,8 @@
|
|||
, buildDunePackage
|
||||
, core
|
||||
, core_unix
|
||||
, coreutils
|
||||
, findlib
|
||||
, lib
|
||||
, nix-filter
|
||||
, ocaml
|
||||
, ppx_yojson_conv
|
||||
, ppx_yojson_conv_lib
|
||||
, re
|
||||
|
|
@ -36,14 +33,18 @@ buildDunePackage {
|
|||
};
|
||||
duneVersion = "3";
|
||||
doCheck = true;
|
||||
# We strip by hand before packing
|
||||
dontStrip = true;
|
||||
# patchELF can't handle UPX'd binaries
|
||||
# We produce a static OCaml binary that
|
||||
dontPatchELF = true;
|
||||
postPatch = ''
|
||||
substituteInPlace direnvrc --replace "@flake_env@" "$out/bin/flake_env"
|
||||
substituteInPlace tests/spit*.sh --replace "/usr/bin/env" "${coreutils}/bin/env"
|
||||
substituteInPlace direnvrc --replace-fail "@flake_env@" "$out/bin/flake_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
|
||||
install -m444 -D direnvrc $out/share/flake_env/direnvrc
|
||||
'';
|
||||
buildInputs = [
|
||||
core
|
||||
|
|
|
|||
|
|
@ -1,2 +1 @@
|
|||
(lang dune 3.11)
|
||||
(instrument_with bisect_ppx)
|
||||
(lang dune 3.11)
|
||||
94
flake.lock
generated
94
flake.lock
generated
|
|
@ -23,11 +23,11 @@
|
|||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1709336216,
|
||||
"narHash": "sha256-Dt/wOWeW6Sqm11Yh+2+t0dfEWxoMxGBvv3JpIocFl9E=",
|
||||
"lastModified": 1717285511,
|
||||
"narHash": "sha256-iKzJcpdXih14qYVcZ9QC9XuZYnPc6T8YImb6dX166kw=",
|
||||
"owner": "hercules-ci",
|
||||
"repo": "flake-parts",
|
||||
"rev": "f7b3c975cf067e56e7cda6cb098ebe3fb4d74ca2",
|
||||
"rev": "2a55567fcf15b1b1c7ed712a2c6fadaec7412ea8",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
@ -36,28 +36,33 @@
|
|||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-utils": {
|
||||
"git-hooks": {
|
||||
"inputs": {
|
||||
"systems": "systems"
|
||||
"flake-compat": "flake-compat",
|
||||
"gitignore": "gitignore",
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
],
|
||||
"nixpkgs-stable": "nixpkgs-stable"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1710146030,
|
||||
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
|
||||
"lastModified": 1717664902,
|
||||
"narHash": "sha256-7XfBuLULizXjXfBYy/VV+SpYMHreNRHk9nKMsm1bgb4=",
|
||||
"owner": "cachix",
|
||||
"repo": "git-hooks.nix",
|
||||
"rev": "cc4d466cb1254af050ff7bdf47f6d404a7c646d1",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"owner": "cachix",
|
||||
"repo": "git-hooks.nix",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"gitignore": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"pre-commit-hooks",
|
||||
"git-hooks",
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
|
|
@ -92,11 +97,11 @@
|
|||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1711106783,
|
||||
"narHash": "sha256-PDwAcHahc6hEimyrgGmFdft75gmLrJOZ0txX7lFqq+I=",
|
||||
"lastModified": 1718396522,
|
||||
"narHash": "sha256-C0re6ZtCqC1ndL7ib7vOqmgwvZDhOhJ1W0wQgX1tTIo=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "a3ed7406349a9335cb4c2a71369b697cecd9d351",
|
||||
"rev": "3e6b9369165397184774a4b7c5e8e5e46531b53f",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
@ -122,65 +127,12 @@
|
|||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs_2": {
|
||||
"locked": {
|
||||
"lastModified": 1710765496,
|
||||
"narHash": "sha256-p7ryWEeQfMwTB6E0wIUd5V2cFTgq+DRRBz2hYGnJZyA=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "e367f7a1fb93137af22a3908f00b9a35e2d286a7",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"ref": "nixpkgs-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"pre-commit-hooks": {
|
||||
"inputs": {
|
||||
"flake-compat": "flake-compat",
|
||||
"flake-utils": "flake-utils",
|
||||
"gitignore": "gitignore",
|
||||
"nixpkgs": "nixpkgs_2",
|
||||
"nixpkgs-stable": "nixpkgs-stable"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1710923068,
|
||||
"narHash": "sha256-6hOpUiuxuwpXXc/xfJsBUJeqqgGI+JMJuLo45aG3cKc=",
|
||||
"owner": "cachix",
|
||||
"repo": "pre-commit-hooks.nix",
|
||||
"rev": "e611897ddfdde3ed3eaac4758635d7177ff78673",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "cachix",
|
||||
"repo": "pre-commit-hooks.nix",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"flake-parts": "flake-parts",
|
||||
"git-hooks": "git-hooks",
|
||||
"nix-filter": "nix-filter",
|
||||
"nixpkgs": "nixpkgs",
|
||||
"pre-commit-hooks": "pre-commit-hooks"
|
||||
}
|
||||
},
|
||||
"systems": {
|
||||
"locked": {
|
||||
"lastModified": 1681028828,
|
||||
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"type": "github"
|
||||
"nixpkgs": "nixpkgs"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
|||
20
flake.nix
20
flake.nix
|
|
@ -6,14 +6,17 @@
|
|||
url = "github:hercules-ci/flake-parts";
|
||||
inputs.nixpkgs-lib.follows = "nixpkgs";
|
||||
};
|
||||
pre-commit-hooks = { url = "github:cachix/pre-commit-hooks.nix"; };
|
||||
git-hooks = {
|
||||
url = "github:cachix/git-hooks.nix";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
nix-filter = { url = "github:numtide/nix-filter"; };
|
||||
};
|
||||
|
||||
outputs =
|
||||
inputs @ { flake-parts
|
||||
, nix-filter
|
||||
, pre-commit-hooks
|
||||
, git-hooks
|
||||
, ...
|
||||
}:
|
||||
flake-parts.lib.mkFlake { inherit inputs; } ({ lib, ... }: {
|
||||
|
|
@ -24,7 +27,7 @@
|
|||
"x86_64-darwin"
|
||||
"aarch64-darwin"
|
||||
];
|
||||
imports = [ pre-commit-hooks.flakeModule ];
|
||||
imports = [ git-hooks.flakeModule ];
|
||||
perSystem =
|
||||
{ config
|
||||
, pkgs
|
||||
|
|
@ -60,7 +63,16 @@
|
|||
check.enable = true;
|
||||
settings.hooks = {
|
||||
nixpkgs-fmt.enable = true;
|
||||
dune-fmt.enable = true;
|
||||
|
||||
dune-fmt = {
|
||||
enable = true;
|
||||
settings = {
|
||||
extraRuntimeInputs = [
|
||||
pkgs.ocamlPackages.reason
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue