packagekit: add latest from hughsie's github repo

- currently pulled in from Git until the next release of PackageKit
  has Nix support
- also: add in a service module to start packagekit properly
- nixos service can be enabled via services.packagekit.enable
- packagekit requires nixunstable to build properly
This commit is contained in:
Matthew Bauer
2016-07-05 20:26:59 +00:00
parent dedfc00204
commit 4e50880c82
4 changed files with 104 additions and 43 deletions
@@ -0,0 +1,61 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.services.packagekit;
backend = "nix";
packagekitConf = ''
[Daemon]
DefaultBackend=${backend}
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;
};
}