Simplify asset handling
This commit is contained in:
+6
-20
@@ -11,35 +11,21 @@ in
|
|||||||
|
|
||||||
package = lib.mkOption {
|
package = lib.mkOption {
|
||||||
type = lib.types.package;
|
type = lib.types.package;
|
||||||
|
# Points to the default package in your flake
|
||||||
default = self.packages.${pkgs.system}.default;
|
default = self.packages.${pkgs.system}.default;
|
||||||
|
description = "The RhemaWave package to use.";
|
||||||
};
|
};
|
||||||
|
|
||||||
user = lib.mkOption {
|
user = lib.mkOption {
|
||||||
type = lib.types.str;
|
type = lib.types.str;
|
||||||
default = "kiosk";
|
default = "kiosk";
|
||||||
|
description = "The user account name.";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
# App-specific environment
|
# Just put the package in the system path.
|
||||||
environment.sessionVariables = {
|
# The machine (configuration.nix) handles the service and the files.
|
||||||
SDL_VIDEODRIVER = "wayland";
|
|
||||||
QT_QPA_PLATFORM = "wayland";
|
|
||||||
GDK_BACKEND = "wayland";
|
|
||||||
CLUTTER_BACKEND = "wayland";
|
|
||||||
};
|
|
||||||
|
|
||||||
# App-specific assets (The Symlink Farm)
|
|
||||||
systemd.tmpfiles.rules = [
|
|
||||||
"d /home/${cfg.user}/.local/share/rhemawave 0700 ${cfg.user} kiosk -"
|
|
||||||
"L+ /home/${cfg.user}/.local/share/rhemawave/shaders - - - ${cfg.package}/share/rhemawave/shaders"
|
|
||||||
"L+ /home/${cfg.user}/.local/share/rhemawave/fonts - - - ${cfg.package}/share/rhemawave/fonts"
|
|
||||||
"L+ /home/${cfg.user}/.local/share/rhemawave/tos - - - ${cfg.package}/share/rhemawave/tos"
|
|
||||||
"L+ /home/${cfg.user}/.local/share/rhemawave/audio - - - ${cfg.package}/share/rhemawave/audio"
|
|
||||||
"L+ /home/${cfg.user}/.local/share/rhemawave/proclamations - - - ${cfg.package}/share/rhemawave/proclamations"
|
|
||||||
];
|
|
||||||
|
|
||||||
# Make the package available
|
|
||||||
environment.systemPackages = [ cfg.package ];
|
environment.systemPackages = [ cfg.package ];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user