hyprland-protocols/flake.nix

46 lines
1.3 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)
]);
2024-07-18 20:14:43 +02:00
version = lib.removeSuffix "\n" (builtins.readFile ./VERSION);
2022-12-23 23:59:07 +01:00
in {
overlays = {
hyprland-protocols = final: prev: {
hyprland-protocols = final.callPackage ./nix/default.nix {inherit version;};
2024-07-18 20:14:43 +02:00
version = version + "+date=" + (mkDate (self.lastModifiedDate or "19700101")) + "_" + (self.shortRev or "dirty");
};
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
};
}