Skip to content

Commit 0d41073

Browse files
authored
feat(nix): add mkShell and flake
1 parent 572f566 commit 0d41073

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

snippets/nix.json

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,46 @@
8282
],
8383
"description": "Nixpkgs' stdenv.mkDerivation template"
8484
},
85+
"pkgs.mkShell": {
86+
"prefix": "mks",
87+
"body": [
88+
"{pkgs ? import <nixpkgs> {}, ...}:",
89+
"pkgs.mkShell {",
90+
" shellHook = ''",
91+
" $1",
92+
" '';",
93+
"",
94+
" env = {",
95+
" $2",
96+
" };",
97+
"",
98+
" packages = [",
99+
" $3",
100+
" ];",
101+
"}"
102+
],
103+
"description": "mkShell template"
104+
},
105+
"flake": {
106+
"prefix": "flake",
107+
"body": [
108+
"{",
109+
" description = \"${1:A flake}\";",
110+
"",
111+
" inputs = {",
112+
" nixpkgs.url = \"github:NixOS/nixpkgs/nixos-unstable\";",
113+
" flake-utils.url = \"github:numtide/flake-utils\";",
114+
" $2",
115+
" };",
116+
"",
117+
" outputs = inputs @ { self, nixpkgs, flake-utils, ... }: ",
118+
" flake-utils.lib.eachDefaultSystem (system: {",
119+
" $3",
120+
" });",
121+
"}"
122+
],
123+
"description": "simple flake template with flake-utils"
124+
},
85125
"meta": {
86126
"prefix": "meta",
87127
"body": [

0 commit comments

Comments
 (0)