deleted generated files
This commit is contained in:
+10
-35
@@ -775,41 +775,26 @@ This will import all packages listed in ../../assets/system/apps/flatpaks.conf
|
||||
{ lib, pkgs, config, ... }:
|
||||
|
||||
let
|
||||
moduleName = "flatpaks";
|
||||
|
||||
# Toggle for this module
|
||||
enableProgram = config.enableFlatpaks or false;
|
||||
|
||||
# Default username
|
||||
username = config.defaultUser or "henrov";
|
||||
|
||||
# Path to the flatpaks.conf (no reading at eval time!)
|
||||
flatpakConfPath = ../../../assets/system/apps/flatpaks.conf;
|
||||
|
||||
in {
|
||||
# Top-level toggle option
|
||||
flatpakConfPath = ../../../assets/system/apps/flatpaks.conf;
|
||||
enableProgram = config.enableFlatpaks or false;
|
||||
in
|
||||
{
|
||||
options.enableFlatpaks = lib.mkEnableOption "Enable automatic Flatpak installation";
|
||||
|
||||
config = lib.mkIf enableProgram {
|
||||
|
||||
# Place Flatpaks under mySystem (do not declare nested options)
|
||||
mySystem = {
|
||||
flatpaks = {
|
||||
enable = true;
|
||||
user = username;
|
||||
assetsDir = flatpakConfPath;
|
||||
files = []; # handled at runtime
|
||||
};
|
||||
myApps.flatpaks = {
|
||||
enable = true;
|
||||
user = config.defaultUser or "henrov";
|
||||
assetsDir = flatpakConfPath;
|
||||
files = [];
|
||||
};
|
||||
|
||||
# Deploy the conf file to /etc
|
||||
environment.etc."flatpak/flatpaks.conf".source = flatpakConfPath;
|
||||
|
||||
# Enable flatpak service
|
||||
services.flatpak.enable = true;
|
||||
xdg.portal.enable = true;
|
||||
|
||||
# Systemd service for installing listed Flatpaks
|
||||
systemd.services.flatpak-sync = {
|
||||
description = "Install Flatpak apps listed in flatpaks.conf";
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
@@ -821,13 +806,9 @@ in {
|
||||
ExecStart = ''
|
||||
set -euo pipefail
|
||||
CONF="${flatpakConfPath}"
|
||||
|
||||
# Add flathub if missing
|
||||
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
|
||||
fi
|
||||
|
||||
# Read apps safely (ignore empty lines and comments)
|
||||
while IFS= read -r app || [ -n "$app" ]; do
|
||||
app=$(echo "$app" | sed 's/#.*//;s/^[[:space:]]*//;s/[[:space:]]*$//')
|
||||
if [ -n "$app" ]; then
|
||||
@@ -840,13 +821,7 @@ in {
|
||||
};
|
||||
|
||||
restartTriggers = [ flatpakConfPath ];
|
||||
|
||||
path = [
|
||||
pkgs.flatpak
|
||||
pkgs.coreutils
|
||||
pkgs.gnugrep
|
||||
pkgs.gnused
|
||||
];
|
||||
path = [ pkgs.flatpak pkgs.coreutils pkgs.gnugrep pkgs.gnused ];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user