nixos/nm-applet: make the module smaller
more readable imho
This commit is contained in:
parent
95cbb71abe
commit
b3662053b3
@ -1,43 +1,14 @@
|
|||||||
{ config, lib, pkgs, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
with lib;
|
|
||||||
|
|
||||||
let
|
|
||||||
cfg = config.programs.nm-applet;
|
|
||||||
in
|
|
||||||
|
|
||||||
{
|
{
|
||||||
|
options.programs.nm-applet.enable = lib.mkEnableOption "nm-applet";
|
||||||
|
|
||||||
###### interface
|
config = lib.mkIf config.programs.nm-applet.enable {
|
||||||
|
|
||||||
options = {
|
|
||||||
|
|
||||||
programs.nm-applet = {
|
|
||||||
|
|
||||||
enable = mkOption {
|
|
||||||
type = types.bool;
|
|
||||||
default = false;
|
|
||||||
description = ''
|
|
||||||
Whether to enable nm-applet.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
###### implementation
|
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
|
||||||
|
|
||||||
systemd.user.services.nm-applet = {
|
systemd.user.services.nm-applet = {
|
||||||
description = "Network manager applet";
|
description = "Network manager applet";
|
||||||
wantedBy = [ "graphical-session.target" ];
|
wantedBy = [ "graphical-session.target" ];
|
||||||
partOf = [ "graphical-session.target" ];
|
partOf = [ "graphical-session.target" ];
|
||||||
serviceConfig.ExecStart = "${pkgs.networkmanagerapplet}/bin/nm-applet";
|
serviceConfig.ExecStart = "${pkgs.networkmanagerapplet}/bin/nm-applet";
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user