mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-23 04:25:59 +01:00
nix: add a proper overlay and cleanup flake
This commit is contained in:
parent
f7bdc2e870
commit
d6b324306b
1 changed files with 21 additions and 24 deletions
37
flake.nix
37
flake.nix
|
@ -16,40 +16,37 @@
|
||||||
}: let
|
}: let
|
||||||
inherit (nixpkgs) lib;
|
inherit (nixpkgs) lib;
|
||||||
genSystems = lib.genAttrs [
|
genSystems = lib.genAttrs [
|
||||||
|
# Add more systems if they are supported
|
||||||
"x86_64-linux"
|
"x86_64-linux"
|
||||||
];
|
];
|
||||||
pkgsFor = nixpkgs.legacyPackages;
|
pkgsFor = nixpkgs.legacyPackages;
|
||||||
# https://github.com/NixOS/rfcs/pull/107
|
mkDate = longDate: (lib.concatStringsSep "-" [
|
||||||
mkVersion = longDate:
|
|
||||||
lib.concatStrings [
|
|
||||||
"0.pre"
|
|
||||||
"+date="
|
|
||||||
(lib.concatStringsSep "-" [
|
|
||||||
(__substring 0 4 longDate)
|
(__substring 0 4 longDate)
|
||||||
(__substring 4 2 longDate)
|
(__substring 4 2 longDate)
|
||||||
(__substring 6 2 longDate)
|
(__substring 6 2 longDate)
|
||||||
])
|
]);
|
||||||
];
|
pseudo-overlay = prev: rec {
|
||||||
in {
|
wlroots-hyprland = prev.wlroots.overrideAttrs (_: {
|
||||||
packages = genSystems (system: {
|
version = mkDate (inputs.wlroots.lastModifiedDate or "19700101");
|
||||||
wlroots = pkgsFor.${system}.wlroots.overrideAttrs (prev: {
|
|
||||||
version = mkVersion (toString (inputs.wlroots.lastModifiedDate or inputs.wlroots.lastModified or "19700101"));
|
|
||||||
src = inputs.wlroots;
|
src = inputs.wlroots;
|
||||||
});
|
});
|
||||||
default = pkgsFor.${system}.callPackage ./nix/default.nix {
|
hyprland = prev.callPackage ./nix/default.nix {
|
||||||
version = mkVersion (toString (self.lastModifiedDate or self.lastModified or "19700101"));
|
version = "0.pre" + "+date=" + (mkDate (self.lastModifiedDate or "19700101"));
|
||||||
inherit (self.packages.${system}) wlroots;
|
wlroots = wlroots-hyprland;
|
||||||
};
|
};
|
||||||
|
};
|
||||||
|
in {
|
||||||
|
packages = genSystems (system:
|
||||||
|
(pseudo-overlay pkgsFor.${system})
|
||||||
|
// {
|
||||||
|
default = self.packages.${system}.hyprland;
|
||||||
});
|
});
|
||||||
|
|
||||||
formatter = genSystems (system: pkgsFor.${system}.alejandra);
|
formatter = genSystems (system: pkgsFor.${system}.alejandra);
|
||||||
|
|
||||||
nixosModules.default = import ./nix/module.nix self;
|
nixosModules.default = import ./nix/module.nix self;
|
||||||
|
|
||||||
# Deprecated
|
overlays.default = final: pseudo-overlay;
|
||||||
overlays.default = _: prev: {
|
overlay = throw "Hyprland: .overlay output is deprecated, please use the .overlays.default output";
|
||||||
hyprland = self.packages.${prev.system}.default;
|
|
||||||
};
|
|
||||||
overlay = self.overlays.default;
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue