Repository: nix-community/home-manager

Issue #705: Empty env-manifest.nix (after nix-collect-garbage?)
Created: 2019-05-06T19:52:43Z
I recently did garbage collected nix (on NixOS) and can no longer switch with home manager (at least, I think this is the problem). build works, but when running home-manager switch I get:
Starting home manager activation
Activating checkFilesChanged
Activating checkLinkTargets
Activating writeBoundary
Activating installPackages
error: syntax error, unexpected $end, at /nix/store/akvyj2wbzvmpxgbvlnhaid3lmah7srvh-env-manifest.nix:1:1

/nix/store/akvyj2wbzvmpxgbvlnhaid3lmah7srvh-env-manifest.nix is an empty file, and I get the same error if I attempt to roll back with a previous generation: /nix/store/25d811mvb0ys4w7cd2vhh12r210zf98z-home-manager-generation/activate
It looks to be the same error as #320, but this time I am not building in a VM. I have removed ~/.config/nixpkgs/config.nix and my ~/.config/nixpkgs/home.nix is just:
{ pkgs, lib, config, ... }:

{
  programs.home-manager.enable = true;
}
Should I reinstall home-manager or delete this file? I get nervous whenever I remount /nix/store in rw, but this file does seem problematic.

Duplicate issue #4077: bug: activat script syntax error, unexpected end of file
Created: 2023-06-10T09:53:28Z
Are you following the right branch?

 My Nixpkgs and Home Manager versions are in sync

Is there an existing issue for this?

 I have searched the existing issues

Issue description
I use standalone home-manager.
when I configure bash, zsh and switch configuration, it prompts me:
lqy@NixOS:~/btrfs-wayland-nix/ > home-manager build --flake .#lqy@NixOS --show-trace
error:
       … while evaluating the attribute 'buildCommand' of the derivation 'home-manager-generation'

       at /nix/store/wcgkp46gj4ca0700wprx42r51b60ws4l-source/pkgs/stdenv/generic/make-derivation.nix:303:7:

          302|     // (lib.optionalAttrs (attrs ? name || (attrs ? pname && attrs ? version)) {
          303|       name =
             |       ^
          304|         let

       error: error parsing derivation '/nix/store/63bhlmkywrdrllp8x2myknvdkcj26frs-hm_.zshenv.drv': error: expected string 'Derive(['
And when I comment out the import of the relevant shell module, run again:
lqy@NixOS:~/btrfs-wayland-nix/ > home-manager switch --flake .#lqy@NixOS --show-trace
Starting Home Manager activation
Activating checkFilesChanged
Activating checkLinkTargets
Activating writeBoundary
Activating linkGeneration
Cleaning up orphan links from /home/lqy
Creating profile generation 9
Creating home file links in /home/lqy
Activating createXdgUserDirectories
Activating installPackages
error: syntax error, unexpected end of file

       at /nix/store/9fppwh3xk6qnc3lhgzvzifc2jqyqfadp-env-manifest.nix:1:1:

            1|
             | ^

Oops, Nix failed to install your new Home Manager profile!

Perhaps there is a conflict with a package that was installed using
"nix-env -i"? Try running

    nix-env -q

and if there is a conflicting package you can remove it with

    nix-env -e {package name}

Then try activating your Home Manager configuration again.
lqy@NixOS:~/btrfs-wayland-nix/ > home-manager --version
23.05
lqy@NixOS:~/btrfs-wayland-nix/ > nix-env -q
error: syntax error, unexpected end of file

       at /nix/store/9fppwh3xk6qnc3lhgzvzifc2jqyqfadp-env-manifest.nix:1:1:

            1|
             | ^
lqy@NixOS:~/btrfs-wayland-nix/ >
Maintainer CC
No response
System information
- system: `"x86_64-linux"`
 - host os: `Linux 6.1.31, NixOS, 23.05 (Stoat), 23.05.20230609.85bcb95`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.13.3`
 - channels(lqy): `"home-manager-23.05.tar.gz"`
 - nixpkgs: `/nix/store/7g0lr1xg2kw7lfk6664rnsnj7x0c8r8x-source`

Closing comment (2023-06-10T10:41:45Z): Sorry for the late reply. Yes, this was a duplicate of #705?