edolstra / flake-compat

MIT License
254 stars 71 forks source link

bashrc is sourced #21

Closed ursi closed 3 years ago

ursi commented 3 years ago
{ outputs = { nixpkgs, ... }:
    let system = "x86_64-linux"; in
    { devShell.${system} =
        nixpkgs.legacyPackages.${system}.mkShell
          { shellHook = "alias"; };
    };
}

running this shell with nix-shell and flake-compat will show all the aliases defined in your bashrc, whereas running it in nix develop will not.

zimbatm commented 3 years ago

This is probably out of scope. The compact layer doesn't control how bash is being invoked.

ursi commented 3 years ago

Oh, so this behaviour can't be emulated inside of nix 2.3? I was hoping it could :(

edolstra commented 3 years ago

Right, this is more a nix develop issue, so you may want to reopen this issue in the nix repo.

ursi commented 3 years ago

@edolstra are you saying nix develop is currently working improperly, and it should be sourcing the bashrc?

edolstra commented 3 years ago

Could be, I can never remember when bashrc or bash_profile should be sourced...

ursi commented 3 years ago

Personally I feel like sourcing either of those in the shellHook is not great. I just had my own code break from it due to me changing one of my aliases.