hyprpicker/flake.nix
2022-09-02 19:34:26 +03:00

39 lines
1.1 KiB
Nix

{
description = "Hyprpicker - a wlroots-compatible Wayland color picker that does not suck";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
outputs = {
self,
nixpkgs,
...
}: let
inherit (nixpkgs) lib;
genSystems = lib.genAttrs [
# Add more systems if they are supported
"aarch64-linux"
"x86_64-linux"
];
pkgsFor = nixpkgs.legacyPackages;
mkDate = longDate: (lib.concatStringsSep "-" [
(__substring 0 4 longDate)
(__substring 4 2 longDate)
(__substring 6 2 longDate)
]);
in {
overlays.default = _: prev: rec {
hyprpicker = prev.callPackage ./nix/default.nix {
stdenv = prev.gcc12Stdenv;
version = "0.pre" + "+date=" + (mkDate (self.lastModifiedDate or "19700101")) + "_" + (self.shortRev or "dirty");
inherit (prev.xorg) libXdmcp;
};
hyprpicker-debug = hyprpicker.override {debug = true;};
};
packages = genSystems (system:
(self.overlays.default null pkgsFor.${system})
// {default = self.packages.${system}.hyprpicker;});
formatter = genSystems (system: pkgsFor.${system}.alejandra);
};
}