29027fd1e1
Using pkgs.lib on the spine of module evaluation is problematic because the pkgs argument depends on the result of module evaluation. To prevent an infinite recursion, pkgs and some of the modules are evaluated twice, which is inefficient. Using ‘with lib’ prevents this problem.
41 lines
716 B
Nix
41 lines
716 B
Nix
{ config, lib, pkgs, ... }:
|
|
|
|
with lib;
|
|
|
|
{
|
|
|
|
###### interface
|
|
|
|
options = {
|
|
|
|
networking.wicd.enable = mkOption {
|
|
default = false;
|
|
description = ''
|
|
Whether to start <command>wicd</command>. Wired and
|
|
wireless network configurations can then be managed by
|
|
wicd-client.
|
|
'';
|
|
};
|
|
};
|
|
|
|
|
|
###### implementation
|
|
|
|
config = mkIf config.networking.wicd.enable {
|
|
|
|
environment.systemPackages = [pkgs.wicd];
|
|
|
|
jobs.wicd =
|
|
{ startOn = "started network-interfaces";
|
|
stopOn = "stopping network-interfaces";
|
|
|
|
script =
|
|
"${pkgs.wicd}/sbin/wicd -f";
|
|
};
|
|
|
|
services.dbus.enable = true;
|
|
services.dbus.packages = [pkgs.wicd];
|
|
|
|
};
|
|
|
|
}
|