Compare commits

...

2 Commits

Author SHA1 Message Date
henrov d22ebf89c7 Working on reshuffling 2026-03-19 13:51:00 +00:00
henrov 661b6b43b4 deleted generated files 2026-03-19 13:50:59 +00:00
2 changed files with 24 additions and 10 deletions
+12 -5
View File
@@ -763,26 +763,31 @@ This will import all packages listed in ../../assets/system/apps/flatpaks.conf
{ lib, pkgs, config, ... }: { lib, pkgs, config, ... }:
let let
flatpakConfPath = ../../../assets/system/apps/flatpaks.conf; flatpakConfPath = ../../../assets/system/apps/flatpaks.conf;
enableProgram = config.enableFlatpaks or false; enableProgram = config.enableFlatpaks or false;
in in
{ {
# Top-level toggle
options.enableFlatpaks = lib.mkEnableOption "Enable automatic Flatpak installation"; options.enableFlatpaks = lib.mkEnableOption "Enable automatic Flatpak installation";
# Config assignments
config = lib.mkIf enableProgram { config = lib.mkIf enableProgram {
# Use programs.flatpaks instead of myApps.flatpaks
myApps.flatpaks = { programs.flatpaks = {
enable = true; enable = true;
user = config.defaultUser or "henrov"; user = config.defaultUser or "henrov";
assetsDir = flatpakConfPath; assetsDir = flatpakConfPath;
files = []; files = []; # handled at runtime
}; };
# Deploy the conf file
environment.etc."flatpak/flatpaks.conf".source = flatpakConfPath; environment.etc."flatpak/flatpaks.conf".source = flatpakConfPath;
# Enable system flatpak service
services.flatpak.enable = true; services.flatpak.enable = true;
xdg.portal.enable = true; xdg.portal.enable = true;
# Systemd service for installing listed flatpaks
systemd.services.flatpak-sync = { systemd.services.flatpak-sync = {
description = "Install Flatpak apps listed in flatpaks.conf"; description = "Install Flatpak apps listed in flatpaks.conf";
wantedBy = [ "multi-user.target" ]; wantedBy = [ "multi-user.target" ];
@@ -794,9 +799,11 @@ in
ExecStart = '' ExecStart = ''
set -euo pipefail set -euo pipefail
CONF="${flatpakConfPath}" CONF="${flatpakConfPath}"
if ! flatpak remotes --system --columns=name | grep -qx flathub; then if ! flatpak remotes --system --columns=name | grep -qx flathub; then
flatpak remote-add --system --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo flatpak remote-add --system --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo
fi fi
while IFS= read -r app || [ -n "$app" ]; do while IFS= read -r app || [ -n "$app" ]; do
app=$(echo "$app" | sed 's/#.*//;s/^[[:space:]]*//;s/[[:space:]]*$//') app=$(echo "$app" | sed 's/#.*//;s/^[[:space:]]*//;s/[[:space:]]*$//')
if [ -n "$app" ]; then if [ -n "$app" ]; then
+12 -5
View File
@@ -1,26 +1,31 @@
{ lib, pkgs, config, ... }: { lib, pkgs, config, ... }:
let let
flatpakConfPath = ../../../assets/system/apps/flatpaks.conf; flatpakConfPath = ../../../assets/system/apps/flatpaks.conf;
enableProgram = config.enableFlatpaks or false; enableProgram = config.enableFlatpaks or false;
in in
{ {
# Top-level toggle
options.enableFlatpaks = lib.mkEnableOption "Enable automatic Flatpak installation"; options.enableFlatpaks = lib.mkEnableOption "Enable automatic Flatpak installation";
# Config assignments
config = lib.mkIf enableProgram { config = lib.mkIf enableProgram {
# Use programs.flatpaks instead of myApps.flatpaks
myApps.flatpaks = { programs.flatpaks = {
enable = true; enable = true;
user = config.defaultUser or "henrov"; user = config.defaultUser or "henrov";
assetsDir = flatpakConfPath; assetsDir = flatpakConfPath;
files = []; files = []; # handled at runtime
}; };
# Deploy the conf file
environment.etc."flatpak/flatpaks.conf".source = flatpakConfPath; environment.etc."flatpak/flatpaks.conf".source = flatpakConfPath;
# Enable system flatpak service
services.flatpak.enable = true; services.flatpak.enable = true;
xdg.portal.enable = true; xdg.portal.enable = true;
# Systemd service for installing listed flatpaks
systemd.services.flatpak-sync = { systemd.services.flatpak-sync = {
description = "Install Flatpak apps listed in flatpaks.conf"; description = "Install Flatpak apps listed in flatpaks.conf";
wantedBy = [ "multi-user.target" ]; wantedBy = [ "multi-user.target" ];
@@ -32,9 +37,11 @@ in
ExecStart = '' ExecStart = ''
set -euo pipefail set -euo pipefail
CONF="${flatpakConfPath}" CONF="${flatpakConfPath}"
if ! flatpak remotes --system --columns=name | grep -qx flathub; then if ! flatpak remotes --system --columns=name | grep -qx flathub; then
flatpak remote-add --system --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo flatpak remote-add --system --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo
fi fi
while IFS= read -r app || [ -n "$app" ]; do while IFS= read -r app || [ -n "$app" ]; do
app=$(echo "$app" | sed 's/#.*//;s/^[[:space:]]*//;s/[[:space:]]*$//') app=$(echo "$app" | sed 's/#.*//;s/^[[:space:]]*//;s/[[:space:]]*$//')
if [ -n "$app" ]; then if [ -n "$app" ]; then