Last active
September 19, 2021 20:45
-
-
Save 0xd61/c1b886ec29376828f2bad3ca7112e7a0 to your computer and use it in GitHub Desktop.
Nix shell env template
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This shell defines a development environment for a c project. | |
{ | |
pkgs ? import (fetchTarball "https://github.com/NixOS/nixpkgs/archive/39e6bf76474ce742eb027a88c4da6331f0a1526f.tar.gz") {} | |
}: | |
# Override packages if necessary | |
#let | |
# newExample = pkgs.example.override { | |
# option = example | |
# }; | |
#in | |
# for changing the gcc environment use | |
# pkgs.mkShell.override {stdenv = pkgs.gcc10Stdenv;} { | |
pkgs.mkShell { | |
buildInputs = with pkgs; [ | |
#packages | |
]; | |
shellHook = '' | |
# start user default shell | |
SHELL=$(awk -F: -v user="$USER" '$1 == user {print $NF}' /etc/passwd) | |
$SHELL | |
''; | |
NIX_ENFORCE_PURITY=0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment