2023-12-28 22:11:34 +01:00
|
|
|
{
|
|
|
|
description = "The official implementation library for the hypr config language";
|
|
|
|
|
2024-02-23 10:48:52 +01:00
|
|
|
inputs = {
|
|
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
|
|
|
systems.url = "github:nix-systems/default-linux";
|
2024-06-08 23:24:12 +02:00
|
|
|
|
|
|
|
hyprutils = {
|
|
|
|
url = "github:hyprwm/hyprutils";
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
inputs.systems.follows = "systems";
|
|
|
|
};
|
2024-02-23 10:48:52 +01:00
|
|
|
};
|
2023-12-28 22:11:34 +01:00
|
|
|
|
|
|
|
outputs = {
|
|
|
|
self,
|
|
|
|
nixpkgs,
|
2024-02-23 10:48:52 +01:00
|
|
|
systems,
|
2024-06-08 23:24:12 +02:00
|
|
|
...
|
|
|
|
} @ inputs: let
|
2023-12-28 22:11:34 +01:00
|
|
|
inherit (nixpkgs) lib;
|
2024-02-23 10:48:52 +01:00
|
|
|
eachSystem = lib.genAttrs (import systems);
|
|
|
|
pkgsFor = eachSystem (system:
|
|
|
|
import nixpkgs {
|
|
|
|
localSystem.system = system;
|
|
|
|
overlays = with self.overlays; [hyprlang];
|
|
|
|
});
|
2023-12-28 22:11:34 +01:00
|
|
|
mkDate = longDate: (lib.concatStringsSep "-" [
|
|
|
|
(builtins.substring 0 4 longDate)
|
|
|
|
(builtins.substring 4 2 longDate)
|
|
|
|
(builtins.substring 6 2 longDate)
|
|
|
|
]);
|
|
|
|
in {
|
2024-02-23 10:48:52 +01:00
|
|
|
overlays = {
|
|
|
|
default = self.overlays.hyprlang;
|
2024-06-08 23:24:12 +02:00
|
|
|
hyprlang = lib.composeManyExtensions [
|
|
|
|
inputs.hyprutils.overlays.default
|
|
|
|
(final: prev: {
|
|
|
|
hyprlang = final.callPackage ./nix/default.nix {
|
|
|
|
stdenv = final.gcc13Stdenv;
|
|
|
|
version = "0.pre" + "+date=" + (mkDate (self.lastModifiedDate or "19700101")) + "_" + (self.shortRev or "dirty");
|
|
|
|
};
|
|
|
|
hyprlang-with-tests = final.hyprlang.override {doCheck = true;};
|
|
|
|
})
|
|
|
|
];
|
2023-12-28 22:11:34 +01:00
|
|
|
};
|
|
|
|
|
2024-02-23 10:48:52 +01:00
|
|
|
packages = eachSystem (system: {
|
|
|
|
default = self.packages.${system}.hyprlang;
|
|
|
|
inherit (pkgsFor.${system}) hyprlang hyprlang-with-tests;
|
|
|
|
});
|
2023-12-28 22:11:34 +01:00
|
|
|
|
2024-02-23 10:48:52 +01:00
|
|
|
formatter = eachSystem (system: pkgsFor.${system}.alejandra);
|
2023-12-28 22:11:34 +01:00
|
|
|
};
|
|
|
|
}
|