Skip to content

nh clean all "$HOME is not owned by you" #314

@nyukuru

Description

@nyukuru

This doesn't seem to actually cause any different behavior but I'm not sure where this is coming from

❯ nh clean all --verbose --ask
TRACE nh::logging:86: Logging OK
DEBUG nh:28: Main {
    verbose: true,
    command: Clean(
        CleanProxy {
            command: All(
                CleanArgs {
                    keep: 1,
                    keep_since: Duration(
                        0ns,
                    ),
                    dry: false,
                    ask: true,
                    nogc: false,
                    nogcroots: false,
                },
            ),
        },
    ),
}
DEBUG nh:29: NH_VERSION=4.1.0 NH_REV=Some("v4.1.0")
DEBUG nh::commands:160: cmd=Exec { nix --version }
DEBUG nh::commands:160: cmd=Exec { nix --version }
DEBUG nh::commands:160: cmd=Exec { nix --version }
DEBUG nh::commands:160: cmd=Exec { nix --version }
DEBUG nh::checks:85: Required Nix features: nix-command, flakes
DEBUG nh::commands:160: cmd=Exec { nix config show experimental-features }
DEBUG nh::checks:91: Enabled Nix features: nix-command, flakes
DEBUG nh::commands:160: cmd=Exec { nix config show experimental-features }
DEBUG nh::checks:111: All required Nix features are enabled
DEBUG nh:64: "sudo" "--preserve-env" "nh" "clean" "all" "--verbose" "--ask"
TRACE nh::logging:86: Logging OK
DEBUG nh:28: Main {
    verbose: true,
    command: Clean(
        CleanProxy {
            command: All(
                CleanArgs {
                    keep: 1,
                    keep_since: Duration(
                        0ns,
                    ),
                    dry: false,
                    ask: true,
                    nogc: false,
                    nogcroots: false,
                },
            ),
        },
    ),
}
DEBUG nh:29: NH_VERSION=4.1.0 NH_REV=Some("v4.1.0")
DEBUG nh::commands:160: cmd=Exec { nix --version }
warning: $HOME ('/home/nyu') is not owned by you, falling back to the one defined in the 'passwd' file ('/root')
DEBUG nh::commands:160: cmd=Exec { nix --version }
warning: $HOME ('/home/nyu') is not owned by you, falling back to the one defined in the 'passwd' file ('/root')
DEBUG nh::commands:160: cmd=Exec { nix --version }
warning: $HOME ('/home/nyu') is not owned by you, falling back to the one defined in the 'passwd' file ('/root')
DEBUG nh::commands:160: cmd=Exec { nix --version }
warning: $HOME ('/home/nyu') is not owned by you, falling back to the one defined in the 'passwd' file ('/root')
DEBUG nh::checks:85: Required Nix features: nix-command, flakes
DEBUG nh::commands:160: cmd=Exec { nix config show experimental-features }
warning: $HOME ('/home/nyu') is not owned by you, falling back to the one defined in the 'passwd' file ('/root')
DEBUG nh::checks:91: Enabled Nix features: nix-command, flakes
DEBUG nh::commands:160: cmd=Exec { nix config show experimental-features }
warning: $HOME ('/home/nyu') is not owned by you, falling back to the one defined in the 'passwd' file ('/root')
DEBUG nh::checks:111: All required Nix features are enabled
DEBUG profiles_in_dir: nh::clean:249: return=["/nix/var/nix/profiles/system"] dir="/nix/var/nix/profiles"
DEBUG profiles_in_dir: nh::clean:249: return=["/nix/var/nix/profiles/per-user/root/channels"] dir="/nix/var/nix/profiles/per-user/root"
DEBUG nh::clean:64: Scanning XDG profiles for users 0, $1000-$1100
DEBUG nh::clean:67: Adding XDG profiles for user user=User(0, root)
! Failed to read profiles directory dir="/root/.local/state/nix/profiles" error=Os { code: 2, kind: NotFound, message: "No such file or directory" } (nh/src/clean.rs:281)
DEBUG profiles_in_dir: nh::clean:249: return=[] dir="/root/.local/state/nix/profiles"
DEBUG nh::clean:67: Adding XDG profiles for user user=User(1000, nyu)
DEBUG profiles_in_dir: nh::clean:249: return=[] dir="/home/nyu/.local/state/nix/profiles"
DEBUG cleanable_generations: nh::clean:350: {
    Generation {
        number: 592,
        last_modified: SystemTime {
            tv_sec: 1749015239,
            tv_nsec: 69798026,
        },
        path: "/nix/var/nix/profiles/system-592-link",
    }: false,
} profile="/nix/var/nix/profiles/system" keep=1 keep_since=Duration(0ns)
DEBUG cleanable_generations: nh::clean:350: {
    Generation {
        number: 1,
        last_modified: SystemTime {
            tv_sec: 1723939755,
            tv_nsec: 108351834,
        },
        path: "/nix/var/nix/profiles/per-user/root/channels-1-link",
    }: false,
} profile="/nix/var/nix/profiles/per-user/root/channels" keep=1 keep_since=Duration(0ns)
DEBUG gcroot detection: nh::clean:115: src="/nix/var/nix/gcroots/auto/2m8wm8j83xbdp2b6wmrgd0bgy8qd4r75" dst="/root/.cache/nix/flake-registry.json"
DEBUG gcroot detection: nh::clean:121: dst doesn't match any gcroot regex, skipping dst="/root/.cache/nix/flake-registry.json"
DEBUG gcroot detection: nh::clean:115: src="/nix/var/nix/gcroots/auto/fwi4h72b3a7swavbdimg12jalqcswxq3" dst="/nix/var/nix/profiles/system-592-link"
DEBUG gcroot detection: nh::clean:121: dst doesn't match any gcroot regex, skipping dst="/nix/var/nix/profiles/system-592-link"

Welcome to nh clean
Keeping 1 generation(s)
Keeping paths newer than 0s

legend:
OK: path to be kept
DEL: path to be removed

/nix/var/nix/profiles/system
- OK  /nix/var/nix/profiles/system-592-link

/nix/var/nix/profiles/per-user/root/channels
- OK  /nix/var/nix/profiles/per-user/root/channels-1-link

> Confirm the cleanup plan?
no
Error: 
   0: User rejected the cleanup plan

Location:
   src/clean.rs:217

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions