Open nzbr opened 10 months ago
Hello, I will try to implement this, I will keep you updated if I need anything
Hello again @nzbr , I got a few issue so I want to know how should I try to debug it further, the three changes I tried:
--- a/modules/build-tarball.nix
+++ b/modules/build-tarball.nix
@@ -85,6 +85,7 @@ in
mkdir -p "$root/etc/nixos"
cp -R ${lib.cleanSource cfg.configPath}/. "$root/etc/nixos"
chmod -R u+w "$root/etc/nixos"
+ chown -R 1000 /etc/nixos
''}
echo "[NixOS-WSL] Compressing..."
AND
--- a/modules/build-tarball.nix
+++ b/modules/build-tarball.nix
@@ -85,6 +85,7 @@ in
mkdir -p "$root/etc/nixos"
cp -R ${lib.cleanSource cfg.configPath}/. "$root/etc/nixos"
chmod -R u+w "$root/etc/nixos"
+ chown -R 1000 "$root/etc/nixos"
''}
echo "[NixOS-WSL] Compressing..."
AND
--- a/modules/build-tarball.nix
+++ b/modules/build-tarball.nix
@@ -85,6 +85,7 @@ in
mkdir -p "$root/etc/nixos"
cp -R ${lib.cleanSource cfg.configPath}/. "$root/etc/nixos"
chmod -R u+w "$root/etc/nixos"
+ chown -R nixos /etc/nixos
''}
echo "[NixOS-WSL] Compressing..."
Changing the owner to the default user shouldn't be necessary. It's fine if the file can only be edited by root. Given that the needed chmod
call is already there, I suspect that the permissions get lost when creating the tar file for some reason
I suspect that the permissions get lost when creating the tar file for some reason
That is what I was thinking too, so maybe we could do it in the first time the system is runned like the welcome message?
Good idea. I like it. It's probably best to put it in an activation script
Good idea. I like it. It's probably best to put it in an activation script
I don't like the idea of a activation script since I still want give the user a way to change the permissions for whatever they want, Which is impossible if the permissions are changed everytime the system is rebuilt
When importing a fresh tarball,
/etc/nixos/configuration.nix
is set to read-only. We should make the file writeable by root in the tarball builder