mirror of
https://github.com/nix-community/home-manager.git
synced 2026-01-11 17:39:37 +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";
|
message = "Ghostty systemd integration cannot be enabled for non-linux platforms";
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
xdg.configFile."systemd/user/app-com.mitchellh.ghostty.service".source =
|
xdg.configFile."systemd/user/app-com.mitchellh.ghostty.service".source =
|
||||||
"${cfg.package}/share/systemd/user/app-com.mitchellh.ghostty.service";
|
"${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 ];
|
dbus.packages = [ cfg.package ];
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -62,8 +62,15 @@ in
|
|||||||
Configuration written to
|
Configuration written to
|
||||||
{file}`$XDG_CONFIG_HOME/keepassxc/keepassxc.ini`.
|
{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.
|
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" "systemdIntegration" ] # \
|
||||||
[ "wayland" "windowManager" "hyprland" "systemd" "enable" ]
|
[ "wayland" "windowManager" "hyprland" "systemd" "enable" ]
|
||||||
)
|
)
|
||||||
|
|
||||||
|
(lib.mkRenamedOptionModule # \
|
||||||
|
[ "wayland" "windowManager" "hyprland" "xwayland" "enable" ] # \
|
||||||
|
[ "wayland" "windowManager" "hyprland" "settings" "xwayland" "enable" ]
|
||||||
|
)
|
||||||
];
|
];
|
||||||
|
|
||||||
options.wayland.windowManager.hyprland = {
|
options.wayland.windowManager.hyprland = {
|
||||||
@@ -79,11 +84,7 @@ in
|
|||||||
finalPackage = lib.mkOption {
|
finalPackage = lib.mkOption {
|
||||||
type = with lib.types; nullOr package;
|
type = with lib.types; nullOr package;
|
||||||
readOnly = true;
|
readOnly = true;
|
||||||
default =
|
default = if cfg.package != null then cfg.package else null;
|
||||||
if cfg.package != null then
|
|
||||||
cfg.package.override { enableXWayland = cfg.xwayland.enable; }
|
|
||||||
else
|
|
||||||
null;
|
|
||||||
defaultText = lib.literalMD "`wayland.windowManager.hyprland.package` with applied configuration";
|
defaultText = lib.literalMD "`wayland.windowManager.hyprland.package` with applied configuration";
|
||||||
description = ''
|
description = ''
|
||||||
The Hyprland package after applying configuration.
|
The Hyprland package after applying configuration.
|
||||||
@@ -162,10 +163,6 @@ in
|
|||||||
{manpage}`systemd-xdg-autostart-generator(8)`'';
|
{manpage}`systemd-xdg-autostart-generator(8)`'';
|
||||||
};
|
};
|
||||||
|
|
||||||
xwayland.enable = lib.mkEnableOption "XWayland" // {
|
|
||||||
default = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
settings = lib.mkOption {
|
settings = lib.mkOption {
|
||||||
type =
|
type =
|
||||||
with lib.types;
|
with lib.types;
|
||||||
@@ -357,7 +354,10 @@ in
|
|||||||
submapWarnings ++ lib.optional inconsistent warning;
|
submapWarnings ++ lib.optional inconsistent warning;
|
||||||
|
|
||||||
home.packages = lib.mkIf (cfg.package != null) (
|
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" =
|
xdg.configFile."hypr/hyprland.conf" =
|
||||||
|
|||||||
@@ -1,5 +1,10 @@
|
|||||||
|
{ lib, pkgs, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
ghostty-example-settings = ./example-settings.nix;
|
|
||||||
ghostty-empty-settings = ./empty-settings.nix;
|
ghostty-empty-settings = ./empty-settings.nix;
|
||||||
|
ghostty-example-settings = ./example-settings.nix;
|
||||||
ghostty-example-theme = ./example-theme.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 = ''
|
nmt.script = ''
|
||||||
|
servicePath=home-files/.config/systemd/user/app-com.mitchellh.ghostty.service
|
||||||
|
assertPathNotExists $servicePath
|
||||||
|
|
||||||
assertFileContent \
|
assertFileContent \
|
||||||
home-files/.config/ghostty/config \
|
home-files/.config/ghostty/config \
|
||||||
${./example-config-expected}
|
${./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