mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-01-21 23:11:34 +01:00
Modularize the DE config
This commit is contained in:
parent
38a5b3cbb1
commit
4b650721b0
11 changed files with 285 additions and 252 deletions
59
modules/home/de/tray.nix
Normal file
59
modules/home/de/tray.nix
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
cfg = config.myConfig.de;
|
||||
in {
|
||||
options.myConfig.de = {
|
||||
tray = {
|
||||
syncthing.enable = lib.mkEnableOption "";
|
||||
networkmanager.enable = lib.mkEnableOption "";
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkMerge [
|
||||
(lib.mkIf cfg.tray.syncthing.enable {
|
||||
home.packages = [pkgs.syncthingtray-minimal];
|
||||
|
||||
systemd.user.services = {
|
||||
syncthingtray = {
|
||||
Unit = {
|
||||
Description = "Syncthingtray";
|
||||
Requires = ["tray.target"];
|
||||
After = ["graphical-session-pre.target" "tray.target"];
|
||||
PartOf = ["graphical-session.target"];
|
||||
};
|
||||
Service = {
|
||||
ExecStart = "${lib.getExe' pkgs.syncthingtray-minimal "syncthingtray"} --wait";
|
||||
};
|
||||
Install = {
|
||||
WantedBy = ["graphical-session.target"];
|
||||
};
|
||||
};
|
||||
};
|
||||
})
|
||||
|
||||
(lib.mkIf cfg.tray.networkmanager.enable {
|
||||
home.packages = [pkgs.networkmanagerapplet];
|
||||
|
||||
systemd.user.services = {
|
||||
nm-applet = {
|
||||
Unit = {
|
||||
Description = "Networkmanager-applet";
|
||||
Requires = ["tray.target"];
|
||||
After = ["graphical-session-pre.target" "tray.target"];
|
||||
PartOf = ["graphical-session.target"];
|
||||
};
|
||||
Service = {
|
||||
ExecStart = "${lib.getExe pkgs.networkmanagerapplet}";
|
||||
};
|
||||
Install = {
|
||||
WantedBy = ["graphical-session.target"];
|
||||
};
|
||||
};
|
||||
};
|
||||
})
|
||||
];
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue