1{
2 config,
3 lib,
4 pkgs,
5 ...
6}:
7
8let
9 cfg = config.services.linyaps;
10in
11
12{
13 meta = {
14 maintainers = pkgs.linyaps.meta.maintainers;
15 };
16
17 ###### interface
18 options = {
19 services.linyaps = {
20 enable = lib.mkEnableOption "linyaps, a cross-distribution package manager with sandboxed apps and shared runtime";
21
22 package = lib.mkPackageOption pkgs "linyaps" { };
23
24 boxPackage = lib.mkPackageOption pkgs "linyaps-box" { };
25 };
26 };
27
28 ###### implementation
29 config = lib.mkIf cfg.enable {
30
31 environment = {
32 profiles = [ "/var/lib/linglong/entries" ];
33 systemPackages = [
34 cfg.package
35 cfg.boxPackage
36 ];
37 };
38
39 security.polkit.enable = true;
40
41 fonts.fontDir.enable = true;
42
43 services.dbus.packages = [ cfg.package ];
44
45 systemd = {
46 packages = [ cfg.package ];
47 tmpfiles.packages = [ cfg.package ];
48 };
49
50 # Create system user and group for linyaps/linglong
51 users = {
52 groups.deepin-linglong = { };
53 users.deepin-linglong = {
54 group = "deepin-linglong";
55 isSystemUser = true;
56 description = "Linyaps/Linglong system helper";
57 };
58 };
59 };
60}