nix-update/flake.nix
2023-09-08 07:21:27 +00:00

37 lines
1.1 KiB
Nix

{
description = "Swiss-knife for updating nix packages.";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
flake-parts.inputs.nixpkgs-lib.follows = "nixpkgs";
treefmt-nix.url = "github:numtide/treefmt-nix";
treefmt-nix.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = inputs @ { flake-parts, ... }:
flake-parts.lib.mkFlake { inherit inputs; } ({ lib, ... }: {
imports = [ ./treefmt.nix ];
systems = [
"aarch64-linux"
"x86_64-linux"
"riscv64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
perSystem = { config, pkgs, self', ... }: {
packages.nix-update = pkgs.callPackage ./. { };
packages.default = config.packages.nix-update;
checks =
let
packages = lib.mapAttrs' (n: lib.nameValuePair "package-${n}") self'.packages;
devShells = lib.mapAttrs' (n: lib.nameValuePair "devShell-${n}") self'.devShells;
in
packages // devShells;
};
});
}