This commit is contained in:
2024-04-30 07:08:23 +02:00
commit a711247971
2043 changed files with 16874 additions and 0 deletions

View File

@@ -0,0 +1,10 @@
# -*- mode: snippet -*-
# name: buildPhase
# key: bp
# --
buildPhase= ''
runHook preBuild
$1
runHook postBuild
'';
$0

View File

@@ -0,0 +1,6 @@
# -*- mode: snippet -*-
# name: callPackage
# key: ca
# --
$1 = callPackage ../$2/$1 { };
$0

View File

@@ -0,0 +1,10 @@
# -*- mode: snippet -*-
# name: checkPhase
# key: ch
# --
checkPhase= ''
runHook preCheck
$1
runHook postCheck
'';
$0

View File

@@ -0,0 +1,10 @@
# -*- mode: snippet -*-
# name: configurePhase
# key: cp
# --
configurePhase= ''
runHook preConfigure
$1
runHook postConfigure
'';
$0

View File

@@ -0,0 +1,10 @@
# -*- mode: snippet -*-
# name: distPhase
# key: dp
# --
distPhase= ''
runHook preDist
$1
runHook postDist
'';
$0

View File

@@ -0,0 +1,10 @@
# -*- mode: snippet -*-
# name: fixPhase
# key: fp
# --
fixupPhase= ''
runHook preFixup
$1
runHook postFixup
'';
$0

View File

@@ -0,0 +1,10 @@
# -*- mode: snippet -*-
# name: installCheckPhase
# key: ic
# --
installCheckPhase= ''
runHook preInstallCheck
$1
runHook postInstallCheck
'';
$0

View 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

View 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"
))};
};
}

View 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"
))};
};
}

View 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
View 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}";

View File

@@ -0,0 +1,10 @@
# -*- mode: snippet -*-
# name: unpackPhase
# key: up
# --
unpackPhase = ''
runHook preUnpack
$1
runHook postUnpack
'';
$0