diff --git a/flake.lock b/flake.lock index 03adea387..7cc80164d 100644 --- a/flake.lock +++ b/flake.lock @@ -1,60 +1,77 @@ { "nodes": { "nixpkgs": { "locked": { "lastModified": 1672308958, "narHash": "sha256-zLvAJ+XTI7gIlUqlrKj8j4+POZXDB6kUOnV0yBvSIMc=", "owner": "nixos", "repo": "nixpkgs", "rev": "d879125d61a0be8ecb2afddaca8f2b0530db0260", "type": "github" }, "original": { "owner": "nixos", "ref": "nixpkgs-unstable", "repo": "nixpkgs", "type": "github" } }, + "nixpkgs-grpc-web": { + "locked": { + "lastModified": 1696748673, + "narHash": "sha256-UbPHrH4dKN/66EpfFpoG4St4XZYDX9YcMVRQGWzAUNA=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "9957cd48326fe8dbd52fdc50dd2502307f188b0d", + "type": "github" + }, + "original": { + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "9957cd48326fe8dbd52fdc50dd2502307f188b0d", + "type": "github" + } + }, "nixpkgs-unstable": { "locked": { "lastModified": 1704161960, "narHash": "sha256-QGua89Pmq+FBAro8NriTuoO/wNaUtugt29/qqA8zeeM=", "owner": "nixos", "repo": "nixpkgs", "rev": "63143ac2c9186be6d9da6035fa22620018c85932", "type": "github" }, "original": { "owner": "nixos", "ref": "nixpkgs-unstable", "repo": "nixpkgs", "type": "github" } }, "root": { "inputs": { "nixpkgs": "nixpkgs", + "nixpkgs-grpc-web": "nixpkgs-grpc-web", "nixpkgs-unstable": "nixpkgs-unstable", "utils": "utils" } }, "utils": { "locked": { "lastModified": 1638122382, "narHash": "sha256-sQzZzAbvKEqN9s0bzWuYmRaA03v40gaJ4+iL1LXjaeI=", "owner": "numtide", "repo": "flake-utils", "rev": "74f7e4319258e287b0f9cb95426c9853b282730b", "type": "github" }, "original": { "owner": "numtide", "repo": "flake-utils", "type": "github" } } }, "root": "root", "version": 7 } diff --git a/flake.nix b/flake.nix index 0aa67e96d..a52ab4a09 100644 --- a/flake.nix +++ b/flake.nix @@ -1,59 +1,64 @@ { description = "Comm flake"; inputs = { utils.url = "github:numtide/flake-utils"; nixpkgs-unstable.url = "github:nixos/nixpkgs/nixpkgs-unstable"; + nixpkgs-grpc-web.url = "github:NixOS/nixpkgs/9957cd48326fe8dbd52fdc50dd2502307f188b0d"; # Do not update, used for EOL versions of mariaDB and arcanist+php8.0 nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; }; - outputs = { self, nixpkgs, nixpkgs-unstable, utils, ... }: + outputs = { self, nixpkgs, nixpkgs-grpc-web, nixpkgs-unstable, utils, ... }: let # Overlays allow for extending a package set, in this case, we are # extending nixpkgs with our devShell localOverlay = import ./nix/overlay.nix; + grpcWebOverlay = final: prev: { + protoc-gen-grpc-web = nixpkgs-grpc-web.legacyPackages.aarch64-darwin.protoc-gen-grpc-web; + }; overlays = [ localOverlay + grpcWebOverlay (_: _: { commSrc = toString self; } ) ]; # Since we build for many systems (e.g. aarch64, x86_64-linux), we # create a helper function to help facilitate instantiation of the related # package set pkgsForSystem = system: let oldNixpkgs = import nixpkgs { inherit system; }; in import nixpkgs-unstable { inherit system; config.allowUnfree = true; overlays = overlays ++ [ # Re-introduce older packages that were removed in latest nixpkgs (_: _: { emscripten = oldNixpkgs.emscripten; # Changed signficantly php80 = oldNixpkgs.php80; # Used for arcanist mariadb = oldNixpkgs.mariadb_108; }) ]; }; # utils.lib.eachSystem helps create a result set of expected flake outputs # of the form . # https://github.com/numtide/flake-utils#usage for more examples in utils.lib.eachSystem [ "x86_64-linux" "x86_64-darwin" "aarch64-darwin" ] (system: rec { legacyPackages = pkgsForSystem system; inherit (legacyPackages) devShell devShells; }) // { # these outputs will lack the system suffix (e.g. # devShell.aarch64-darwin), thus should be system agnostic such as # overlays or utility functions. overlays.default = localOverlay; nixConfig = { substitutors = "https://comm.cachix.org"; extra-trusted-substitutors = "https://comm.cachix.org"; trusted-public-keys = "comm.cachix.org-1:70RF31rkmCEhQ9HrXA2uXcpqQKGcUK3TxLJdgcUCaA4="; extra-trusted-public-keys = "comm.cachix.org-1:70RF31rkmCEhQ9HrXA2uXcpqQKGcUK3TxLJdgcUCaA4="; }; }; }