mirror of
https://github.com/noctalia-dev/noctalia-shell.git
synced 2026-05-11 17:08:27 +08:00
Nix: improve home-module
This commit is contained in:
committed by
Matan Bendix Shenhav
parent
7b634783ae
commit
f04698e7f1
+8
-6
@@ -25,13 +25,13 @@ in {
|
||||
|
||||
settings = lib.mkOption {
|
||||
type = with lib.types;
|
||||
nullOr (oneOf [
|
||||
oneOf [
|
||||
attrs
|
||||
str
|
||||
path
|
||||
]);
|
||||
];
|
||||
default = {};
|
||||
apply = x: lib.recursiveUpdate defaultSettings (extractAttrs x);
|
||||
apply = x: if x == {} then x else lib.recursiveUpdate defaultSettings (extractAttrs x);
|
||||
example = lib.literalExpression ''
|
||||
{
|
||||
bar = {
|
||||
@@ -111,7 +111,8 @@ in {
|
||||
Documentation = "https://docs.noctalia.dev/docs";
|
||||
PartOf = [ config.wayland.systemd.target ];
|
||||
After = [ config.wayland.systemd.target ];
|
||||
X-Restart-Triggers = [ "${config.xdg.configFile."noctalia/settings.json".source}" ]
|
||||
X-Restart-Triggers =
|
||||
lib.optional (cfg.settings != {}) "${config.xdg.configFile."noctalia/settings.json".source}"
|
||||
++ lib.optional (cfg.colors != {}) "${config.xdg.configFile."noctalia/colors.json".source}";
|
||||
};
|
||||
|
||||
@@ -126,11 +127,12 @@ in {
|
||||
Install.WantedBy = [ config.wayland.systemd.target ];
|
||||
};
|
||||
|
||||
home.packages = lib.optional useApp2Unit cfg.app2unit.package
|
||||
home.packages =
|
||||
lib.optional useApp2Unit cfg.app2unit.package
|
||||
++ lib.optional (cfg.package != null) cfg.package;
|
||||
|
||||
xdg.configFile = {
|
||||
"noctalia/settings.json" = {
|
||||
"noctalia/settings.json" = lib.mkIf (cfg.settings != {}) {
|
||||
onChange = lib.mkIf (!cfg.systemd.enable) restart;
|
||||
text = builtins.toJSON cfg.settings;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user