hyprland-protocols/flake.nix

39 lines
1.0 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";
outputs = {
self,
nixpkgs,
...
}: let
inherit (nixpkgs) lib;
genSystems = lib.genAttrs [
"aarch64-linux"
"x86_64-linux"
];
2023-05-02 05:03:46 +02:00
pkgsFor = genSystems (system:
import nixpkgs {
inherit system;
overlays = [self.overlays.default];
});
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 {
2023-05-02 05:03:46 +02:00
overlays.default = final: prev: {
hyprland-protocols = final.callPackage ./nix/default.nix {inherit version;};
2022-12-23 23:59:07 +01:00
};
packages = genSystems (system:
2023-05-02 05:03:46 +02:00
(self.overlays.default pkgsFor.${system} pkgsFor.${system})
2022-12-23 23:59:07 +01:00
// {default = self.packages.${system}.hyprland-protocols;});
formatter = genSystems (system: pkgsFor.${system}.alejandra);
};
}