mirror of
https://git.sr.ht/~bryan_bennett/flake_env
synced 2025-12-16 14:41: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
|
profile=default
|
||||||
13
default.nix
13
default.nix
|
|
@ -4,11 +4,8 @@
|
||||||
, buildDunePackage
|
, buildDunePackage
|
||||||
, core
|
, core
|
||||||
, core_unix
|
, core_unix
|
||||||
, coreutils
|
|
||||||
, findlib
|
|
||||||
, lib
|
, lib
|
||||||
, nix-filter
|
, nix-filter
|
||||||
, ocaml
|
|
||||||
, ppx_yojson_conv
|
, ppx_yojson_conv
|
||||||
, ppx_yojson_conv_lib
|
, ppx_yojson_conv_lib
|
||||||
, re
|
, re
|
||||||
|
|
@ -36,14 +33,18 @@ buildDunePackage {
|
||||||
};
|
};
|
||||||
duneVersion = "3";
|
duneVersion = "3";
|
||||||
doCheck = true;
|
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 = ''
|
postPatch = ''
|
||||||
substituteInPlace direnvrc --replace "@flake_env@" "$out/bin/flake_env"
|
substituteInPlace direnvrc --replace-fail "@flake_env@" "$out/bin/flake_env"
|
||||||
substituteInPlace tests/spit*.sh --replace "/usr/bin/env" "${coreutils}/bin/env"
|
|
||||||
'';
|
'';
|
||||||
postInstall = ''
|
postInstall = ''
|
||||||
${bintools}/bin/strip --strip-unneeded $out/bin/flake_env
|
${bintools}/bin/strip --strip-unneeded $out/bin/flake_env
|
||||||
${upx}/bin/upx $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 = [
|
buildInputs = [
|
||||||
core
|
core
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1 @@
|
||||||
(lang dune 3.11)
|
(lang dune 3.11)
|
||||||
(instrument_with bisect_ppx)
|
|
||||||
94
flake.lock
generated
94
flake.lock
generated
|
|
@ -23,11 +23,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1709336216,
|
"lastModified": 1717285511,
|
||||||
"narHash": "sha256-Dt/wOWeW6Sqm11Yh+2+t0dfEWxoMxGBvv3JpIocFl9E=",
|
"narHash": "sha256-iKzJcpdXih14qYVcZ9QC9XuZYnPc6T8YImb6dX166kw=",
|
||||||
"owner": "hercules-ci",
|
"owner": "hercules-ci",
|
||||||
"repo": "flake-parts",
|
"repo": "flake-parts",
|
||||||
"rev": "f7b3c975cf067e56e7cda6cb098ebe3fb4d74ca2",
|
"rev": "2a55567fcf15b1b1c7ed712a2c6fadaec7412ea8",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
@ -36,28 +36,33 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"flake-utils": {
|
"git-hooks": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"systems": "systems"
|
"flake-compat": "flake-compat",
|
||||||
|
"gitignore": "gitignore",
|
||||||
|
"nixpkgs": [
|
||||||
|
"nixpkgs"
|
||||||
|
],
|
||||||
|
"nixpkgs-stable": "nixpkgs-stable"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1710146030,
|
"lastModified": 1717664902,
|
||||||
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
|
"narHash": "sha256-7XfBuLULizXjXfBYy/VV+SpYMHreNRHk9nKMsm1bgb4=",
|
||||||
"owner": "numtide",
|
"owner": "cachix",
|
||||||
"repo": "flake-utils",
|
"repo": "git-hooks.nix",
|
||||||
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
|
"rev": "cc4d466cb1254af050ff7bdf47f6d404a7c646d1",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "numtide",
|
"owner": "cachix",
|
||||||
"repo": "flake-utils",
|
"repo": "git-hooks.nix",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"gitignore": {
|
"gitignore": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
"pre-commit-hooks",
|
"git-hooks",
|
||||||
"nixpkgs"
|
"nixpkgs"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
@ -92,11 +97,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1711106783,
|
"lastModified": 1718396522,
|
||||||
"narHash": "sha256-PDwAcHahc6hEimyrgGmFdft75gmLrJOZ0txX7lFqq+I=",
|
"narHash": "sha256-C0re6ZtCqC1ndL7ib7vOqmgwvZDhOhJ1W0wQgX1tTIo=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "a3ed7406349a9335cb4c2a71369b697cecd9d351",
|
"rev": "3e6b9369165397184774a4b7c5e8e5e46531b53f",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
@ -122,65 +127,12 @@
|
||||||
"type": "github"
|
"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": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-parts": "flake-parts",
|
"flake-parts": "flake-parts",
|
||||||
|
"git-hooks": "git-hooks",
|
||||||
"nix-filter": "nix-filter",
|
"nix-filter": "nix-filter",
|
||||||
"nixpkgs": "nixpkgs",
|
"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"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
20
flake.nix
20
flake.nix
|
|
@ -6,14 +6,17 @@
|
||||||
url = "github:hercules-ci/flake-parts";
|
url = "github:hercules-ci/flake-parts";
|
||||||
inputs.nixpkgs-lib.follows = "nixpkgs";
|
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"; };
|
nix-filter = { url = "github:numtide/nix-filter"; };
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs =
|
outputs =
|
||||||
inputs @ { flake-parts
|
inputs @ { flake-parts
|
||||||
, nix-filter
|
, nix-filter
|
||||||
, pre-commit-hooks
|
, git-hooks
|
||||||
, ...
|
, ...
|
||||||
}:
|
}:
|
||||||
flake-parts.lib.mkFlake { inherit inputs; } ({ lib, ... }: {
|
flake-parts.lib.mkFlake { inherit inputs; } ({ lib, ... }: {
|
||||||
|
|
@ -24,7 +27,7 @@
|
||||||
"x86_64-darwin"
|
"x86_64-darwin"
|
||||||
"aarch64-darwin"
|
"aarch64-darwin"
|
||||||
];
|
];
|
||||||
imports = [ pre-commit-hooks.flakeModule ];
|
imports = [ git-hooks.flakeModule ];
|
||||||
perSystem =
|
perSystem =
|
||||||
{ config
|
{ config
|
||||||
, pkgs
|
, pkgs
|
||||||
|
|
@ -60,7 +63,16 @@
|
||||||
check.enable = true;
|
check.enable = true;
|
||||||
settings.hooks = {
|
settings.hooks = {
|
||||||
nixpkgs-fmt.enable = true;
|
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