summaryrefslogtreecommitdiff
path: root/nix/hm-module.nix
diff options
context:
space:
mode:
authorDavi Ribeiro <104164579+Markus328@users.noreply.github.com>2025-09-03 09:03:01 -0300
committerGitHub <noreply@github.com>2025-09-03 22:03:01 +1000
commitfb9c6d4950ade1007a9a03bf09b31b7dc222a224 (patch)
tree082288028cd3af801a34492e7ab0b67c79b3cf4d /nix/hm-module.nix
parentdashboard: add month/year and paging to calendar (#499) (diff)
downloadcaelestia-shell-fb9c6d4950ade1007a9a03bf09b31b7dc222a224.tar.gz
caelestia-shell-fb9c6d4950ade1007a9a03bf09b31b7dc222a224.tar.bz2
caelestia-shell-fb9c6d4950ade1007a9a03bf09b31b7dc222a224.zip
nix/hm: move environment to systemd.environment + refactor (#551)
* nix/hm: environment moved to systemd.environment * nix/hm: change systemd default target Follow the home-manager convention for wayland systemd services * nix/hm: refactor * readme: refactor configuring section * readme: fix format * format --------- Co-authored-by: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>
Diffstat (limited to 'nix/hm-module.nix')
-rw-r--r--nix/hm-module.nix34
1 files changed, 19 insertions, 15 deletions
diff --git a/nix/hm-module.nix b/nix/hm-module.nix
index 7eb6efa..92f2f51 100644
--- a/nix/hm-module.nix
+++ b/nix/hm-module.nix
@@ -11,6 +11,9 @@ self: {
cfg = config.programs.caelestia;
in {
+ imports = [
+ (lib.mkRenamedOptionModule ["programs" "caelestia" "environment"] ["programs" "caelestia" "systemd" "environment"])
+ ];
options = with lib; {
programs.caelestia = {
enable = mkEnableOption "Enable Caelestia shell";
@@ -30,7 +33,15 @@ in {
description = ''
The systemd target that will automatically start the Caelestia shell.
'';
- default = "graphical-session.target";
+ default = config.wayland.systemd.target;
+ };
+ environment = mkOption {
+ type = types.listOf types.str;
+ description = "Extra Environment variables to pass to the Caelestia shell systemd service.";
+ default = [];
+ example = [
+ "QT_QPA_PLATFORMTHEME=gtk3"
+ ];
};
};
settings = mkOption {
@@ -43,14 +54,6 @@ in {
default = "";
description = "Caelestia shell extra configs written to shell.json";
};
- environment = mkOption {
- type = types.listOf types.str;
- description = "Extra Environment variables to pass to the Caelestia shell systemd service.";
- default = [ ];
- example = [
- "QT_QPA_PLATFORMTHEME=gtk3"
- ];
- };
cli = {
enable = mkEnableOption "Enable Caelestia CLI";
package = mkOption {
@@ -73,8 +76,8 @@ in {
};
config = let
- cli = cfg.cli.package or cli-default;
- shell = cfg.package or shell-default;
+ cli = cfg.cli.package;
+ shell = cfg.package;
in
lib.mkIf cfg.enable {
systemd.user.services.caelestia = lib.mkIf cfg.systemd.enable {
@@ -93,10 +96,11 @@ in {
Restart = "on-failure";
RestartSec = "5s";
TimeoutStopSec = "5s";
- Environment = [
- "QT_QPA_PLATFORM=wayland"
- ]
- ++ cfg.environment;
+ Environment =
+ [
+ "QT_QPA_PLATFORM=wayland"
+ ]
+ ++ cfg.systemd.environment;
Slice = "session.slice";
};