blob: 325c4e84e0d852a323d17c02e3a1429aa1cd3fac (
plain)
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
59
60
61
62
63
64
65
|
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.services.packagekit;
packagekitConf = ''
[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
'';
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.
'';
# 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 = with pkgs; [ packagekit ];
systemd.packages = with pkgs; [ packagekit ];
environment.etc."PackageKit/PackageKit.conf".text = packagekitConf;
environment.etc."PackageKit/Vendor.conf".text = vendorConf;
};
}
|