Files
dotfiles-modules/modules/desktop/hyprland.nix
T

67 lines
2.0 KiB
Nix

{ ... }:
let
defaultBrowser = "zen-beta";
in
{
flake.modules.nixos.hyprland = { ... }: {
programs.hyprland = {
enable = true;
withUWSM = true;
xwayland.enable = true;
};
};
flake.modules.homeManager.hyprland =
{
pkgs,
config,
lib,
...
}:
{
options = {
dotfiles-modules.hyprland.extraConfig = lib.mkOption {
type = lib.types.lines;
default = "";
description = "Extra config to add to the hyprland config file.";
};
};
config = {
home.packages = [
pkgs.hyprpicker
pkgs.hypridle
pkgs.hyprshot
pkgs.hyprland-preview-share-picker
];
xdg.configFile = {
"hypr/hyprland.lua".text = ''
require("config")
require("extraConfig")
'';
"hypr/config.lua".source = config.lib.file.mkOutOfStoreSymlink ./hyprland/hyprland.lua;
"hypr/extraConfig.lua".text = config.dotfiles-modules.hyprland.extraConfig;
# The stups get linked to the config directory as well in order to use the autocomplete without copying it over in other places.
"hypr/hl.meta.lua".source = config.lib.file.mkOutOfStoreSymlink ./hyprland/hl.meta.lua;
"hypr/hypridle.conf".source = config.lib.file.mkOutOfStoreSymlink ./hyprland/hypridle.conf;
"backgrounds".source = config.lib.file.mkOutOfStoreSymlink ./backgrounds;
"hypr/nix.conf".text = ''
$defaultBrowser=${defaultBrowser}
'';
"hypr/xdph.conf".source = config.lib.file.mkOutOfStoreSymlink ./hyprland/xdph.conf;
"hypr/scripts/gpu-screen-recorder/save-replay.sh".source =
config.lib.file.mkOutOfStoreSymlink ./hyprland/scripts/gpu-screen-recorder/save-replay.sh;
"hypr/scripts/gpu-screen-recorder/start-replay.sh".source =
config.lib.file.mkOutOfStoreSymlink ./hyprland/scripts/gpu-screen-recorder/start-replay.sh;
};
};
};
}