mirror of
https://github.com/hyprwm/Hyprland.git
synced 2024-11-28 05:04:40 +03:00
3d4832990c
Only applies to some versions of flakes, tested on nix 2.8.1.
56 lines
1.5 KiB
Nix
56 lines
1.5 KiB
Nix
{
|
|
description = "Hyprland is a dynamic tiling Wayland compositor that doesn't sacrifice on its looks";
|
|
|
|
inputs = {
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
|
wlroots = {
|
|
url = "gitlab:wlroots/wlroots?host=gitlab.freedesktop.org";
|
|
flake = false;
|
|
};
|
|
};
|
|
|
|
outputs = inputs @ {
|
|
self,
|
|
nixpkgs,
|
|
...
|
|
}: let
|
|
inherit (nixpkgs) lib;
|
|
genSystems = lib.genAttrs [
|
|
"x86_64-linux"
|
|
];
|
|
pkgsFor = nixpkgs.legacyPackages;
|
|
# https://github.com/NixOS/rfcs/pull/107
|
|
mkVersion = longDate:
|
|
lib.concatStrings [
|
|
"0.pre"
|
|
"+date="
|
|
(lib.concatStringsSep "-" [
|
|
(__substring 0 4 longDate)
|
|
(__substring 4 2 longDate)
|
|
(__substring 6 2 longDate)
|
|
])
|
|
];
|
|
in {
|
|
packages = genSystems (system: {
|
|
wlroots = pkgsFor.${system}.wlroots.overrideAttrs (prev: {
|
|
version = mkVersion (toString (inputs.wlroots.lastModifiedDate or inputs.wlroots.lastModified or "19700101"));
|
|
src = inputs.wlroots;
|
|
});
|
|
default = pkgsFor.${system}.callPackage ./nix/default.nix {
|
|
version = mkVersion (toString (self.lastModifiedDate or self.lastModified or "19700101"));
|
|
inherit (self.packages.${system}) wlroots;
|
|
};
|
|
});
|
|
|
|
formatter = genSystems (system: pkgsFor.${system}.alejandra);
|
|
|
|
nixosModules.default = import ./nix/module.nix self;
|
|
|
|
# Deprecated
|
|
overlays.default = _: prev: {
|
|
hyprland = self.packages.${prev.system}.default;
|
|
};
|
|
overlay = self.overlays.default;
|
|
};
|
|
}
|