2024-07-19 12:00:55 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
config,
|
|
|
|
pkgs,
|
|
|
|
...
|
|
|
|
}:
|
2024-07-19 11:59:26 +00:00
|
|
|
|
|
|
|
with lib;
|
|
|
|
let
|
|
|
|
cfg = config.modules.nix;
|
2024-07-19 12:00:55 +00:00
|
|
|
in
|
|
|
|
{
|
2024-07-19 11:59:26 +00:00
|
|
|
options.modules.nix = {
|
|
|
|
enable = mkEnableOption "nix";
|
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
# Development packages
|
|
|
|
home.packages = with pkgs; [
|
|
|
|
nix-tree
|
|
|
|
nixfmt-rfc-style
|
|
|
|
nixd
|
|
|
|
];
|
|
|
|
|
2024-07-20 04:10:56 +00:00
|
|
|
# Add nix tree
|
|
|
|
xdg.desktopEntries.nix-tree = {
|
|
|
|
exec = "${pkgs.nix-tree}/bin/nix-tree";
|
|
|
|
name = "Nix Tree";
|
|
|
|
terminal = true;
|
|
|
|
type = "Application";
|
|
|
|
};
|
|
|
|
|
2024-07-19 11:59:26 +00:00
|
|
|
# VSCode configuration
|
|
|
|
programs.vscode = {
|
2024-07-19 12:00:55 +00:00
|
|
|
extensions = with pkgs.vscode-extensions; [ jnoortheen.nix-ide ];
|
2024-07-19 11:59:26 +00:00
|
|
|
|
|
|
|
userSettings = {
|
|
|
|
"[nix]" = {
|
|
|
|
"editor.tabSize" = 2;
|
|
|
|
};
|
|
|
|
"nix.enableLanguageServer" = true;
|
|
|
|
"nix.serverPath" = "nixd";
|
|
|
|
"nix.serverSettings" = {
|
|
|
|
nixd = {
|
|
|
|
formatting = {
|
|
|
|
command = [ "nixfmt" ];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
# Neovim configuration
|
|
|
|
programs.nixvim = {
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
2024-07-19 12:00:55 +00:00
|
|
|
}
|