hyprland-protocols/flake.nix

45 lines
1.2 KiB
Nix
Raw Normal View History

2022-12-23 23:59:07 +01:00
{
description = "Hyprland Protocols";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
# <https://github.com/nix-systems/nix-systems>
systems.url = "github:nix-systems/default-linux";
};
2022-12-23 23:59:07 +01:00
outputs = {
self,
nixpkgs,
systems,
2022-12-23 23:59:07 +01:00
...
}: let
inherit (nixpkgs) lib;
eachSystem = lib.genAttrs (import systems);
pkgsFor = eachSystem (system:
2023-05-02 05:03:46 +02:00
import nixpkgs {
localSystem = system;
overlays = [self.overlays.hyprland-protocols];
2023-05-02 05:03:46 +02:00
});
2022-12-23 23:59:07 +01:00
mkDate = longDate: (lib.concatStringsSep "-" [
(builtins.substring 0 4 longDate)
(builtins.substring 4 2 longDate)
(builtins.substring 6 2 longDate)
]);
version = "0.1" + "+date=" + (mkDate (self.lastModifiedDate or "19700101")) + "_" + (self.shortRev or "dirty");
in {
overlays = {
hyprland-protocols = final: prev: {
hyprland-protocols = final.callPackage ./nix/default.nix {inherit version;};
};
default = self.overlays.hyprland-protocols;
2022-12-23 23:59:07 +01:00
};
packages = eachSystem (system: {
inherit (pkgsFor.${system}) hyprland-protocols;
default = self.packages.${system}.hyprland-protocols;
});
2022-12-23 23:59:07 +01:00
formatter = eachSystem (system: nixpkgs.legacyPackages.${system}.alejandra);
2022-12-23 23:59:07 +01:00
};
}