• entwine@programming.dev
      link
      fedilink
      arrow-up
      0
      ·
      1 day 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
        0
        ·
        edit-2
        20 hours 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@programming.dev
          link
          fedilink
          arrow-up
          0
          ·
          20 hours 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.

            • entwine@programming.dev
              link
              fedilink
              arrow-up
              0
              ·
              14 hours ago

              Well, you’re clearly very passionate about nix, but all you’ve shown is how to install git in an isolated shell, which again isn’t what I was asking.

              I don’t have anything against nix, but it doesn’t seem like the right solution to the particular problem that was presented.

              • ultimate_worrier@lemmy.dbzer0.com
                link
                fedilink
                arrow-up
                0
                ·
                14 hours ago

                🤦🏻‍♂️

                You don’t seem to understand that everything you said in your initial comment is completely possible (trivial) with those nix commands I showed you.

                Podman:

                • spin up a podman to use bash
                • apt install git
                • git checked those folders.
                • deleted the container

                nix:

                • nix-shell -p git
                • git checked those folders
                • close the terminal/garbage collect

                Does it make sense now? Or were you just really vague in your original comment and I misunderstood what you were even doing with your commands?

                • entwine@programming.dev
                  link
                  fedilink
                  arrow-up
                  0
                  ·
                  14 hours ago

                  This is why nix is doomed to be a toy forever, because its user base consists of unhinged cheerleaders. Please do the following:

                  1. Breathe in
                  2. Count to 6
                  3. Breathe out
                  4. Count to 6
                  5. Repeat until you stop seeing red

                  Now, re-read the linked blog post and my comments, and try to understand the problem.