git.iko.soy/typeable/nixpkgs
on master help sign in
nixos/nm-applet: make the module smaller

more readable imho

commitb3662053b3b05160dcb5759e583c9aedb85722ec authorJörg Thalheim <joerg@thalheim.io> dateSun 2 Dec 2018, 11:34 (8 years ago) parent95cbb71
1 file changed+2−31
nixos/modules/programs/nm-applet.nix+2−31
nixos/modules/programs/nm-applet.nix+2−31
@@ -1,43 +1,14 @@
11{ config, lib, pkgs, ... }:
22
3−with lib;
4−
5−let
6− cfg = config.programs.nm-applet;
7−in
8−
93{
4+ options.programs.nm-applet.enable = lib.mkEnableOption "nm-applet";
105
11− ###### interface
12−
13− options = {
14−
15− programs.nm-applet = {
16−
17− enable = mkOption {
18− type = types.bool;
19− default = false;
20− description = ''
21− Whether to enable nm-applet.
22− '';
23− };
24−
25− };
26−
27− };
28−
29−
30− ###### implementation
31−
32− config = mkIf cfg.enable {
33−
6+ config = lib.mkIf config.programs.nm-applet.enable {
347 systemd.user.services.nm-applet = {
358 description = "Network manager applet";
369 wantedBy = [ "graphical-session.target" ];
3710 partOf = [ "graphical-session.target" ];
3811 serviceConfig.ExecStart = "${pkgs.networkmanagerapplet}/bin/nm-applet";
3912 };
40−
4113 };
42−
4314}