Skip to content

Commit

Permalink
build(vscode): update code snippets
Browse files Browse the repository at this point in the history
  • Loading branch information
zakuciael committed May 31, 2024
1 parent bf830f0 commit 2bcff31
Showing 1 changed file with 51 additions and 33 deletions.
84 changes: 51 additions & 33 deletions .vscode/nix.json.code-snippets
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,28 @@
"isFileTemplate": true,
"body": [
"{",
"\tpkgs,",
"\tlib,",
"\tconfig,",
"\tinputs,",
"\t...",
" config,",
" lib,",
" pkgs,",
" inputs,",
" ...",
"}:",
"with lib;",
"with lib.my; let",
"\tcfg = config.modules.desktop.${1:example};",
"\tdesktopApps = apps.desktopApps config cfg;",
"in {",
"\toptions.modules.desktop.${1:example} = {",
"\t\tenable = mkEnableOption \"${2}\";",
"\t};",
"with lib.my; desktop.mkDesktopModule {",
" inherit config;",
"",
" name = \"${1:example}\";",
" desktopApps = [${2}];",
"",
"\tconfig = mkIf (cfg.enable) (mkMerge (with desktopApps; [",
"\t\t${0}",
"\t]));",
"}\n"
" extraConfig = {",
" cfg,",
" autostartScript,",
" colorScheme,",
" ...",
" }: {",
" ${0}",
" };",
"}"
]
},
"App Module": {
Expand All @@ -34,15 +37,30 @@
"isFileTemplate": true,
"body": [
"{",
"\tpkgs,",
"\tlib,",
"\tconfig,",
"\tusername,",
"\t...",
" config,",
" lib,",
" pkgs,",
" username,",
" ...",
"}:",
"with lib;",
"with lib.my; {",
"\t${0}",
" ${0}",
"}"
]
},
"Shell Tool": {
"prefix": ["nix-tool", "nixt"],
"description": "Generates a Shell Tool configuration",
"scope": "nix",
"isFileTemplate": true,
"body": [
"{username, ...}: {",
" home-manager.users.\\${username} = {",
" programs.${1:tool-name} = {",
" ${0}",
" };",
" };",
"}"
]
},
Expand All @@ -53,22 +71,22 @@
"isFileTemplate": true,
"body": [
"{",
"\tpkgs,",
"\tlib,",
"\tconfig,",
"\t...",
" config,",
" lib,",
" pkgs,",
" ...",
"}:",
"with lib;",
"with lib.my; let",
"\tcfg = config.modules.${1:type}.${2:example};",
" cfg = config.modules.${1:type}.${2:example};",
"in {",
"\toptions.modules.${1:type}.${2:example} = {",
"\t\tenable = mkEnableOption \"${3}\";${4}",
"\t};",
" options.modules.${1:type}.${2:example} = {",
" enable = mkEnableOption \"${3}\";${4}",
" };",
"",
"\tconfig = mkIf (cfg.enable) {",
"\t\t${0}"
"\t};"
" config = mkIf (cfg.enable) {",
" ${0}",
" };",
"}"
]
}
Expand Down

0 comments on commit 2bcff31

Please sign in to comment.