nix/hm-module: make config optional

This commit is contained in:
Mihai Fufezan 2022-12-14 14:07:10 +02:00
parent 5d66122689
commit 516949380d
No known key found for this signature in database
GPG Key ID: 5899325F2F120900

View File

@ -60,7 +60,7 @@ in {
};
extraConfig = lib.mkOption {
type = lib.types.lines;
type = lib.types.nullOr lib.types.lines;
default = "";
description = ''
Extra configuration lines to add to ~/.config/hypr/hyprland.conf.
@ -95,7 +95,7 @@ in {
NIXOS_OZONE_WL = "1";
};
xdg.configFile."hypr/hyprland.conf" = {
xdg.configFile."hypr/hyprland.conf" = lib.mkIf (cfg.extraConfig != null) {
text =
(lib.optionalString cfg.systemdIntegration ''
exec-once=${pkgs.dbus}/bin/dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY HYPRLAND_INSTANCE_SIGNATURE XDG_CURRENT_DESKTOP && systemctl --user start hyprland-session.target