mirror of
https://github.com/aviallon/nixos-lib.git
synced 2026-04-05 17:27:50 +00:00
56 lines
1.1 KiB
Nix
56 lines
1.1 KiB
Nix
{
|
|
config,
|
|
pkgs,
|
|
lib,
|
|
...
|
|
}:
|
|
with lib;
|
|
let
|
|
cfg = config.aviallon.desktop;
|
|
in
|
|
{
|
|
config = mkIf cfg.enable {
|
|
services.flatpak.enable = mkDefault true;
|
|
systemd.services.flatpak-add-flathub = {
|
|
script = ''
|
|
exec ${pkgs.flatpak}/bin/flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
|
|
'';
|
|
serviceConfig.Type = "oneshot";
|
|
requires = [
|
|
"network-online.target"
|
|
];
|
|
after = [
|
|
"network-online.target"
|
|
];
|
|
wantedBy = [
|
|
"graphical.target"
|
|
];
|
|
};
|
|
|
|
systemd.services.flatpak-workaround-cursors = {
|
|
script = ''
|
|
exec ${pkgs.flatpak}/bin/flatpak override --filesystem=/usr/share/icons/:ro
|
|
'';
|
|
serviceConfig.Type = "oneshot";
|
|
wantedBy = [
|
|
"graphical.target"
|
|
];
|
|
};
|
|
|
|
fileSystems =
|
|
let
|
|
mkRoSymBind = path: {
|
|
device = path;
|
|
fsType = "none";
|
|
options = [
|
|
"rbind"
|
|
"ro"
|
|
"x-gvfs-hide"
|
|
];
|
|
};
|
|
in
|
|
{
|
|
"/usr/share/icons" = mkRoSymBind "/run/current-system/sw/share/icons";
|
|
};
|
|
};
|
|
}
|