Rebase to flake parts #11
This commit is contained in:
@@ -21,6 +21,23 @@
|
||||
pkgs.cursor-cli
|
||||
else
|
||||
null;
|
||||
nixIdeTools = [ pkgs.nixd pkgs.nixfmt ];
|
||||
cursorWithNixIde =
|
||||
if cursorPkg == null then
|
||||
null
|
||||
else
|
||||
pkgs.symlinkJoin {
|
||||
name = "cursor-with-nix-ide";
|
||||
paths = [ cursorPkg ];
|
||||
buildInputs = [ pkgs.makeWrapper ];
|
||||
postBuild = ''
|
||||
for prog in $out/bin/*; do
|
||||
if [ -x "$prog" ]; then
|
||||
wrapProgram "$prog" --prefix PATH : "${lib.makeBinPath nixIdeTools}"
|
||||
fi
|
||||
done
|
||||
'';
|
||||
};
|
||||
in
|
||||
{
|
||||
options.chiasson.home.editors.cursor = {
|
||||
@@ -45,12 +62,28 @@
|
||||
'';
|
||||
};
|
||||
};
|
||||
nixIde = {
|
||||
enable = lib.mkEnableOption ''
|
||||
Nix IDE extension tooling (`nixd` LSP, `nixfmt` formatter).
|
||||
|
||||
Installs `nixd` / `nixfmt` and wraps Cursor so they are on the editor `PATH`
|
||||
(the GUI does not inherit your shell profile).
|
||||
'' // {
|
||||
default = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf (root.enable && cfg.enable && cursorPkg != null) {
|
||||
home.packages =
|
||||
[ cursorPkg ]
|
||||
++ lib.optionals (cfg.agent.enable && cfg.agent.package != null) [ cfg.agent.package ];
|
||||
[
|
||||
(if cfg.nixIde.enable && cursorWithNixIde != null then
|
||||
cursorWithNixIde
|
||||
else
|
||||
cursorPkg)
|
||||
]
|
||||
++ lib.optionals (cfg.agent.enable && cfg.agent.package != null) [ cfg.agent.package ]
|
||||
++ lib.optionals cfg.nixIde.enable nixIdeTools;
|
||||
home.sessionVariables = lib.mkIf cfg.setAsDefaultEditor {
|
||||
EDITOR = "cursor --wait";
|
||||
VISUAL = "cursor --wait";
|
||||
|
||||
Reference in New Issue
Block a user