From 40feebba44d4722706b66ac51e1997cb630c09c9 Mon Sep 17 00:00:00 2001 From: atagen Date: Sat, 8 Feb 2025 11:01:09 +1100 Subject: [PATCH] remove ocaml overlay --- flake.lock | 29 ++----------- flake.nix | 121 +++++++++++++++++++++++++++-------------------------- 2 files changed, 66 insertions(+), 84 deletions(-) diff --git a/flake.lock b/flake.lock index 34088b2..421037e 100644 --- a/flake.lock +++ b/flake.lock @@ -20,11 +20,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1733749988, - "narHash": "sha256-+5qdtgXceqhK5ZR1YbP1fAUsweBIrhL38726oIEAtDs=", + "lastModified": 1733935885, + "narHash": "sha256-xyiHLs6KJ1fxeGmcCxKjJE4yJknVJxbC8Y/ZRYyC8WE=", "owner": "nixos", "repo": "nixpkgs", - "rev": "bc27f0fde01ce4e1bfec1ab122d72b7380278e68", + "rev": "5a48e3c2e435e95103d56590188cfed7b70e108c", "type": "github" }, "original": { @@ -34,31 +34,10 @@ "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", - "nixpkgs": "nixpkgs", - "ocaml-overlay": "ocaml-overlay" + "nixpkgs": "nixpkgs" } }, "systems": { diff --git a/flake.nix b/flake.nix index 9734ab2..3a8d591 100644 --- a/flake.nix +++ b/flake.nix @@ -1,10 +1,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"; }; @@ -13,23 +9,23 @@ extra-trusted-public-keys = "ocaml.nix-cache.com-1:/xI2h2+56rwFfKyyFVbkJSeGqSIYMC/Je+7XXqGKDIY="; }; - outputs = { - self, - nixpkgs, - ocaml-overlay, - flake-utils, - }: let - version = builtins.toString self.lastModified; - in + outputs = + { + self, + nixpkgs, + flake-utils, + }: + let + version = builtins.toString self.lastModified; + in flake-utils.lib.eachDefaultSystem ( - system: let + system: + let pkgs = import nixpkgs { inherit system; - overlays = [ocaml-overlay.overlays.default]; }; inherit (pkgs) mkShell ocamlPackages; - inherit - (ocamlPackages) + inherit (ocamlPackages) dune_3 ocaml utop @@ -54,34 +50,37 @@ ocamlformat-rpc-lib pkgs.just ]; - in { + in + { devShells.default = mkShell { buildInputs = minimal ++ dev; - shellHook = let - justFile = '' - default: - @just --list + 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 - nix build .#tests --offline - printf "\\n\\n\\t************ running visual test ************\\n\\n\\n" - echo one two three four | CULRS="(255,0,0);(0,0,255);#00FF00" CULR_ORDER="1;0;2" result/bin/culr + @test: + printf "\\n\\n\\t************ running nix+dune tests ************\\n\\n\\n" + nix flake check --offline + nix build .#tests --offline + printf "\\n\\n\\t************ running visual test ************\\n\\n\\n" + echo one two three four | CULRS="(255,0,0);(0,0,255);#00FF00" CULR_ORDER="1;0;2" result/bin/culr - @push: - git commit -a - git push + @push: + git commit -a + git push + ''; + in + '' + printf '${justFile}' > justfile ''; - in '' - printf '${justFile}' > justfile - ''; }; checks.default = pkgs.callPackage ./nix/test.nix { @@ -109,29 +108,33 @@ } ) // { - nixosModules.culr = import ./nix/module.nix {overlays = [ocaml-overlay.overlays.default self.overlays.culr];}; + nixosModules.culr = import ./nix/module.nix { overlays = [ self.overlays.culr ]; }; - overlays.culr = final: prev: let - ocaml-deps = let - inherit - (final.ocamlPackages) - dune_3 - ocaml - angstrom - angstrom-unix - ppx_inline_test - ; - in [ - dune_3 - ocaml - angstrom - angstrom-unix - ppx_inline_test - ]; - in { - culr = final.callPackage ./nix/default.nix { - inherit ocaml-deps version; + overlays.culr = + final: prev: + let + ocaml-deps = + let + inherit (prev.ocamlPackages) + dune_3 + ocaml + angstrom + angstrom-unix + ppx_inline_test + ; + in + [ + dune_3 + ocaml + angstrom + angstrom-unix + ppx_inline_test + ]; + in + { + culr = final.callPackage ./nix/default.nix { + inherit ocaml-deps version; + }; }; - }; }; }