packages/nixpak: extract gui-base module

This commit is contained in:
Max Headroom 2022-07-07 20:16:12 +02:00
parent 8c23b07570
commit 2a5f019c85
3 changed files with 43 additions and 27 deletions

View file

@ -1,42 +1,18 @@
{ mkNixPak, callPackage, lib, gnome, shared-mime-info }: { mkNixPak, callPackage }:
mkNixPak { mkNixPak {
config = { config = {
imports = [ ../modules/gui-base.nix ];
dbus.policies = { dbus.policies = {
"org.freedesktop.DBus" = "talk";
"org.gtk.vfs.*" = "talk";
"org.gtk.vfs" = "talk";
"io.bassi.Amberol" = "own";
"org.mpris.MediaPlayer2.*" = "own"; "org.mpris.MediaPlayer2.*" = "own";
"org.freedesktop.portal.*" = "talk";
"ca.desrt.dconf" = "talk";
}; };
flatpak.appId = "io.bassi.Amberol"; flatpak.appId = "io.bassi.Amberol";
bubblewrap = { bubblewrap = {
network = false;
bind.rw = [ bind.rw = [
"$HOME/.cache/amberol" "$HOME/.cache/amberol"
"$HOME/.cache/fontconfig"
"$XDG_RUNTIME_DIR/gvfsd" "$XDG_RUNTIME_DIR/gvfsd"
"$XDG_RUNTIME_DIR/pulse" "$XDG_RUNTIME_DIR/pulse"
"$XDG_RUNTIME_DIR/$WAYLAND_DISPLAY"
]; ];
bind.ro = [
"/etc/fonts"
"$XDG_RUNTIME_DIR/doc"
"/run/opengl-driver"
"/sys/dev/char"
"/sys/devices/pci0000:00"
];
bind.dev = [
"/dev/dri"
];
env = {
XDG_DATA_DIRS = lib.makeSearchPath "share" [
gnome.adwaita-icon-theme
shared-mime-info
];
};
}; };
app.package = callPackage ./amberol.nix {}; app.package = callPackage ./amberol.nix {};
}; };

View file

@ -0,0 +1,37 @@
{ config, lib, pkgs, ... }:
{
config = {
dbus.policies = {
"${config.flatpak.appId}" = "own";
"org.freedesktop.DBus" = "talk";
"org.gtk.vfs.*" = "talk";
"org.gtk.vfs" = "talk";
"ca.desrt.dconf" = "talk";
"org.freedesktop.portal.*" = "talk";
"org.a11y.Bus" = "talk";
};
gpu.enable = true;
bubblewrap = {
network = false;
bind.rw = [
"$HOME/.cache/fontconfig"
"$XDG_RUNTIME_DIR/$WAYLAND_DISPLAY"
"$XDG_RUNTIME_DIR/at-spi/bus"
];
bind.ro = [
"/etc/fonts"
"$XDG_RUNTIME_DIR/doc"
"$HOME/.config/gtk-2.0"
"$HOME/.config/gtk-3.0"
"$HOME/.config/gtk-4.0"
];
env = {
XDG_DATA_DIRS = lib.makeSearchPath "share" [
pkgs.gnome.adwaita-icon-theme
pkgs.shared-mime-info
];
};
};
};
}

View file

@ -11,9 +11,12 @@ let
inherit (pkgs) lib; inherit (pkgs) lib;
inherit pkgs; inherit pkgs;
}; };
sandbox = path: (pkgs.callPackage path {inherit mkNixPak;}).config.env;
in in
{ {
amberol = (pkgs.callPackage ./nixpak/amberol { inherit mkNixPak; }).config.env; amberol = sandbox ./nixpak/amberol;
brig = pkgs.callPackage ./tools/brig { }; brig = pkgs.callPackage ./tools/brig { };
privatevoid-smart-card-ca-bundle = pkgs.callPackage ./data/privatevoid-smart-card-certificate-authority-bundle.nix { }; privatevoid-smart-card-ca-bundle = pkgs.callPackage ./data/privatevoid-smart-card-certificate-authority-bundle.nix { };