hyprpicker/flake.nix

57 lines
1.6 KiB
Nix
Raw Normal View History

2022-09-02 18:34:15 +02:00
{
description = "Hyprpicker - a wlroots-compatible Wayland color picker that does not suck";
2024-07-18 19:58:37 +02:00
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
systems.url = "github:nix-systems/default-linux";
hyprutils = {
url = "github:hyprwm/hyprutils";
inputs.nixpkgs.follows = "nixpkgs";
inputs.systems.follows = "systems";
};
};
2022-09-02 18:34:15 +02:00
outputs = {
self,
nixpkgs,
2024-07-18 19:58:37 +02:00
systems,
2022-09-02 18:34:15 +02:00
...
2024-07-18 19:58:37 +02:00
} @ inputs: let
2022-09-02 18:34:15 +02:00
inherit (nixpkgs) lib;
2024-07-18 19:58:37 +02:00
eachSystem = lib.genAttrs (import systems);
pkgsFor = eachSystem (system:
import nixpkgs {
localSystem.system = system;
overlays = with self.overlays; [hyprpicker];
});
2022-09-02 18:34:15 +02:00
mkDate = longDate: (lib.concatStringsSep "-" [
(builtins.substring 0 4 longDate)
(builtins.substring 4 2 longDate)
(builtins.substring 6 2 longDate)
2022-09-02 18:34:15 +02:00
]);
2024-07-18 19:52:39 +02:00
version = lib.removeSuffix "\n" (builtins.readFile ./VERSION);
2022-09-02 18:34:15 +02:00
in {
2024-07-18 19:58:37 +02:00
overlays = {
default = self.overlays.hyprpicker;
hyprpicker = lib.composeManyExtensions [
inputs.hyprutils.overlays.default
(final: prev: {
hyprpicker = prev.callPackage ./nix/default.nix {
stdenv = prev.gcc13Stdenv;
version = version + "+date=" + (mkDate (self.lastModifiedDate or "19700101")) + "_" + (self.shortRev or "dirty");
};
2024-07-18 19:58:37 +02:00
hyprpicker-debug = final.hyprpicker.override {debug = true;};
})
];
2022-09-02 18:34:15 +02:00
};
2024-07-18 19:58:37 +02:00
packages = eachSystem (system: {
default = self.packages.${system}.hyprpicker;
inherit (pkgsFor.${system}) hyprpicker hyprpicker-debug;
});
2022-09-02 18:34:15 +02:00
2024-07-18 19:58:37 +02:00
formatter = eachSystem (system: pkgsFor.${system}.alejandra);
2022-09-02 18:34:15 +02:00
};
}