mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-02 11:53:27 +00:00
0a37316d6c
This commit replaces a lot of usages of `mkOption` with the package type, to be `mkPackageOption`, in order to reduce the amount of code.
62 lines
994 B
Nix
62 lines
994 B
Nix
# GVfs
|
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
with lib;
|
|
|
|
let
|
|
|
|
cfg = config.services.gvfs;
|
|
|
|
in
|
|
|
|
{
|
|
|
|
meta = {
|
|
maintainers = teams.gnome.members;
|
|
};
|
|
|
|
# Added 2019-08-19
|
|
imports = [
|
|
(mkRenamedOptionModule
|
|
[ "services" "gnome3" "gvfs" "enable" ]
|
|
[ "services" "gvfs" "enable" ])
|
|
];
|
|
|
|
###### interface
|
|
|
|
options = {
|
|
|
|
services.gvfs = {
|
|
|
|
enable = mkEnableOption (lib.mdDoc "GVfs, a userspace virtual filesystem");
|
|
|
|
# gvfs can be built with multiple configurations
|
|
package = mkPackageOption pkgs [ "gnome" "gvfs" ] { };
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
###### implementation
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
environment.systemPackages = [ cfg.package ];
|
|
|
|
services.dbus.packages = [ cfg.package ];
|
|
|
|
systemd.packages = [ cfg.package ];
|
|
|
|
services.udev.packages = [ pkgs.libmtp.out ];
|
|
|
|
services.udisks2.enable = true;
|
|
|
|
# Needed for unwrapped applications
|
|
environment.sessionVariables.GIO_EXTRA_MODULES = [ "${cfg.package}/lib/gio/modules" ];
|
|
|
|
};
|
|
|
|
}
|