• entwine
    link
    fedilink
    arrow-up
    1
    ·
    1 day ago

    Completely off topic, but

    Unfortunately, I didn’t check that before monkeying with things, so I have no idea if I’ve changed my system accidentally.

    Reading this makes me feel so powerful to be as familiar as I am with podman/docker (which to be clear is a modest amount). Just do:

    podman run --rm -it debian:latest bash
    

    Then apt install git, check those folders, and finally exit so the entire container gets automatically deleted.

    The whole thing is done in a few seconds (or more depending on how long git takes to download and whether the debian image is already cached)

    Everyone on Linux should have this in their toolbelt.

      • entwine
        link
        fedilink
        arrow-up
        1
        ·
        4 hours ago

        The solution to the problem is to install git into a clean system so you can observe what changes it makes.

        How would you do this with Nix?

        • ultimate_worrier@lemmy.dbzer0.com
          link
          fedilink
          arrow-up
          1
          ·
          edit-2
          8 minutes ago
          nix-shell -p git
          

          Or some even fancier ones:

          nix-store -qR $(nix-build '<nixpkgs>' -A git --no-out-link)
          

          or this command (which nix people avoid generally because it creates files outside of the store):

          nix path-info -rSh $(nix-build '<nixpkgs>' -A git --no-out-link)
          

          or

          nix-env -p /tmp/clean-profile -iA nixpkgs.git && nix-store -qR /tmp/clean-profile
          
          
          # then
          
          rm /tmp/clean-profile* 
          
          # to get rid of the temp files
          
          
          • entwine
            link
            fedilink
            arrow-up
            1
            ·
            4 minutes ago

            I guess you misunderstood my question, because that won’t work. nix-shell -p git doesn’t provide an isolated operating system. They only isolate programs and libraries. If your native git installation modified something in your home folder, those changes will still be visible inside a nix shell.

            I’m not sure what you’re trying to accomplish in those other commands, as they just seem to print out git’s dependencies?

            Also, I see you’re actively editing your comment as I’m typing so sorry if you actually post the answer after I hit Reply.