Compare commits

...

2 Commits

Author SHA1 Message Date
henrov cd8196d859 Working on reshuffling 2026-03-19 13:26:35 +00:00
henrov 6243a94d21 deleted generated files 2026-03-19 13:26:34 +00:00
2 changed files with 38 additions and 28 deletions
+16 -11
View File
@@ -778,18 +778,23 @@ This will import all packages listed in ../../assets/system/apps/flatpaks.conf
let let
moduleName = "flatpaks"; moduleName = "flatpaks";
# Toggle for this module
enableProgram = config.enableFlatpaks or false;
# Default username
username = config.defaultUser or "henrov"; username = config.defaultUser or "henrov";
# Path to the flatpaks.conf (no reading at eval time!)
flatpakConfPath = ../../../assets/system/apps/flatpaks.conf; flatpakConfPath = ../../../assets/system/apps/flatpaks.conf;
enableProgram = config.enableFlatpaks or false; in {
in # Top-level toggle option
{
# Top-level toggle for this module
options.enableFlatpaks = lib.mkEnableOption "Enable automatic Flatpak installation"; options.enableFlatpaks = lib.mkEnableOption "Enable automatic Flatpak installation";
config = lib.mkIf enableProgram { config = lib.mkIf enableProgram {
# Assign myApps.flatpaks inside config only # Place Flatpaks under myApps (do not declare nested options)
myApps = { myApps = {
flatpaks = { flatpaks = {
enable = true; enable = true;
@@ -799,14 +804,14 @@ in
}; };
}; };
# Deploy the conf file # Deploy the conf file to /etc
environment.etc."flatpak/flatpaks.conf".source = flatpakConfPath; environment.etc."flatpak/flatpaks.conf".source = flatpakConfPath;
# Enable flatpak # Enable flatpak service
services.flatpak.enable = true; services.flatpak.enable = true;
xdg.portal.enable = true; xdg.portal.enable = true;
# Systemd service to sync flatpaks # 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" ];
@@ -824,10 +829,10 @@ in
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
# Install apps from conf # Read apps safely (ignore empty lines and comments)
while read -r 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
if ! flatpak info --system "$app" >/dev/null 2>&1; then if ! flatpak info --system "$app" >/dev/null 2>&1; then
flatpak install --system -y --noninteractive flathub "$app" flatpak install --system -y --noninteractive flathub "$app"
fi fi
+16 -11
View File
@@ -2,18 +2,23 @@
let let
moduleName = "flatpaks"; moduleName = "flatpaks";
# Toggle for this module
enableProgram = config.enableFlatpaks or false;
# Default username
username = config.defaultUser or "henrov"; username = config.defaultUser or "henrov";
# Path to the flatpaks.conf (no reading at eval time!)
flatpakConfPath = ../../../assets/system/apps/flatpaks.conf; flatpakConfPath = ../../../assets/system/apps/flatpaks.conf;
enableProgram = config.enableFlatpaks or false; in {
in # Top-level toggle option
{
# Top-level toggle for this module
options.enableFlatpaks = lib.mkEnableOption "Enable automatic Flatpak installation"; options.enableFlatpaks = lib.mkEnableOption "Enable automatic Flatpak installation";
config = lib.mkIf enableProgram { config = lib.mkIf enableProgram {
# Assign myApps.flatpaks inside config only # Place Flatpaks under myApps (do not declare nested options)
myApps = { myApps = {
flatpaks = { flatpaks = {
enable = true; enable = true;
@@ -23,14 +28,14 @@ in
}; };
}; };
# Deploy the conf file # Deploy the conf file to /etc
environment.etc."flatpak/flatpaks.conf".source = flatpakConfPath; environment.etc."flatpak/flatpaks.conf".source = flatpakConfPath;
# Enable flatpak # Enable flatpak service
services.flatpak.enable = true; services.flatpak.enable = true;
xdg.portal.enable = true; xdg.portal.enable = true;
# Systemd service to sync flatpaks # 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" ];
@@ -48,10 +53,10 @@ in
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
# Install apps from conf # Read apps safely (ignore empty lines and comments)
while read -r 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
if ! flatpak info --system "$app" >/dev/null 2>&1; then if ! flatpak info --system "$app" >/dev/null 2>&1; then
flatpak install --system -y --noninteractive flathub "$app" flatpak install --system -y --noninteractive flathub "$app"
fi fi