Skip to content

Instantly share code, notes, and snippets.

@countoren
Created April 17, 2020 21:11
Show Gist options
  • Save countoren/6c3432a791b289d8641a41300e6321ae to your computer and use it in GitHub Desktop.
Save countoren/6c3432a791b289d8641a41300e6321ae to your computer and use it in GitHub Desktop.
shell nix example with vscodeEnv
with import <nixpkgs>{};
let vscodeEnv = (callPackage (fetchFromGitHub {
owner="countoren";
repo="VSCodeEnv";
rev="3992e93fa762b3982c04362da0cd74942350000e";
sha256="050abfl9tikwn51nb4zva3gxxawp1xynwkf1qw4s7jqgdaz06qx27";
}) {}).vscodeEnv;
in
mkShell {
buildInputs = [
## this will give you a code executable in shell that when run with code . in the folder will get a vscode that is specialized to this specific folder.
## note that extensions could be installed in vscode when quiting the mutable-extensions.nix file will be updated for you with all the extensions that were installed
## settings.json andm keybinding.json will be created base on this nix expression(override the files with nix defintion when code starts).
(vscodeEnv {
nixExtensions = [];
mutableExtensionsFile = ./mutable-extensions.nix;
settings =
{
"somepropinsettings.json" = "value";
};
keybindings =
{
};
})
];
shellHook = ''
'';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment