init
This commit is contained in:
10
snippets/nix-mode/buildPhase
Normal file
10
snippets/nix-mode/buildPhase
Normal file
@@ -0,0 +1,10 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: buildPhase
|
||||
# key: bp
|
||||
# --
|
||||
buildPhase= ''
|
||||
runHook preBuild
|
||||
$1
|
||||
runHook postBuild
|
||||
'';
|
||||
$0
|
||||
6
snippets/nix-mode/callPackage
Normal file
6
snippets/nix-mode/callPackage
Normal file
@@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: callPackage
|
||||
# key: ca
|
||||
# --
|
||||
$1 = callPackage ../$2/$1 { };
|
||||
$0
|
||||
10
snippets/nix-mode/checkPhase
Normal file
10
snippets/nix-mode/checkPhase
Normal file
@@ -0,0 +1,10 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: checkPhase
|
||||
# key: ch
|
||||
# --
|
||||
checkPhase= ''
|
||||
runHook preCheck
|
||||
$1
|
||||
runHook postCheck
|
||||
'';
|
||||
$0
|
||||
10
snippets/nix-mode/configurePhase
Normal file
10
snippets/nix-mode/configurePhase
Normal file
@@ -0,0 +1,10 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: configurePhase
|
||||
# key: cp
|
||||
# --
|
||||
configurePhase= ''
|
||||
runHook preConfigure
|
||||
$1
|
||||
runHook postConfigure
|
||||
'';
|
||||
$0
|
||||
10
snippets/nix-mode/distPhase
Normal file
10
snippets/nix-mode/distPhase
Normal file
@@ -0,0 +1,10 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: distPhase
|
||||
# key: dp
|
||||
# --
|
||||
distPhase= ''
|
||||
runHook preDist
|
||||
$1
|
||||
runHook postDist
|
||||
'';
|
||||
$0
|
||||
10
snippets/nix-mode/fixupPhase
Normal file
10
snippets/nix-mode/fixupPhase
Normal file
@@ -0,0 +1,10 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: fixPhase
|
||||
# key: fp
|
||||
# --
|
||||
fixupPhase= ''
|
||||
runHook preFixup
|
||||
$1
|
||||
runHook postFixup
|
||||
'';
|
||||
$0
|
||||
10
snippets/nix-mode/installCheckPhase
Normal file
10
snippets/nix-mode/installCheckPhase
Normal file
@@ -0,0 +1,10 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: installCheckPhase
|
||||
# key: ic
|
||||
# --
|
||||
installCheckPhase= ''
|
||||
runHook preInstallCheck
|
||||
$1
|
||||
runHook postInstallCheck
|
||||
'';
|
||||
$0
|
||||
14
snippets/nix-mode/installPhase
Normal file
14
snippets/nix-mode/installPhase
Normal file
@@ -0,0 +1,14 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: installPhase
|
||||
# key: ip
|
||||
# --
|
||||
installPhase= ''
|
||||
runHook preInstall
|
||||
${1: mkdir -p \$out/bin
|
||||
for f in \$(find . -executable -type f);
|
||||
do
|
||||
cp \$f \$out/bin/
|
||||
done}
|
||||
runHook postInstall
|
||||
'';
|
||||
$0
|
||||
82
snippets/nix-mode/package_github
Normal file
82
snippets/nix-mode/package_github
Normal file
@@ -0,0 +1,82 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: package github
|
||||
# key: pg
|
||||
# --
|
||||
{ lib
|
||||
, stdenv
|
||||
, fetchFromGitHub
|
||||
, $1
|
||||
, $2
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "$3";
|
||||
version = "$4";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "$5";
|
||||
repo = ${6:pname};
|
||||
rev = "${7:v\$\{version\}}";
|
||||
sha256 = "${8:\$\{lib.fakeSha256\}}";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ ${1:$(replace-regexp-in-string " *" " "(subst-char-in-string ?, ? yas-text))} ];
|
||||
buildInputs = [
|
||||
${2:$(replace-regexp-in-string " *" " "(subst-char-in-string ?, ? yas-text))}
|
||||
];
|
||||
|
||||
meta = with lib; {
|
||||
homepage = "https://${9:github.com/$5/$3}";
|
||||
description = "$10";
|
||||
longDescription = ''
|
||||
$11
|
||||
'';
|
||||
license = licenses.${12:$$
|
||||
(yas-choose-value '(
|
||||
"agpl3"
|
||||
"asl20"
|
||||
"bsd1"
|
||||
"bsd2"
|
||||
"bsd3"
|
||||
"free"
|
||||
"gpl2"
|
||||
"gpl2Only"
|
||||
"gpl2Plus"
|
||||
"gpl3"
|
||||
"gpl3Only"
|
||||
"gpl3Plus"
|
||||
"isc"
|
||||
"lgpl21Only"
|
||||
"lgpl21Plus"
|
||||
"lgpl2Only"
|
||||
"lgpl2Plus"
|
||||
"lgpl3"
|
||||
"lgpl3Only"
|
||||
"mit"
|
||||
"mpl20"
|
||||
"ofl"
|
||||
"unfree"
|
||||
))};
|
||||
maintainers = with maintainers; [ $12 ];
|
||||
platforms = platforms.${13:$$
|
||||
(yas-choose-value '(
|
||||
"all"
|
||||
"allBut"
|
||||
"arm"
|
||||
"cygwin"
|
||||
"darwin"
|
||||
"freebsd"
|
||||
"gnu"
|
||||
"i686"
|
||||
"illumos"
|
||||
"linux"
|
||||
"mesaPlatforms"
|
||||
"mips"
|
||||
"netbsd"
|
||||
"none"
|
||||
"openbsd"
|
||||
"unix"
|
||||
"x86"
|
||||
))};
|
||||
};
|
||||
}
|
||||
80
snippets/nix-mode/package_url
Normal file
80
snippets/nix-mode/package_url
Normal file
@@ -0,0 +1,80 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: package url
|
||||
# key: pu
|
||||
# --
|
||||
{ lib
|
||||
, stdenv
|
||||
, fetchurl
|
||||
$1
|
||||
$2
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "$3";
|
||||
version = "$4";
|
||||
|
||||
src = fetchurl {
|
||||
url = "$5";
|
||||
sha256 = "${6:\$\{lib.fakeSha256\}}";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ ${1:$(replace-regexp-in-string " *" " "(subst-char-in-string ?, ? yas-text))} ];
|
||||
buildInputs = [
|
||||
${2:$(replace-regexp-in-string " *" " "(subst-char-in-string ?, ? yas-text))}
|
||||
];
|
||||
|
||||
meta = with lib; {
|
||||
homepage = "https://$7";
|
||||
description = "$8";
|
||||
longDescription = ''
|
||||
$9
|
||||
'';
|
||||
license = licenses.${10:$$
|
||||
(yas-choose-value '(
|
||||
"agpl3"
|
||||
"asl20"
|
||||
"bsd1"
|
||||
"bsd2"
|
||||
"bsd3"
|
||||
"free"
|
||||
"gpl2"
|
||||
"gpl2Only"
|
||||
"gpl2Plus"
|
||||
"gpl3"
|
||||
"gpl3Only"
|
||||
"gpl3Plus"
|
||||
"isc"
|
||||
"lgpl21Only"
|
||||
"lgpl21Plus"
|
||||
"lgpl2Only"
|
||||
"lgpl2Plus"
|
||||
"lgpl3"
|
||||
"lgpl3Only"
|
||||
"mit"
|
||||
"mpl20"
|
||||
"ofl"
|
||||
"unfree"
|
||||
))};
|
||||
maintainers = with maintainers; [ $11 ];
|
||||
platforms = platforms.${12:$$
|
||||
(yas-choose-value '(
|
||||
"all"
|
||||
"allBut"
|
||||
"arm"
|
||||
"cygwin"
|
||||
"darwin"
|
||||
"freebsd"
|
||||
"gnu"
|
||||
"i686"
|
||||
"illumos"
|
||||
"linux"
|
||||
"mesaPlatforms"
|
||||
"mips"
|
||||
"netbsd"
|
||||
"none"
|
||||
"openbsd"
|
||||
"unix"
|
||||
"x86"
|
||||
))};
|
||||
};
|
||||
}
|
||||
10
snippets/nix-mode/patchPhase
Normal file
10
snippets/nix-mode/patchPhase
Normal file
@@ -0,0 +1,10 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: patchPhase
|
||||
# key: pp
|
||||
# --
|
||||
patchPhase = ''
|
||||
runHook prePatch
|
||||
$1
|
||||
runHook postPatch
|
||||
'';
|
||||
$0
|
||||
5
snippets/nix-mode/phases
Normal file
5
snippets/nix-mode/phases
Normal file
@@ -0,0 +1,5 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: phases
|
||||
# key: ph
|
||||
# --
|
||||
phases="${1:\$prePhases unpackPhase patchPhase \$preConfigurePhases configurePhase \$preBuildPhases buildPhase checkPhase \$preInstallPhases installPhase fixupPhase installCheckPhase \$preDistPhases distPhase \$postPhases}";
|
||||
10
snippets/nix-mode/unpackPhase
Normal file
10
snippets/nix-mode/unpackPhase
Normal file
@@ -0,0 +1,10 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: unpackPhase
|
||||
# key: up
|
||||
# --
|
||||
unpackPhase = ''
|
||||
runHook preUnpack
|
||||
$1
|
||||
runHook postUnpack
|
||||
'';
|
||||
$0
|
||||
Reference in New Issue
Block a user