Files
noctalia-shell/nix/nixos-module.nix
T

57 lines
1.5 KiB
Nix

{
config,
lib,
...
}:
let
cfg = config.services.noctalia-shell;
in
{
options.services.noctalia-shell = {
enable = lib.mkEnableOption "Noctalia shell systemd service";
package = lib.mkOption {
type = lib.types.package;
description = "The noctalia-shell package to use";
};
mutableRuntimeSettings = lib.mkOption {
type = lib.types.bool;
default = true;
description = "Whether noctalia-shell creates a gui-settings.json to store setting changes made within the GUI at runtime.";
};
target = lib.mkOption {
type = lib.types.str;
default = "graphical-session.target";
example = "hyprland-session.target";
description = "The systemd target for the noctalia-shell service.";
};
};
config = lib.mkIf cfg.enable {
systemd.user.services.noctalia-shell = {
description = "Noctalia Shell - Wayland desktop shell";
documentation = [ "https://docs.noctalia.dev/docs" ];
after = [ cfg.target ];
partOf = [ cfg.target ];
wantedBy = [ cfg.target ];
restartTriggers = [ cfg.package ];
environment = {
PATH = lib.mkForce null;
};
serviceConfig = {
ExecStart = lib.getExe cfg.package;
Restart = "on-failure";
Environment = lib.mkIf cfg.mutableRuntimeSettings [
"NOCTALIA_SETTINGS_FALLBACK=%h/.config/noctalia/gui-settings.json"
];
};
};
environment.systemPackages = [ cfg.package ];
};
}