diff --git a/flake.lock b/flake.lock index 9ab6df6..f88daae 100644 --- a/flake.lock +++ b/flake.lock @@ -19,17 +19,36 @@ } }, "nixpkgs": { + "inputs": { + "nixpkgs": "nixpkgs_2" + }, + "locked": { + "lastModified": 1733437725, + "narHash": "sha256-ridu0NcO4Dr2TsHqPE+kh58xTHcXg7IHq/FF74KrP/g=", + "owner": "nix-ocaml", + "repo": "nix-overlays", + "rev": "03b85ffd6c37255829d475f3584f8d8a1556d5f2", + "type": "github" + }, + "original": { + "owner": "nix-ocaml", + "repo": "nix-overlays", + "type": "github" + } + }, + "nixpkgs_2": { "locked": { "lastModified": 1733380312, "narHash": "sha256-ywntxT10Om755wkB9tYgJwEwELQZKYAO5WcNuHv1vjI=", - "owner": "nixOS", + "owner": "NixOS", "repo": "nixpkgs", "rev": "a772498086eac57d97065a980a21fc0f304e3192", "type": "github" }, "original": { - "owner": "nixOS", + "owner": "NixOS", "repo": "nixpkgs", + "rev": "a772498086eac57d97065a980a21fc0f304e3192", "type": "github" } }, diff --git a/flake.nix b/flake.nix index 1e2f7dd..0b86b5c 100644 --- a/flake.nix +++ b/flake.nix @@ -1,9 +1,14 @@ { inputs = { - nixpkgs.url = "github:nixOS/nixpkgs"; + nixpkgs.url = "github:nix-ocaml/nix-overlays"; flake-utils.url = "github:numtide/flake-utils"; }; + nixConfig = { + extra-substituters = "https://anmonteiro.nix-cache.workers.dev"; + extra-trusted-public-keys = "ocaml.nix-cache.com-1:/xI2h2+56rwFfKyyFVbkJSeGqSIYMC/Je+7XXqGKDIY="; + }; + outputs = { self, nixpkgs, @@ -13,9 +18,10 @@ in flake-utils.lib.eachDefaultSystem ( system: let - pkgs = import nixpkgs { - inherit system; - }; + pkgs = nixpkgs.legacyPackages.${system}; + # import nixpkgs { + # inherit system; + # }; inherit (pkgs) mkShell ocamlPackages; inherit (ocamlPackages) @@ -94,12 +100,12 @@ } ) // { - nixosModules.culr = import ./nix/module.nix {culrOverlay = self.overlays.culr;}; + nixosModules.culr = import ./nix/module.nix {overlays = [self.overlays.culr self.inputs.nixpkgs.overlays.default];}; overlays.culr = final: prev: let ocaml-deps = let inherit - (prev.ocamlPackages) + (final.ocamlPackages) dune_3 ocaml angstrom diff --git a/nix/module.nix b/nix/module.nix index b79d426..b44cb16 100644 --- a/nix/module.nix +++ b/nix/module.nix @@ -1,4 +1,4 @@ -{culrOverlay}: { +{overlays}: { imports = [./culr-module.nix]; - nixpkgs.overlays = [culrOverlay]; + nixpkgs.overlays = overlays; }