Files
hyprlua/flake.nix
T
Nina Chlóe Kassandra Reiß 82f6f840a5 Use swaybg to change the background
2026-06-19 09:06:56 +02:00

55 lines
1.2 KiB
Nix

{
description = "Hyprland test wrapper from nixpkgs only";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-26.05";
outputs =
{ self, nixpkgs, ... }:
let
system = "x86_64-linux";
pkgs = import nixpkgs {
inherit system;
config.allowUnfree = false;
};
hypr = pkgs.hyprland;
configDir = pkgs.lib.cleanSource ./.;
configFile = "${configDir}/hyprland.lua";
runtimePackages = with pkgs; [
swaybg
];
runtimePath = pkgs.lib.makeBinPath runtimePackages;
verifyScript = pkgs.writeShellScript "hyprland-verify" ''
export PATH=${runtimePath}:$PATH
exec ${hypr}/bin/Hyprland --config ${configFile} --verify-config
'';
runScript = pkgs.writeShellScript "hyprland-run" ''
export PATH=${runtimePath}:$PATH
exec ${hypr}/bin/Hyprland --config ${configFile}
'';
in
{
apps.${system} = {
default = {
type = "app";
program = "${verifyScript}";
};
run = {
type = "app";
program = "${runScript}";
};
};
packages.${system}.default = pkgs.runCommand "hyprland-config-check" { } ''
${verifyScript}
touch $out
'';
};
}