nix-config/modules/nixvim/completion/snippets/nix.lua
Oliver Davies 239fb86c5d
All checks were successful
/ check (push) Successful in 39s
Remove Homepage Dashboard
Signed-off-by: Oliver Davies <oliver@oliverdavies.uk>
2025-11-05 00:02:10 +00:00

78 lines
1.4 KiB
Lua

return {
s("home_packages", fmta("home.packages = with pkgs; [ <> ];", i(0))),
s(
"imports",
fmta(
[[
{
imports = [
<>
];
}
]],
{ i(0) }
)
),
s(
"new_flake",
fmta(
[[
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";<inputs>
};
outputs =
{ nixpkgs, ... }:
let
system = "x86_64-linux";
pkgs = import nixpkgs { inherit system; };
inherit (pkgs) mkShell;
in
{
devShells.${system}.default = mkShell {
packages = with pkgs; [ <pkgs> ];
};<finish>
formatter.${system} = pkgs.nixfmt-classic;
};
}
]],
{ inputs = i(1), pkgs = i(2), finish = i(0) }
)
),
s(
"new_module",
fmta(
[[
{ config, lib, ... }:
let
name = "<name>";
cfg = config.<namespace>.${name};
in
{
options.<namespace>.${name} = {
enable = lib.mkEnableOption "Enable ${name}";<more_options>
};
config = lib.mkIf cfg.enable {
<finish>
};
}
]],
{
finish = i(0),
more_options = i(3),
name = i(1),
namespace = i(2),
},
{ repeat_duplicates = true }
)
),
s("system_packages", fmta("environment.systemPackages = with pkgs; [<>];", i(0))),
}