Commits: 3

Implement #5: each user gets to install applications from Flathub

As usual, NixOS provides an easy solution. Turns out we can create a user service for every user of the service with options under systemd.user.services.

The flakiness of the WiFi in the library complicated the matter a bit, but I solved it by making the service re-try every 30s if it fails. It seems to work fine.

As desired, whatever Guest installs is wiped out on reboot.

Currently guests can add other sources than flathub. I'm not sure how big of a problem this is.

Also, I don't yet have a solution for slow installation of first app. I guess the problem is mostly caused by slow network in the library. Installing something like Inkscape takes about 60 seconds, so maybe I'm just spoiled and it's not really that bad?

index e5e2184..a800e62 100644
--- a/flake.nix
+++ b/flake.nix
@@ -15,6 +15,7 @@
=      modules = [
=        ./configuration.nix
=	./guest-session.nix
+	./flatpak.nix
=      ];
=    };
=  };
new file mode 100644
index 0000000..1603eef
--- /dev/null
+++ b/flatpak.nix
@@ -0,0 +1,23 @@
+
+{ config, pkgs, ... }:
+
+{
+  services.flatpak.enable = true;
+  environment.systemPackages = with pkgs; [
+    flatpak
+    gnome-software
+  ];
+  systemd.user.services.flatpak-repo = {
+    enable = true;
+    path = [ pkgs.flatpak ];
+    wantedBy = ["default.target"];
+    script = ''
+      flatpak --user remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo
+    '';
+    serviceConfig = {
+      Restart = "on-failure";
+      RestartSec = 30;
+    };
+  };
+}
+

Remove TODO.md in favor of Codeberg issues

Issues allow for discussion, including outside contributors.

deleted file mode 100644
index 01c4873..0000000
--- a/TODO.md
+++ /dev/null
@@ -1,14 +0,0 @@
-Things to make and do:
-
-  - [ ] Automatic synchronization of configuration 
-    - see https://discourse.nixos.org/t/managing-a-fleet-of-nixos-desktop-machines/55150/4
-  - [ ] Accounts for individual staff members
-    - How to manage passwords?
-    - Synchronize the particular configuration (language, keyboard, etc.)
-    - See https://discourse.nixos.org/t/gnome-user-specific-locales/50593/8
-    - Propagate SSH keys?
-  - [ ] Flatpak, esp. for the guest account
-  - [ ] Set language to Dutch for guest account
-  - [ ] Put Firefox on the launcher bar for guest account
-  - [ ] Read https://discourse.nixos.org/t/nixos-for-class-room-pcs-using-pxe/58488/2 for hints
-  - [ ] Turn this into Codeberg issues?

Format code in flake.nix (tabs -> spaces) x:

index a800e62..3a0fc7d 100644
--- a/flake.nix
+++ b/flake.nix
@@ -14,8 +14,8 @@
=      inherit system pkgs;
=      modules = [
=        ./configuration.nix
-	./guest-session.nix
-	./flatpak.nix
+        ./guest-session.nix
+        ./flatpak.nix
=      ];
=    };
=  };