mirror of
https://github.com/nix-community/home-manager.git
synced 2026-01-11 09:29:41 +08:00
Compare commits
4 Commits
38e187fd2f
...
4e8b7bef66
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4e8b7bef66 | ||
|
|
6e94d8157c | ||
|
|
6e3931c01f | ||
|
|
c91dbdf61a |
@@ -224,8 +224,15 @@ in
|
||||
message = "Ghostty systemd integration cannot be enabled for non-linux platforms";
|
||||
}
|
||||
];
|
||||
|
||||
xdg.configFile."systemd/user/app-com.mitchellh.ghostty.service".source =
|
||||
"${cfg.package}/share/systemd/user/app-com.mitchellh.ghostty.service";
|
||||
|
||||
xdg.configFile."systemd/user/app-com.mitchellh.ghostty.service.d/overrides.conf".text = ''
|
||||
[Unit]
|
||||
X-SwitchMethod=keep-old
|
||||
'';
|
||||
|
||||
dbus.packages = [ cfg.package ];
|
||||
})
|
||||
|
||||
|
||||
@@ -62,8 +62,15 @@ in
|
||||
Configuration written to
|
||||
{file}`$XDG_CONFIG_HOME/keepassxc/keepassxc.ini`.
|
||||
|
||||
See <https://github.com/keepassxreboot/keepassxc/blob/647272e9c5542297d3fcf6502e6173c96f12a9a0/src/core/Config.cpp#L49-L223>
|
||||
See <https://github.com/keepassxreboot/keepassxc/blob/develop/src/core/Config.cpp>
|
||||
for the full list of options.
|
||||
|
||||
::: {.note}
|
||||
When the settings are non-empty, the configuration file will be linked
|
||||
into the Nix store and KeePassXC will report an access error for its
|
||||
configuration file. This is expected and can not be fixed in a way that
|
||||
aligns with Home Manager's principles. See [#8257](https://github.com/nix-community/home-manager/issues/8257) for more details.
|
||||
:::
|
||||
'';
|
||||
};
|
||||
|
||||
|
||||
@@ -48,6 +48,11 @@ in
|
||||
[ "wayland" "windowManager" "hyprland" "systemdIntegration" ] # \
|
||||
[ "wayland" "windowManager" "hyprland" "systemd" "enable" ]
|
||||
)
|
||||
|
||||
(lib.mkRenamedOptionModule # \
|
||||
[ "wayland" "windowManager" "hyprland" "xwayland" "enable" ] # \
|
||||
[ "wayland" "windowManager" "hyprland" "settings" "xwayland" "enable" ]
|
||||
)
|
||||
];
|
||||
|
||||
options.wayland.windowManager.hyprland = {
|
||||
@@ -79,11 +84,7 @@ in
|
||||
finalPackage = lib.mkOption {
|
||||
type = with lib.types; nullOr package;
|
||||
readOnly = true;
|
||||
default =
|
||||
if cfg.package != null then
|
||||
cfg.package.override { enableXWayland = cfg.xwayland.enable; }
|
||||
else
|
||||
null;
|
||||
default = if cfg.package != null then cfg.package else null;
|
||||
defaultText = lib.literalMD "`wayland.windowManager.hyprland.package` with applied configuration";
|
||||
description = ''
|
||||
The Hyprland package after applying configuration.
|
||||
@@ -162,10 +163,6 @@ in
|
||||
{manpage}`systemd-xdg-autostart-generator(8)`'';
|
||||
};
|
||||
|
||||
xwayland.enable = lib.mkEnableOption "XWayland" // {
|
||||
default = true;
|
||||
};
|
||||
|
||||
settings = lib.mkOption {
|
||||
type =
|
||||
with lib.types;
|
||||
@@ -357,7 +354,10 @@ in
|
||||
submapWarnings ++ lib.optional inconsistent warning;
|
||||
|
||||
home.packages = lib.mkIf (cfg.package != null) (
|
||||
[ cfg.finalPackage ] ++ lib.optional cfg.xwayland.enable pkgs.xwayland
|
||||
[ cfg.finalPackage ]
|
||||
++ lib.optional (
|
||||
(lib.hasAttrByPath [ "settings" "xwayland" "enable" ] cfg) && cfg.settings.xwayland.enable
|
||||
) pkgs.xwayland
|
||||
);
|
||||
|
||||
xdg.configFile."hypr/hyprland.conf" =
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
{ lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
ghostty-example-settings = ./example-settings.nix;
|
||||
ghostty-empty-settings = ./empty-settings.nix;
|
||||
ghostty-example-settings = ./example-settings.nix;
|
||||
ghostty-example-theme = ./example-theme.nix;
|
||||
}
|
||||
// lib.optionalAttrs pkgs.stdenv.hostPlatform.isLinux {
|
||||
ghostty-systemd-service = ./systemd-service.nix;
|
||||
}
|
||||
|
||||
@@ -11,6 +11,9 @@
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
servicePath=home-files/.config/systemd/user/app-com.mitchellh.ghostty.service
|
||||
assertPathNotExists $servicePath
|
||||
|
||||
assertFileContent \
|
||||
home-files/.config/ghostty/config \
|
||||
${./example-config-expected}
|
||||
|
||||
28
tests/modules/programs/ghostty/systemd-service.nix
Normal file
28
tests/modules/programs/ghostty/systemd-service.nix
Normal file
@@ -0,0 +1,28 @@
|
||||
{ config, ... }:
|
||||
{
|
||||
programs.ghostty = {
|
||||
enable = true;
|
||||
package = config.lib.test.mkStubPackage { outPath = null; };
|
||||
systemd.enable = true;
|
||||
settings = {
|
||||
theme = "catppuccin-mocha";
|
||||
font-size = 10;
|
||||
};
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
servicePath=home-files/.config/systemd/user/app-com.mitchellh.ghostty.service
|
||||
serviceOverridesPath=$servicePath.d/overrides.conf
|
||||
|
||||
assertFileExists $serviceOverridesPath
|
||||
assertFileContent $serviceOverridesPath \
|
||||
${builtins.toFile "ghostty-service-overrides" ''
|
||||
[Unit]
|
||||
X-SwitchMethod=keep-old
|
||||
''}
|
||||
|
||||
assertFileContent \
|
||||
home-files/.config/ghostty/config \
|
||||
${./example-config-expected}
|
||||
'';
|
||||
}
|
||||
Reference in New Issue
Block a user