mirror of
https://git.sr.ht/~bryan_bennett/flake_env
synced 2025-12-20 16:31:24 +01:00
Compare commits
No commits in common. "a8d2d777a9f30f3ad270ee2f0509043f330a54e1" and "04337c8c5f9c7b35034eba55221cb62f9cf93675" have entirely different histories.
a8d2d777a9
...
04337c8c5f
8 changed files with 35 additions and 213 deletions
16
.github/workflows/repo-lockdown.yml
vendored
16
.github/workflows/repo-lockdown.yml
vendored
|
|
@ -1,16 +0,0 @@
|
||||||
name: "Repo Lockdown"
|
|
||||||
|
|
||||||
on:
|
|
||||||
pull_request_target:
|
|
||||||
types: 'opened'
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
pull-requests: write
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
action:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: dessant/repo-lockdown@v4
|
|
||||||
with:
|
|
||||||
pr-comment: "This repo does not accept pull requests as it is a mirror. Please instead submit patches to https://sr.ht/~bryan_bennett/flake_env."
|
|
||||||
14
.github/workflows/test.yml
vendored
14
.github/workflows/test.yml
vendored
|
|
@ -1,14 +0,0 @@
|
||||||
name: "Test"
|
|
||||||
on:
|
|
||||||
pull_request:
|
|
||||||
push:
|
|
||||||
jobs:
|
|
||||||
tests:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- uses: cachix/install-nix-action@v25
|
|
||||||
with:
|
|
||||||
github_access_token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
- run: nix build
|
|
||||||
- run: nix flake check --all-systems --keep-going
|
|
||||||
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -1,3 +1,2 @@
|
||||||
_build/
|
_build/
|
||||||
_coverage/
|
_coverage/
|
||||||
result
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
/nix/store/y3cj5g3rd064bxpi3r2i1k2nzhk9qrdw-pre-commit-config.json
|
|
||||||
26
default.nix
26
default.nix
|
|
@ -1,9 +1,6 @@
|
||||||
{ alcotest
|
{ buildDunePackage
|
||||||
, bisect_ppx
|
|
||||||
, buildDunePackage
|
|
||||||
, core
|
, core
|
||||||
, core_unix
|
, core_unix
|
||||||
, coreutils
|
|
||||||
, findlib
|
, findlib
|
||||||
, lib
|
, lib
|
||||||
, nix-filter
|
, nix-filter
|
||||||
|
|
@ -13,7 +10,6 @@
|
||||||
, re
|
, re
|
||||||
, reason
|
, reason
|
||||||
, sha
|
, sha
|
||||||
,
|
|
||||||
}:
|
}:
|
||||||
buildDunePackage {
|
buildDunePackage {
|
||||||
pname = "flake_env";
|
pname = "flake_env";
|
||||||
|
|
@ -23,28 +19,34 @@ buildDunePackage {
|
||||||
include = [
|
include = [
|
||||||
"bin"
|
"bin"
|
||||||
"lib"
|
"lib"
|
||||||
"tests"
|
|
||||||
./dune-project
|
./dune-project
|
||||||
./flake.nix
|
./flake.nix
|
||||||
./default.nix
|
./default.nix
|
||||||
./flake.lock
|
./flake.lock
|
||||||
./flake_env.opam
|
./flake_env.opam
|
||||||
./direnvrc
|
./direnvrc
|
||||||
./LICENSE
|
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
duneVersion = "3";
|
duneVersion = "3";
|
||||||
doCheck = true;
|
|
||||||
postPatch = ''
|
postPatch = ''
|
||||||
substituteInPlace direnvrc --replace "@flake_env@" "$out/bin/flake_env"
|
substituteInPlace direnvrc --replace "@flake_env@" "$out/bin/flake_env"
|
||||||
substituteInPlace tests/spit*.sh --replace "/usr/bin/env" "${coreutils}/bin/env"
|
|
||||||
'';
|
'';
|
||||||
postInstall = ''
|
postInstall = ''
|
||||||
install -m400 -D direnvrc $out/share/flake_env/direnvrc
|
install -m400 -D direnvrc $out/share/flake_env/direnvrc
|
||||||
'';
|
'';
|
||||||
checkInputs = [ alcotest bisect_ppx ];
|
nativeBuildInputs = [
|
||||||
nativeBuildInputs = [ reason ];
|
reason
|
||||||
propagatedBuildInputs = [ core core_unix findlib ocaml ppx_yojson_conv ppx_yojson_conv_lib re sha ];
|
];
|
||||||
|
propagatedBuildInputs = [
|
||||||
|
core
|
||||||
|
core_unix
|
||||||
|
findlib
|
||||||
|
ocaml
|
||||||
|
ppx_yojson_conv
|
||||||
|
ppx_yojson_conv_lib
|
||||||
|
re
|
||||||
|
sha
|
||||||
|
];
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
description = "Yet another flake plugin for direnv";
|
description = "Yet another flake plugin for direnv";
|
||||||
|
|
|
||||||
127
flake.lock
generated
127
flake.lock
generated
|
|
@ -1,21 +1,5 @@
|
||||||
{
|
{
|
||||||
"nodes": {
|
"nodes": {
|
||||||
"flake-compat": {
|
|
||||||
"flake": false,
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1696426674,
|
|
||||||
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
|
|
||||||
"owner": "edolstra",
|
|
||||||
"repo": "flake-compat",
|
|
||||||
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "edolstra",
|
|
||||||
"repo": "flake-compat",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"flake-parts": {
|
"flake-parts": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs-lib": [
|
"nixpkgs-lib": [
|
||||||
|
|
@ -36,45 +20,6 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"flake-utils": {
|
|
||||||
"inputs": {
|
|
||||||
"systems": "systems"
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1701680307,
|
|
||||||
"narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=",
|
|
||||||
"owner": "numtide",
|
|
||||||
"repo": "flake-utils",
|
|
||||||
"rev": "4022d587cbbfd70fe950c1e2083a02621806a725",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "numtide",
|
|
||||||
"repo": "flake-utils",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"gitignore": {
|
|
||||||
"inputs": {
|
|
||||||
"nixpkgs": [
|
|
||||||
"pre-commit-hooks",
|
|
||||||
"nixpkgs"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1703887061,
|
|
||||||
"narHash": "sha256-gGPa9qWNc6eCXT/+Z5/zMkyYOuRZqeFZBDbopNZQkuY=",
|
|
||||||
"owner": "hercules-ci",
|
|
||||||
"repo": "gitignore.nix",
|
|
||||||
"rev": "43e1aa1308018f37118e34d3a9cb4f5e75dc11d5",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "hercules-ci",
|
|
||||||
"repo": "gitignore.nix",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"nix-filter": {
|
"nix-filter": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1701697642,
|
"lastModified": 1701697642,
|
||||||
|
|
@ -106,81 +51,11 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs-stable": {
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1704874635,
|
|
||||||
"narHash": "sha256-YWuCrtsty5vVZvu+7BchAxmcYzTMfolSPP5io8+WYCg=",
|
|
||||||
"owner": "NixOS",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"rev": "3dc440faeee9e889fe2d1b4d25ad0f430d449356",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "NixOS",
|
|
||||||
"ref": "nixos-23.11",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"nixpkgs_2": {
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1704842529,
|
|
||||||
"narHash": "sha256-OTeQA+F8d/Evad33JMfuXC89VMetQbsU4qcaePchGr4=",
|
|
||||||
"owner": "NixOS",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"rev": "eabe8d3eface69f5bb16c18f8662a702f50c20d5",
|
|
||||||
"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": 1705229514,
|
|
||||||
"narHash": "sha256-itILy0zimR/iyUGq5Dgg0fiW8plRDyxF153LWGsg3Cw=",
|
|
||||||
"owner": "cachix",
|
|
||||||
"repo": "pre-commit-hooks.nix",
|
|
||||||
"rev": "ffa9a5b90b0acfaa03b1533b83eaf5dead819a05",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "cachix",
|
|
||||||
"repo": "pre-commit-hooks.nix",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-parts": "flake-parts",
|
"flake-parts": "flake-parts",
|
||||||
"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"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
59
flake.nix
59
flake.nix
|
|
@ -6,43 +6,30 @@
|
||||||
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"; };
|
nix-filter = {
|
||||||
nix-filter = { url = "github:numtide/nix-filter"; };
|
url = "github:numtide/nix-filter";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs =
|
outputs = inputs @ { flake-parts, nix-filter, ... }:
|
||||||
inputs @ { flake-parts
|
flake-parts.lib.mkFlake { inherit inputs; }
|
||||||
, nix-filter
|
({ lib, ... }: {
|
||||||
, pre-commit-hooks
|
systems = [
|
||||||
, ...
|
"aarch64-linux"
|
||||||
}:
|
"x86_64-linux"
|
||||||
flake-parts.lib.mkFlake { inherit inputs; } ({ lib, ... }: {
|
|
||||||
systems = [
|
|
||||||
"aarch64-linux"
|
|
||||||
"x86_64-linux"
|
|
||||||
|
|
||||||
"x86_64-darwin"
|
"x86_64-darwin"
|
||||||
"aarch64-darwin"
|
"aarch64-darwin"
|
||||||
];
|
];
|
||||||
imports = [ pre-commit-hooks.flakeModule ];
|
perSystem = { config, pkgs, self', ... }: {
|
||||||
perSystem =
|
|
||||||
{ config
|
|
||||||
, pkgs
|
|
||||||
, self'
|
|
||||||
, ...
|
|
||||||
}: {
|
|
||||||
packages = {
|
packages = {
|
||||||
flake_env = pkgs.ocamlPackages.callPackage ./default.nix {
|
flake_env = pkgs.ocamlPackages.callPackage ./default.nix { inherit nix-filter; };
|
||||||
inherit nix-filter;
|
|
||||||
};
|
|
||||||
default = config.packages.flake_env;
|
default = config.packages.flake_env;
|
||||||
};
|
};
|
||||||
devShells.default = pkgs.mkShell {
|
devShells.default = pkgs.mkShell {
|
||||||
inputsFrom = [ self'.packages.default ];
|
inputsFrom = [ self'.packages.default ];
|
||||||
packages = [
|
packages = [
|
||||||
pkgs.just
|
pkgs.just
|
||||||
pkgs.rnix-lsp
|
|
||||||
pkgs.pre-commit
|
|
||||||
pkgs.ocamlPackages.alcotest
|
pkgs.ocamlPackages.alcotest
|
||||||
pkgs.ocamlPackages.bisect_ppx
|
pkgs.ocamlPackages.bisect_ppx
|
||||||
pkgs.ocamlPackages.dune_3
|
pkgs.ocamlPackages.dune_3
|
||||||
|
|
@ -52,22 +39,12 @@
|
||||||
pkgs.ocamlPackages.ocamlformat
|
pkgs.ocamlPackages.ocamlformat
|
||||||
pkgs.ocamlPackages.ocamlformat-rpc-lib
|
pkgs.ocamlPackages.ocamlformat-rpc-lib
|
||||||
];
|
];
|
||||||
shellHook = config.pre-commit.installationScript;
|
|
||||||
};
|
|
||||||
pre-commit = {
|
|
||||||
check.enable = true;
|
|
||||||
settings.hooks = {
|
|
||||||
nixpkgs-fmt.enable = true;
|
|
||||||
dune-fmt.enable = true;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
flake = {
|
flake = {
|
||||||
overlays.default = final: _prev: {
|
overlays.default = final: _prev: {
|
||||||
flake_env = final.ocamlPackages.callPackage ./default.nix {
|
flake_env = final.ocamlPackages.callPackage ./default.nix { inherit nix-filter; };
|
||||||
inherit nix-filter;
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
});
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1,2 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env sh
|
||||||
echo "1.1.1";
|
echo "1.1.1";
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue