diff options
author | Peter Hoeg <peter@hoeg.com> | 2019-04-26 14:19:46 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-26 14:19:46 +0800 |
commit | eb6ce1c8a9464b4bfe19aee50343255866d3ac9e (patch) | |
tree | eb77b316d31a444fa46b882b7236c9809c032d56 /nixos/modules/services | |
parent | 65e3d0da8523903af672c543dc1b6d2a8acca3f8 (diff) | |
parent | ab15949f81c80027decdb4554b1f4f8ba4fe8d03 (diff) | |
download | nixlib-eb6ce1c8a9464b4bfe19aee50343255866d3ac9e.tar nixlib-eb6ce1c8a9464b4bfe19aee50343255866d3ac9e.tar.gz nixlib-eb6ce1c8a9464b4bfe19aee50343255866d3ac9e.tar.bz2 nixlib-eb6ce1c8a9464b4bfe19aee50343255866d3ac9e.tar.lz nixlib-eb6ce1c8a9464b4bfe19aee50343255866d3ac9e.tar.xz nixlib-eb6ce1c8a9464b4bfe19aee50343255866d3ac9e.tar.zst nixlib-eb6ce1c8a9464b4bfe19aee50343255866d3ac9e.zip |
Merge pull request #60146 from peterhoeg/f/packagekit
nixos/packagekit: make it not error out + test
Diffstat (limited to 'nixos/modules/services')
-rw-r--r-- | nixos/modules/services/misc/packagekit.nix | 51 |
1 files changed, 29 insertions, 22 deletions
diff --git a/nixos/modules/services/misc/packagekit.nix b/nixos/modules/services/misc/packagekit.nix index bce21e8acff3..325c4e84e0d8 100644 --- a/nixos/modules/services/misc/packagekit.nix +++ b/nixos/modules/services/misc/packagekit.nix @@ -7,18 +7,19 @@ let cfg = config.services.packagekit; packagekitConf = '' -[Daemon] -KeepCache=false - ''; + [Daemon] + DefaultBackend=${cfg.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 - ''; + [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 @@ -33,26 +34,32 @@ in installing software. Software utilizing PackageKit can install software regardless of the package manager. ''; - }; + # TODO: integrate with PolicyKit if the nix backend matures to the point + # where it will require elevated permissions + backend = mkOption { + type = types.enum [ "test_nop" ]; + default = "test_nop"; + description = '' + PackageKit supports multiple different backends and <literal>auto</literal> which + should do the right thing. + </para> + <para> + On NixOS however, we do not have a backend compatible with nix 2.0 + (refer to <link xlink:href="https://github.com/NixOS/nix/issues/233">this issue</link> so we have to force + it to <literal>test_nop</literal> for now. + ''; + }; + }; }; config = mkIf cfg.enable { - services.dbus.packages = [ pkgs.packagekit ]; + services.dbus.packages = with 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"; - }; + systemd.packages = with pkgs; [ packagekit ]; environment.etc."PackageKit/PackageKit.conf".text = packagekitConf; environment.etc."PackageKit/Vendor.conf".text = vendorConf; - }; - } |