|
| 1 | +{ |
| 2 | + lib, |
| 3 | + pkgs, |
| 4 | + inputs, |
| 5 | + config, |
| 6 | + ... |
| 7 | +}: |
| 8 | +let |
| 9 | + config' = config; |
| 10 | + mkNixPak = inputs.nixpak.lib.nixpak { |
| 11 | + inherit pkgs lib; |
| 12 | + }; |
| 13 | + prismlauncher' = mkNixPak { |
| 14 | + config = |
| 15 | + { sloth, config, ... }: |
| 16 | + { |
| 17 | + etc.sslCertificates.enable = true; |
| 18 | + dbus.policies = { |
| 19 | + "${config.flatpak.appId}" = "own"; |
| 20 | + "${config.flatpak.appId}.*" = "own"; |
| 21 | + "org.freedesktop.DBus" = "talk"; |
| 22 | + "org.gtk.vfs.*" = "talk"; |
| 23 | + "org.gtk.vfs" = "talk"; |
| 24 | + "ca.desrt.dconf" = "talk"; |
| 25 | + "org.freedesktop.portal.*" = "talk"; |
| 26 | + "org.a11y.Bus" = "talk"; |
| 27 | + }; |
| 28 | + gpu = { |
| 29 | + enable = true; |
| 30 | + provider = "nixos"; |
| 31 | + }; |
| 32 | + app.package = config'.uwumarie.prismlauncher.package; |
| 33 | + flatpak.appId = "org.prismlauncher.PrismLauncher"; |
| 34 | + bubblewrap = { |
| 35 | + bind.rw = [ |
| 36 | + sloth.xdgDownloadDir |
| 37 | + (sloth.concat' sloth.homeDir "/.ftba") |
| 38 | + (sloth.concat' sloth.homeDir "/.local/share/PrismLauncher") |
| 39 | + "/sys/kernel/mm/hugepages" |
| 40 | + "/sys/kernel/mm/transparent_hugepage" |
| 41 | + [ |
| 42 | + sloth.appCacheDir |
| 43 | + sloth.xdgCacheHome |
| 44 | + ] |
| 45 | + (sloth.concat' sloth.xdgCacheHome "/fontconfig") |
| 46 | + (sloth.concat' sloth.xdgCacheHome "/mesa_shader_cache") |
| 47 | + (sloth.concat' sloth.xdgCacheHome "/mesa_shader_cache_db") |
| 48 | + (sloth.concat' sloth.xdgCacheHome "/radv_builtin_shaders") |
| 49 | + |
| 50 | + (sloth.concat' sloth.runtimeDir "/at-spi/bus") |
| 51 | + (sloth.concat' sloth.runtimeDir "/gvfsd") |
| 52 | + (sloth.concat' sloth.runtimeDir "/dconf") |
| 53 | + (sloth.concat' sloth.runtimeDir "/doc") |
| 54 | + ]; |
| 55 | + bind.ro = [ |
| 56 | + (sloth.concat' sloth.xdgConfigHome "/gtk-2.0") |
| 57 | + (sloth.concat' sloth.xdgConfigHome "/gtk-3.0") |
| 58 | + (sloth.concat' sloth.xdgConfigHome "/gtk-4.0") |
| 59 | + (sloth.concat' sloth.xdgConfigHome "/fontconfig") |
| 60 | + (sloth.concat' sloth.xdgConfigHome "/dconf") |
| 61 | + (sloth.concat' sloth.xdgConfigHome "/kdeglobals") |
| 62 | + ]; |
| 63 | + sockets = { |
| 64 | + wayland = true; |
| 65 | + x11 = true; |
| 66 | + pulse = true; |
| 67 | + }; |
| 68 | + network = true; |
| 69 | + bind.dev = [ "/dev/input" ]; |
| 70 | + }; |
| 71 | + }; |
| 72 | + }; |
| 73 | +in |
| 74 | +{ |
| 75 | + options.uwumarie.prismlauncher = { |
| 76 | + enable = lib.mkEnableOption "prismlauncher"; |
| 77 | + package = lib.mkPackageOption pkgs "prismlauncher" { }; |
| 78 | + }; |
| 79 | + config = lib.mkIf config.uwumarie.prismlauncher.enable { |
| 80 | + environment.systemPackages = [ prismlauncher'.config.env ]; |
| 81 | + }; |
| 82 | +} |
0 commit comments