Skip to content

Commit eeb2c05

Browse files
committed
feat(nix): add mkShell and flake-{utils,parts}
1 parent 572f566 commit eeb2c05

File tree

1 file changed

+80
-0
lines changed

1 file changed

+80
-0
lines changed

snippets/nix.json

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,86 @@
8282
],
8383
"description": "Nixpkgs' stdenv.mkDerivation template"
8484
},
85+
"pkgs.mkShell": {
86+
"prefix": "mks",
87+
"body": [
88+
"pkgs.mkShell {",
89+
" shellHook = ''",
90+
" $1",
91+
" '';",
92+
"",
93+
" env = {",
94+
" $2",
95+
" };",
96+
"",
97+
" packages = [",
98+
" $3",
99+
" ];",
100+
"}"
101+
],
102+
"description": "mkShell template"
103+
},
104+
"flake-parts": {
105+
"prefix": "flakeparts",
106+
"body": [
107+
"{",
108+
" description = \"${1:A flake}\";",
109+
"",
110+
" inputs = {",
111+
" nixpkgs.url = \"github:NixOS/nixpkgs/nixos-unstable\";",
112+
" flake-parts.url = \"github:hercules-ci/flake-parts\";",
113+
" };",
114+
"",
115+
" outputs =",
116+
" inputs@{ flake-parts, ... }:",
117+
" flake-parts.lib.mkFlake { inherit inputs; } {",
118+
" imports = [",
119+
" $2",
120+
" ];",
121+
" systems = [",
122+
" \"x86_64-linux\"",
123+
" \"aarch64-linux\"",
124+
" \"aarch64-darwin\"",
125+
" \"x86_64-darwin\"",
126+
" ];",
127+
" perSystem =",
128+
" {",
129+
" config,",
130+
" pkgs,",
131+
" system,",
132+
" ...",
133+
" }:",
134+
" {",
135+
" $3",
136+
" };",
137+
" flake = {",
138+
" $4",
139+
" };",
140+
" };",
141+
"}"
142+
],
143+
"description": "simple flake template with flake-parts"
144+
},
145+
"flake-utils": {
146+
"prefix": "flakeutils",
147+
"body": [
148+
"{",
149+
" description = \"${1:A flake}\";",
150+
"",
151+
" inputs = {",
152+
" nixpkgs.url = \"github:NixOS/nixpkgs/nixos-unstable\";",
153+
" flake-utils.url = \"github:numtide/flake-utils\";",
154+
" $2",
155+
" };",
156+
"",
157+
" outputs = inputs @ { self, nixpkgs, flake-utils, ... }: ",
158+
" flake-utils.lib.eachDefaultSystem (system: {",
159+
" $3",
160+
" });",
161+
"}"
162+
],
163+
"description": "simple flake template with flake-utils"
164+
},
85165
"meta": {
86166
"prefix": "meta",
87167
"body": [

0 commit comments

Comments
 (0)