From 01aa149c2f5358fb54407678641ef7644056aa3a Mon Sep 17 00:00:00 2001 From: atagen Date: Sat, 8 Feb 2025 11:00:56 +1100 Subject: [PATCH] remove ocaml overlay --- .gitignore | 3 +- flake.lock | 25 +------- flake.nix | 173 +++++++++++++++++++++++++++-------------------------- 3 files changed, 92 insertions(+), 109 deletions(-) diff --git a/.gitignore b/.gitignore index 802d42f..9a62042 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ _build .direnv/ result -justfile \ No newline at end of file +justfile +todo diff --git a/flake.lock b/flake.lock index 35b2aa7..9a8a4cf 100644 --- a/flake.lock +++ b/flake.lock @@ -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": { diff --git a/flake.nix b/flake.nix index f1c5cec..020bbe4 100644 --- a/flake.nix +++ b/flake.nix @@ -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; + }; }; - }; }; }