Skip to content
This repository has been archived by the owner on Jul 9, 2024. It is now read-only.

Commit

Permalink
flake: overlays: add hycov and default
Browse files Browse the repository at this point in the history
Also changes how package are built. Now, `nixpkgs` is imported in
`withPkgsFor` using Hyprland's `hyprland-packages` overlay and this
flake's default. The flake's `packages.<system>` outputs are inherited
from `pkgs.hyprlandPlugins`. This produces the package output `hycov`,
but I have also added `default`.

This matches <hyprwm/hyprland-plugins#180>.
  • Loading branch information
spikespaz committed Jun 20, 2024
1 parent e86a6a3 commit 6f50fdb
Showing 1 changed file with 29 additions and 9 deletions.
38 changes: 29 additions & 9 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -1,30 +1,50 @@
{
description = "Hyprland Plugins";
description = "Hyprland Plugins (Hycov)";

inputs.hyprland.url = "git+https://github.com/hyprwm/Hyprland?submodules=1";

outputs =
{ self
, hyprland
,
}:
let
inherit (hyprland.inputs) nixpkgs;
withPkgsFor = fn: nixpkgs.lib.genAttrs (builtins.attrNames hyprland.packages) (system: fn system nixpkgs.legacyPackages.${system});
inherit (nixpkgs) lib;
systems = lib.attrNames hyprland.packages;
withPkgsFor = fn: lib.genAttrs systems (system:
let
pkgs = import nixpkgs {
localSystem.system = system;
overlays = [
hyprland.overlays.hyprland-packages
self.overlays.default
];
};
in
fn system pkgs);
in
{
packages = withPkgsFor (system: pkgs: {
hycov = pkgs.callPackage ./default.nix {
inherit (hyprland.packages.${system}) hyprland;
stdenv = pkgs.gcc13Stdenv;
overlays = {
default = self.overlays.hycov;
hycov = final: prev: {
hyprlandPlugins = prev.hyprlandPlugins or {} // {
hycov = final.callPackage ./default.nix {
stdenv = final.gcc13Stdenv;
};
};
};
};

packages = withPkgsFor (system: pkgs: {
default = self.packages.${system}.hycov;
inherit (pkgs.hyprlandPlugins) hycov;
});

devShells = withPkgsFor (system: pkgs: {
default = pkgs.mkShell.override { stdenv = pkgs.gcc13Stdenv; } {
name = "hyprland-plugins";
buildInputs = [ hyprland.packages.${system}.hyprland ];
inputsFrom = [ hyprland.packages.${system}.hyprland ];
# buildInputs = [ pkgs.hyprland ];
inputsFrom = [ pkgs.hycov ];
};
});
};
Expand Down

0 comments on commit 6f50fdb

Please sign in to comment.