flatpak: refactor as home module to fix themes and fonts
Signed-off-by: Myned <dev@bjork.tech>
This commit is contained in:
parent
1d4a1b63bb
commit
fc82cd8d93
2 changed files with 45 additions and 26 deletions
|
@ -140,7 +140,6 @@
|
||||||
inputs.arion.nixosModules.arion
|
inputs.arion.nixosModules.arion
|
||||||
inputs.disko.nixosModules.disko
|
inputs.disko.nixosModules.disko
|
||||||
inputs.fw-fanctrl.nixosModules.default
|
inputs.fw-fanctrl.nixosModules.default
|
||||||
inputs.nix-flatpak.nixosModules.nix-flatpak
|
|
||||||
];
|
];
|
||||||
|
|
||||||
home-manager.users.${config.custom.username}.imports = [
|
home-manager.users.${config.custom.username}.imports = [
|
||||||
|
|
|
@ -11,6 +11,21 @@ in {
|
||||||
options.custom.services.flatpak.enable = mkOption {default = false;};
|
options.custom.services.flatpak.enable = mkOption {default = false;};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
|
services.flatpak.enable = true;
|
||||||
|
|
||||||
|
#!! Only takes effect if /usr/* shares do not exist
|
||||||
|
# Nixpkgs workaround requires packages in the global environment
|
||||||
|
# https://github.com/NixOS/nixpkgs/pull/262462
|
||||||
|
environment.systemPackages =
|
||||||
|
config.fonts.packages
|
||||||
|
++ [
|
||||||
|
config.home-manager.users.${config.custom.username}.gtk.cursorTheme.package
|
||||||
|
config.home-manager.users.${config.custom.username}.gtk.iconTheme.package
|
||||||
|
];
|
||||||
|
|
||||||
|
home-manager.users.${config.custom.username} = {
|
||||||
|
imports = [inputs.nix-flatpak.homeManagerModules.nix-flatpak];
|
||||||
|
|
||||||
# https://wiki.nixos.org/wiki/Flatpak
|
# https://wiki.nixos.org/wiki/Flatpak
|
||||||
# https://github.com/gmodena/nix-flatpak
|
# https://github.com/gmodena/nix-flatpak
|
||||||
services.flatpak = {
|
services.flatpak = {
|
||||||
|
@ -18,7 +33,7 @@ in {
|
||||||
uninstallUnmanaged = true; # Immutable flatpaks
|
uninstallUnmanaged = true; # Immutable flatpaks
|
||||||
update.auto.enable = true; # Auto update flatpaks weekly
|
update.auto.enable = true; # Auto update flatpaks weekly
|
||||||
|
|
||||||
#!! Installation occurs in background as a oneshot service
|
#!! Installation occurs during activation
|
||||||
#?? flatpak search NAME
|
#?? flatpak search NAME
|
||||||
packages =
|
packages =
|
||||||
optionals config.custom.default [
|
optionals config.custom.default [
|
||||||
|
@ -30,13 +45,18 @@ in {
|
||||||
++ optionals config.custom.full [
|
++ optionals config.custom.full [
|
||||||
"app.drey.Biblioteca"
|
"app.drey.Biblioteca"
|
||||||
];
|
];
|
||||||
};
|
|
||||||
|
|
||||||
# Theme packages must be installed system-wide for flatpaks
|
# https://github.com/gmodena/nix-flatpak?tab=readme-ov-file#overrides
|
||||||
environment.systemPackages = with pkgs; [
|
overrides.global = {
|
||||||
adw-gtk3
|
Context.filesystems = [
|
||||||
google-cursor
|
"xdg-config/gtk-3.0:ro"
|
||||||
papirus-icon-theme
|
"xdg-config/gtk-4.0:ro"
|
||||||
|
|
||||||
|
# HACK: Globally allow access to /nix/store for symlinked themes
|
||||||
|
"/nix/store:ro"
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue