-
Notifications
You must be signed in to change notification settings - Fork 0
/
flatpak.nix
34 lines (28 loc) · 1.01 KB
/
flatpak.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
{
config,
lib,
pkgs,
...
}:
{
services.flatpak.enable = true;
system.activationScripts.flatpak = ''
if [[ ''${NIXOS_ACTION} = 'switch' ]]
then
${pkgs.flatpak}/bin/flatpak remote-add --if-not-exists --prio 1 'flathub' 'https://flathub.org/repo/flathub.flatpakrepo'
${pkgs.flatpak}/bin/flatpak remote-add --if-not-exists --prio 2 'appcenter' 'https://flatpak.elementary.io/repo.flatpakrepo'
for APPLICATION in \
'com.github.tchx84.Flatseal' \
'io.github.flattool.Warehouse'
do
${pkgs.flatpak}/bin/flatpak install --noninteractive --or-update 'flathub' "''${APPLICATION}"
done
if [[ "$(uname --machine)" == 'x86_64' ]]
then
${pkgs.flatpak}/bin/flatpak install --noninteractive --or-update 'flathub' 'com.usebottles.bottles'
fi
${pkgs.flatpak}/bin/flatpak uninstall --noninteractive --unused
${pkgs.gnused}/bin/sed --in-place 's/^min-free-space-size.*/min-free-space-size=8192MB/' /var/lib/flatpak/repo/config
fi
'';
}