summary refs log tree commit diff
path: root/nixos/modules/services/misc/packagekit.nix
blob: bce21e8acff312103a473580b872f11687b2dea2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
{ config, lib, pkgs, ... }:

with lib;

let

  cfg = config.services.packagekit;

  packagekitConf = ''
[Daemon]
KeepCache=false
    '';

  vendorConf = ''
[PackagesNotFound]
DefaultUrl=https://github.com/NixOS/nixpkgs
CodecUrl=https://github.com/NixOS/nixpkgs
HardwareUrl=https://github.com/NixOS/nixpkgs
FontUrl=https://github.com/NixOS/nixpkgs
MimeUrl=https://github.com/NixOS/nixpkgs
      '';

in

{

  options = {

    services.packagekit = {
      enable = mkEnableOption
        ''
          PackageKit provides a cross-platform D-Bus abstraction layer for
          installing software. Software utilizing PackageKit can install
          software regardless of the package manager.
        '';
    };

  };

  config = mkIf cfg.enable {

    services.dbus.packages = [ pkgs.packagekit ];

    systemd.services.packagekit = {
      description = "PackageKit Daemon";
      wantedBy = [ "multi-user.target" ];
      serviceConfig.ExecStart = "${pkgs.packagekit}/libexec/packagekitd";
      serviceConfig.User = "root";
      serviceConfig.BusName = "org.freedesktop.PackageKit";
      serviceConfig.Type = "dbus";
    };

    environment.etc."PackageKit/PackageKit.conf".text = packagekitConf;
    environment.etc."PackageKit/Vendor.conf".text = vendorConf;

  };

}