Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 80 additions & 0 deletions snippets/nix.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,86 @@
],
"description": "Nixpkgs' stdenv.mkDerivation template"
},
"pkgs.mkShell": {
"prefix": "mks",
"body": [
"pkgs.mkShell {",
" packages = [",
" $1",
" ];",
"",
" env = {",
" $2",
" };",
"",
" shellHook = ''",
" $3",
" '';",
"}"
],
"description": "mkShell template"
},
"flake-parts": {
"prefix": "flakeparts",
"body": [
"{",
" description = \"${1:A flake}\";",
"",
" inputs = {",
" nixpkgs.url = \"github:NixOS/nixpkgs/nixos-unstable\";",
" flake-parts.url = \"github:hercules-ci/flake-parts\";",
" systems.url = \"github:nix-systems/default\";",
" };",
"",
" outputs =",
" inputs@{ flake-parts, systems, ... }:",
" flake-parts.lib.mkFlake { inherit inputs; } {",
" imports = [",
" $2",
" ];",
" systems = import systems;",
" perSystem =",
" {",
" config,",
" pkgs,",
" system,",
" ...",
" }:",
" {",
" $3",
" };",
" flake = {",
" $4",
" };",
" };",
"}"
],
"description": "simple flake template with flake-parts"
},
"flake-utils": {
"prefix": "flakeutils",
"body": [
"{",
" description = \"${1:A flake}\";",
"",
" inputs = {",
" nixpkgs.url = \"github:NixOS/nixpkgs/nixos-unstable\";",
" systems.url = \"github:nix-systems/default\";",
" flake-utils = {",
" url = \"github:numtide/flake-utils\";",
" inputs.systems.follows = \"systems\";",
" };",
" $2",
" };",
"",
" outputs = inputs @ { self, nixpkgs, flake-utils, ... }: ",
" flake-utils.lib.eachDefaultSystem (system: {",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please spit the systems up and recommend nix-systems to be used here.

" $3",
" });",
"}"
],
"description": "simple flake template with flake-utils"
},
"meta": {
"prefix": "meta",
"body": [
Expand Down