nixos/packagekit: make it not error out and use upstream systemd unit
This commit is contained in:
parent
d260277928
commit
1bc408ec3a
@ -8,6 +8,7 @@ let
|
|||||||
|
|
||||||
packagekitConf = ''
|
packagekitConf = ''
|
||||||
[Daemon]
|
[Daemon]
|
||||||
|
DefaultBackend=${cfg.backend}
|
||||||
KeepCache=false
|
KeepCache=false
|
||||||
'';
|
'';
|
||||||
|
|
||||||
@ -33,26 +34,32 @@ in
|
|||||||
installing software. Software utilizing PackageKit can install
|
installing software. Software utilizing PackageKit can install
|
||||||
software regardless of the package manager.
|
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 {
|
config = mkIf cfg.enable {
|
||||||
|
|
||||||
services.dbus.packages = [ pkgs.packagekit ];
|
services.dbus.packages = with pkgs; [ packagekit ];
|
||||||
|
|
||||||
systemd.services.packagekit = {
|
systemd.packages = with pkgs; [ 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/PackageKit.conf".text = packagekitConf;
|
||||||
environment.etc."PackageKit/Vendor.conf".text = vendorConf;
|
environment.etc."PackageKit/Vendor.conf".text = vendorConf;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user