Skip to content

Commit 03fd78b

Browse files
authored
Create nix-ts-mode sub-directory; Add additional snippets to nix-mode (#515)
* nix-ts-mode: New snippet directory. * nix-mode: pkg_mkshell: New snippet This snippet is designed to quickly write out a `shell.nix` for Nix. * nix-mode: doCheck: New snippet. Adds a snippet to add the doCheck attribute to a package derivation that uses the current standard: a condition for cross-compilation or false. * nix-mode: passthru_update: New snippet. This adds a snippet for adding the `passthru.updateScript` attribute used in many nixpkgs derivations.
1 parent 2ecf1bf commit 03fd78b

File tree

4 files changed

+27
-0
lines changed

4 files changed

+27
-0
lines changed

snippets/nix-mode/doCheck

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# -*- mode: snippet -*-
2+
# name: doCheck
3+
# key: dc
4+
# --
5+
doCheck = ${1:$$(yas-auto-next
6+
(yas-choose-value
7+
'("stdenv.buildPlatform.canExecute stdenv.hostPlatform;"
8+
"false;")))}

snippets/nix-mode/passthru_update

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# -*- mode: snippet -*-
2+
# name: passthru_update
3+
# key: pu
4+
# --
5+
passthru.updateScript = nix-update-script { };

snippets/nix-mode/pkgs_mkshell

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# -*- mode: snippet -*-
2+
# name: pkgs_mkshell
3+
# key: pms
4+
# --
5+
pkgs.${1:$$(yas-auto-next (yas-choose-value '("mkShell" "mkShellNoCC")))} {
6+
inputsFrom = [ $3 ];
7+
8+
packages = [ $2 ];
9+
10+
shellHook = ''
11+
$4
12+
'';
13+
}$0

snippets/nix-ts-mode/.yas-parents

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
nix-mode

0 commit comments

Comments
 (0)