mirror of
https://git.allpurposem.at/mat/WiggleWobble.git
synced 2025-12-23 13:01:28 +01:00
nix: init
This commit is contained in:
parent
e8903702b3
commit
d12d0ea8f8
37
flake.nix
Normal file
37
flake.nix
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
{
|
||||||
|
inputs.hyprland.url = "github:hyprwm/Hyprland";
|
||||||
|
|
||||||
|
outputs = {
|
||||||
|
self,
|
||||||
|
hyprland,
|
||||||
|
}: let
|
||||||
|
inherit (hyprland.inputs) nixpkgs;
|
||||||
|
genPerSystem = fn: nixpkgs.lib.genAttrs (builtins.attrNames hyprland.packages) (system: fn system nixpkgs.legacyPackages.${system});
|
||||||
|
in {
|
||||||
|
packages = genPerSystem (system: pkgs: {
|
||||||
|
default = pkgs.callPackage ./plugin.nix {
|
||||||
|
inherit (hyprland.packages.${system}) hyprland;
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
devShells = genPerSystem (system: pkgs: {
|
||||||
|
default = pkgs.mkShell {
|
||||||
|
name = "hyprland-plugin-shell";
|
||||||
|
shellHook = ''
|
||||||
|
meson setup build --reconfigure
|
||||||
|
# clangd has different flags than gcc because... why not?
|
||||||
|
sed -e 's/c++23/c++2b/g' ./build/compile_commands.json > ./compile_commands.json
|
||||||
|
'';
|
||||||
|
|
||||||
|
# Note: gcc needs to be specified or else an older version might be used
|
||||||
|
# TODO: maybe using gcc13Stdenv.mkShell would fix this?
|
||||||
|
nativeBuildInputs = with pkgs; [gcc13 meson pkg-config ninja];
|
||||||
|
buildInputs = [hyprland.packages.${system}.hyprland];
|
||||||
|
inputsFrom = [
|
||||||
|
hyprland.packages.${system}.hyprland
|
||||||
|
self.packages.${system}.default
|
||||||
|
];
|
||||||
|
};
|
||||||
|
});
|
||||||
|
};
|
||||||
|
}
|
||||||
28
plugin.nix
Normal file
28
plugin.nix
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
{
|
||||||
|
lib,
|
||||||
|
gcc13Stdenv,
|
||||||
|
meson,
|
||||||
|
ninja,
|
||||||
|
pkg-config,
|
||||||
|
hyprland,
|
||||||
|
}: let
|
||||||
|
version = builtins.readFile ./VERSION;
|
||||||
|
in
|
||||||
|
gcc13Stdenv.mkDerivation {
|
||||||
|
pname = "example";
|
||||||
|
inherit version;
|
||||||
|
src = ./.;
|
||||||
|
|
||||||
|
nativeBuildInputs =
|
||||||
|
hyprland.nativeBuildInputs
|
||||||
|
++ [ninja meson pkg-config];
|
||||||
|
|
||||||
|
buildInputs = [hyprland] ++ hyprland.buildInputs;
|
||||||
|
|
||||||
|
meta = with lib; {
|
||||||
|
homepage = "https://example.com";
|
||||||
|
description = "Example hyprland plugin";
|
||||||
|
license = licenses.bsd3;
|
||||||
|
platforms = platforms.linux;
|
||||||
|
};
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user