remove ocaml overlay

This commit is contained in:
atagen 2025-02-08 11:00:56 +11:00 committed by atagen
parent ec00841899
commit 56d0dc028f
3 changed files with 92 additions and 109 deletions

3
.gitignore vendored
View File

@ -1,4 +1,5 @@
_build
.direnv/
result
justfile
justfile
todo

25
flake.lock generated
View File

@ -73,7 +73,7 @@
"lix"
],
"nixpkgs": [
"ocaml-overlay"
"nixpkgs"
]
},
"locked": {
@ -138,34 +138,13 @@
"type": "github"
}
},
"ocaml-overlay": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1734156418,
"narHash": "sha256-7I6hKojqDm0Z+q9ZvDk8R5J/TfoPbprmVquwfQIzQrg=",
"owner": "nix-ocaml",
"repo": "nix-overlays",
"rev": "3bd751c1d602713195432d4818b35d29c4b1dccc",
"type": "github"
},
"original": {
"owner": "nix-ocaml",
"repo": "nix-overlays",
"type": "github"
}
},
"root": {
"inputs": {
"flake-utils": "flake-utils",
"lix": "lix",
"lix-module": "lix-module",
"nh": "nh",
"nixpkgs": "nixpkgs_2",
"ocaml-overlay": "ocaml-overlay"
"nixpkgs": "nixpkgs_2"
}
},
"systems": {

173
flake.nix
View File

@ -2,11 +2,6 @@
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
ocaml-overlay = {
url = "github:nix-ocaml/nix-overlays";
inputs.nixpkgs.follows = "nixpkgs";
};
flake-utils.url = "github:numtide/flake-utils";
nh.url = "github:viperML/nh";
@ -18,95 +13,100 @@
lix-module = {
url = "https://git.lix.systems/lix-project/nixos-module/archive/main.tar.gz";
inputs.nixpkgs.follows = "ocaml-overlay";
inputs.nixpkgs.follows = "nixpkgs";
inputs.lix.follows = "lix";
};
};
nixConfig = {
extra-substituters = "https://anmonteiro.nix-cache.workers.dev";
extra-trusted-public-keys = "ocaml.nix-cache.com-1:/xI2h2+56rwFfKyyFVbkJSeGqSIYMC/Je+7XXqGKDIY=";
};
outputs = inputs @ {
self,
nixpkgs,
ocaml-overlay,
flake-utils,
...
}: let
inherit (inputs) ocaml-overlay;
lix-overlay = inputs.lix-module.overlays.default;
lix-module = inputs.lix-module.nixosModules.default;
nh-overlay = inputs.nh.overlays.default;
version = builtins.toString self.lastModified;
in
outputs =
inputs@{
self,
nixpkgs,
flake-utils,
...
}:
let
lix-overlay = inputs.lix-module.overlays.default;
lix-module = inputs.lix-module.nixosModules.default;
nh-overlay = inputs.nh.overlays.default;
version = builtins.toString self.lastModified;
in
flake-utils.lib.eachDefaultSystem (
system: let
system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [
lix-overlay
nh-overlay
ocaml-overlay.overlays.default
];
modules = [lix-module];
extra-substituters = "https://anmonteiro.nix-cache.workers.dev";
extra-trusted-public-keys = "ocaml.nix-cache.com-1:/xI2h2+56rwFfKyyFVbkJSeGqSIYMC/Je+7XXqGKDIY=";
modules = [ lix-module ];
};
minimal = let
inherit
(pkgs.ocamlPackages)
minimal =
let
inherit (pkgs.ocamlPackages)
dune_3
ocaml
;
in
[
dune_3
ocaml
;
in [
dune_3
ocaml
];
dev = let
inherit
(pkgs.ocamlPackages)
];
dev =
let
inherit (pkgs.ocamlPackages)
utop
ocaml-lsp
ocamlformat
ocamlformat-rpc-lib
;
in
[
utop
ocaml-lsp
ocamlformat
ocamlformat-rpc-lib
;
in [
utop
ocaml-lsp
ocamlformat
ocamlformat-rpc-lib
];
];
inherit (pkgs) lix nh;
in {
devShells.default = let
inherit (pkgs) mkShell;
in
in
{
devShells.default =
let
inherit (pkgs) mkShell;
in
mkShell {
buildInputs = minimal ++ dev ++ [lix nh];
shellHook = let
justFile = ''
default:
@just --list
buildInputs =
minimal
++ dev
++ [
lix
nh
];
shellHook =
let
justFile = ''
default:
@just --list
@build:
nix build .#debug --offline
@build:
nix build .#debug --offline
@release:
nix build --offline
@release:
nix build --offline
@test:
printf "\\n\\n\\t************ running nix+dune tests ************\\n\\n\\n"
nix flake check --offline
@test:
printf "\\n\\n\\t************ running nix+dune tests ************\\n\\n\\n"
nix flake check --offline
@push:
git commit -a
git push
@push:
git commit -a
git push
'';
in
''
printf '${justFile}' > justfile
'';
in ''
printf '${justFile}' > justfile
'';
};
packages.default = pkgs.callPackage ./nix/default.nix {
@ -120,28 +120,31 @@
// {
nixosModules.meat = import ./nix/module.nix {
meatOverlays = [
ocaml-overlay.overlays.default
nh-overlay
self.overlays.meat
];
lixModule = lix-module;
};
overlays.meat = final: prev: let
ocaml-deps = let
inherit
(final.ocamlPackages)
dune_3
ocaml
;
in [
dune_3
ocaml
];
in {
meat = final.callPackage ./nix/default.nix {
inherit ocaml-deps version;
overlays.meat =
final: prev:
let
ocaml-deps =
let
inherit (final.ocamlPackages)
dune_3
ocaml
;
in
[
dune_3
ocaml
];
in
{
meat = final.callPackage ./nix/default.nix {
inherit ocaml-deps version;
};
};
};
};
}