at 17.09-beta 1.3 kB view raw
1{ config, lib, pkgs, ... }: 2 3with lib; 4 5let 6 7 cfg = config.services.packagekit; 8 9 backend = "nix"; 10 11 packagekitConf = '' 12[Daemon] 13DefaultBackend=${backend} 14KeepCache=false 15 ''; 16 17 vendorConf = '' 18[PackagesNotFound] 19DefaultUrl=https://github.com/NixOS/nixpkgs 20CodecUrl=https://github.com/NixOS/nixpkgs 21HardwareUrl=https://github.com/NixOS/nixpkgs 22FontUrl=https://github.com/NixOS/nixpkgs 23MimeUrl=https://github.com/NixOS/nixpkgs 24 ''; 25 26in 27 28{ 29 30 options = { 31 32 services.packagekit = { 33 enable = mkEnableOption 34 '' 35 PackageKit provides a cross-platform D-Bus abstraction layer for 36 installing software. Software utilizing PackageKit can install 37 software regardless of the package manager. 38 ''; 39 }; 40 41 }; 42 43 config = mkIf cfg.enable { 44 45 services.dbus.packages = [ pkgs.packagekit ]; 46 47 systemd.services.packagekit = { 48 description = "PackageKit Daemon"; 49 wantedBy = [ "multi-user.target" ]; 50 serviceConfig.ExecStart = "${pkgs.packagekit}/libexec/packagekitd"; 51 serviceConfig.User = "root"; 52 serviceConfig.BusName = "org.freedesktop.PackageKit"; 53 serviceConfig.Type = "dbus"; 54 }; 55 56 environment.etc."PackageKit/PackageKit.conf".text = packagekitConf; 57 environment.etc."PackageKit/Vendor.conf".text = vendorConf; 58 59 }; 60 61}