about summary refs log blame commit diff stats
path: root/pkgs/by-name/ge/generate_moz_extension/flake.nix
blob: 5575f90ba138d9ff3ea35cdb25a0d0cedbb17c02 (plain) (tree)









































































                                                                               
{
  description = "A simple way to query the mozialla api for extension data";

  inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";

    crane = {
      url = "github:ipetkov/crane";
      inputs = {
        nixpkgs.follows = "nixpkgs";
      };
    };

    flake-utils.url = "github:numtide/flake-utils";

    rust-overlay = {
      url = "github:oxalica/rust-overlay";
      inputs = {
        nixpkgs.follows = "nixpkgs";
        flake-utils.follows = "flake-utils";
      };
    };
  };

  outputs = {
    self,
    nixpkgs,
    crane,
    flake-utils,
    rust-overlay,
    ...
  }:
    flake-utils.lib.eachDefaultSystem (system: let
      pkgs = import nixpkgs {
        inherit system;
        overlays = [(import rust-overlay)];
      };

      rust-stable = pkgs.rust-bin.stable.latest.default;
      rust-minimal = pkgs.rust-bin.stable.latest.minimal;

      craneLib = (crane.mkLib pkgs).overrideToolchain rust-minimal;

      buildInputs = [
        pkgs.openssl # needed for openssl
      ];
      nativeBuildInputs = [
        pkgs.pkg-config # needed for openssl
      ];

      craneBuild = craneLib.buildPackage {
        src = craneLib.cleanCargoSource ./.;
        inherit buildInputs nativeBuildInputs;

        doCheck = true;
      };
    in {
      packages.default = craneBuild;
      app.default = {
        type = "app";
        program = "${self.packages.${system}.default}/bin/generate_extensions";
      };
      devShells.default = pkgs.mkShell {
        packages = with pkgs; [
          cocogitto

          rust-stable
          cargo-edit
        ];
        inherit buildInputs nativeBuildInputs;
      };
    });
}
# vim: ts=2