diff --git a/home-manager/modules/vscode.nix b/home-manager/modules/vscode.nix index 47205dc..c2dab9d 100644 --- a/home-manager/modules/vscode.nix +++ b/home-manager/modules/vscode.nix @@ -46,6 +46,26 @@ # Nix "nix.enableLanguageServer" = true; "nix.serverPath" = "nixd"; + "nix.serverSettings" = { + nixd = { + formatting = { + command = [ "nixfmt" ]; + }; + + nixpkgs = { + expr = ''import (builtins.getFlake "/etc/nixos").inputs.nixpkgs { }''; + }; + + options = { + nixos = { + expr = ''(builtins.getFlake "/etc/nixos").nixosConfigurations.ty-nixos.options''; + }; + home-manager = { + expr = ''(builtins.getFlake "/etc/nixos").homeConfigurations."ty".options''; + }; + }; + }; + }; }; }; } \ No newline at end of file diff --git a/hosts/laptop/default.nix b/hosts/laptop/default.nix index 257f0a4..7be3629 100644 --- a/hosts/laptop/default.nix +++ b/hosts/laptop/default.nix @@ -1,4 +1,4 @@ -{ ... }: +{ inputs, ... }: { imports = [ ./hardware-configuration.nix @@ -8,4 +8,5 @@ system.stateVersion = "24.05"; nix.settings.experimental-features = [ "nix-command" "flakes" ]; + nix.nixPath = [ "nixpkgs=${inputs.nixpkgs}" ]; } \ No newline at end of file