nix-community / nix-on-droid

Nix-enabled environment for your Android device. [maintainers=@t184256,@Gerschtli]
https://nix-on-droid.unboiled.info
MIT License
1.25k stars 69 forks source link

emacs error 'User xxxx has no home directory' #11

Closed codygman closed 2 years ago

codygman commented 5 years ago
bash-4.4$
bash-4.4$ ls .em*
ls: cannot access '.em*': No such file or directory
bash-4.4$ emacs

Results in:

Error (initialization): User u0_a211 has no home directory

You can get past it with:

emacs --load emacs-config/init.el --user ''

Maybe there is a better solution?

Gerschtli commented 4 years ago

Can you share more information about your setup? Because running nix run nixpkgs.emacs -c emacs works perfectly fine for me.

codygman commented 4 years ago

@Gerschtli Do you have a .emacs or .emacs.d directory? I moved my .emacs and .emacs.ddirectory temporarily to test but I'm not sure if that makes a difference.

I just tried again and the issue is reproducible with nix run nixpkgs.emacs -c emacs.

I'm not sure what other information is useful, but here's what I can think of being relevant:

codygman commented 4 years ago

Perhaps your user has a home directory and if applicable to android an entry in /etc/passwd?

t184256 commented 4 years ago

Yeah, a good starting point to unwind stuff.

/etc/passwd should be mapped to a file generated during Nix-on-Droid installation, and I haven't really put much thought into it. It has already been a source of problems before.

Could you both please share the output of

id
echo $USER $HOME
cat /etc/passwd
ls -ld $HOME
Gerschtli commented 4 years ago

My output:

~
❯ id
uid=10256(nix-on-droid) gid=10256 groups=10256,3003,9997,20256,50256,99909997

~
❯ echo $USER $HOME
u0_a256 /data/data/com.termux.nix/files/home

~
❯ cat /etc/passwd
root:x:0:0:System administrator:/data/data/com.termux.nix/files/usr/root:/bin/sh
nix-on-droid:x:10256:10256:nix-on-droid:/data/data/com.termux.nix/files/home:/bin/sh

~
❯ ls -ld $HOME
drwx------ 11 nix-on-droid 10256 4096 Sep 15 05:06 /data/data/com.termux.nix/files/home

I did not create any emacs related directories. Currently I only have an empty ~/.emacs.d/auto-save-list created by the initial call of emacs.

codygman commented 4 years ago

It has already been a source of problems before.

Perhaps resolution of this issue will help solve other issues or make nix on android more stable then :)

My output:

bash-4.4$ id
uid=10211(nix-on-droid) gid=10211 groups=10211,3003,9997,20211,50211
bash-4.4$ echo $USER $HOME
u0_a211 /data/data/com.termux.nix/files/home
bash-4.4$ cat /etc/passwd
root:x:0:0:System administrator:/data/data/com.termux.nix/files/usr/root:/bin/sh
nix-on-droid:x:10211:10211:nix-on-droid:/data/data/com.termux.nix/files/home:/bin/sh
bash-4.4$ ls -ld $HOME
drwx------ 7 nix-on-droid 10211 4096 Sep 14 16:04 /data/data/com.termux.nix/files/home
t184256 commented 4 years ago

@codygman, will this go away if you rename the user in /etc/passwd to u0_a211?

Gerschtli commented 2 years ago

No activity here since a long time. Feel free to reopen if still an issue.