nixos/linyaps: init

rewine c9929803 cb2ef2c9

+61
+1
nixos/modules/module-list.nix
··· 569 569 ./services/desktops/gnome/sushi.nix 570 570 ./services/desktops/gnome/tinysparql.nix 571 571 ./services/desktops/gvfs.nix 572 + ./services/desktops/linyaps.nix 572 573 ./services/desktops/malcontent.nix 573 574 ./services/desktops/neard.nix 574 575 ./services/desktops/pipewire/pipewire.nix
+60
nixos/modules/services/desktops/linyaps.nix
··· 1 + { 2 + config, 3 + lib, 4 + pkgs, 5 + ... 6 + }: 7 + 8 + let 9 + cfg = config.services.linyaps; 10 + in 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 + }