magic-nix-cache/flake.nix

75 lines
1.8 KiB
Nix
Raw Normal View History

2023-05-08 09:48:11 +00:00
{
description = "GitHub Actions-powered Nix binary cache";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
rust-overlay = {
url = "github:oxalica/rust-overlay";
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-utils.follows = "flake-utils";
};
crane = {
url = "github:ipetkov/crane";
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-compat.follows = "flake-compat";
inputs.flake-utils.follows = "flake-utils";
};
flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
};
};
outputs = { self, nixpkgs, flake-utils, rust-overlay, crane, ... }: let
supportedSystems = flake-utils.lib.defaultSystems;
nightlyVersion = "2023-05-01";
in flake-utils.lib.eachSystem supportedSystems (system: let
pkgs = import nixpkgs {
inherit system;
overlays = [
rust-overlay.overlay
];
};
inherit (pkgs) lib;
rustNightly = pkgs.rust-bin.nightly.${nightlyVersion}.default.override {
extensions = [ "rust-src" "rust-analyzer-preview" ];
2023-05-19 08:48:52 +00:00
targets = cranePkgs.cargoTargets;
2023-05-08 09:48:11 +00:00
};
2023-05-19 08:48:52 +00:00
cranePkgs = pkgs.callPackage ./crane.nix {
inherit crane supportedSystems rustNightly;
};
2023-05-08 09:48:11 +00:00
in {
2023-05-19 08:48:52 +00:00
packages = rec {
inherit (cranePkgs) nix-actions-cache;
default = nix-actions-cache;
};
2023-05-08 09:48:11 +00:00
devShells = {
default = pkgs.mkShell ({
2023-05-22 22:00:34 +00:00
inputsFrom = [ cranePkgs.nix-actions-cache ];
2023-05-08 09:48:11 +00:00
packages = with pkgs; [
bashInteractive
rustNightly
cargo-bloat
cargo-edit
cargo-udeps
2023-05-19 08:48:52 +00:00
age
];
} // cranePkgs.cargoCrossEnvs);
2023-05-08 09:48:11 +00:00
keygen = pkgs.mkShellNoCC {
packages = with pkgs; [
age
];
};
};
});
}