diff --git a/nix/configuration/hosts/odo/default.nix b/nix/configuration/hosts/odo/default.nix index 18ede30..87ba9cc 100644 --- a/nix/configuration/hosts/odo/default.nix +++ b/nix/configuration/hosts/odo/default.nix @@ -54,4 +54,5 @@ me.sway.enable = true; me.terraform.enable = true; me.vnc_client.enable = true; + me.vscode.enable = true; } diff --git a/nix/configuration/roles/vscode/default.nix b/nix/configuration/roles/vscode/default.nix index a00bbbe..2ee79bc 100644 --- a/nix/configuration/roles/vscode/default.nix +++ b/nix/configuration/roles/vscode/default.nix @@ -8,42 +8,55 @@ { imports = [ ]; - config = lib.mkIf config.me.graphical { - allowedUnfree = [ - "vscode" - "vscode-with-extensions" - "vscode-extension-ms-vscode-remote-remote-ssh" - ]; - - environment.systemPackages = with pkgs; [ - (vscode-with-extensions.override { - vscodeExtensions = with vscode-extensions; [ - bbenoist.nix - ms-python.python - ms-azuretools.vscode-docker - ms-vscode-remote.remote-ssh - ] - # ++ pkgs.vscode-utils.extensionsFromVscodeMarketplace [ - # { - # name = "remote-ssh-edit"; - # publisher = "ms-vscode-remote"; - # version = "0.47.2"; - # sha256 = "1hp6gjh4xp2m1xlm1jsdzxw9d8frkiidhph6nvl24d0h8z34w49g"; - # } - # ] - ; - }) - ]; - - home-manager.users.talexander = - { pkgs, ... }: - { - home.file.".config/Code/User/settings.json" = { - source = ./files/settings.json; - }; - home.file.".config/Code/User/keybindings.json" = { - source = ./files/keybindings.json; - }; - }; + options.me = { + vscode.enable = lib.mkOption { + type = lib.types.bool; + default = false; + example = true; + description = "Whether we want to install vscode."; + }; }; + + config = lib.mkIf config.me.vscode.enable ( + lib.mkMerge [ + (lib.mkIf config.me.graphical { + allowedUnfree = [ + "vscode" + "vscode-with-extensions" + "vscode-extension-ms-vscode-remote-remote-ssh" + ]; + + environment.systemPackages = with pkgs; [ + (vscode-with-extensions.override { + vscodeExtensions = with vscode-extensions; [ + bbenoist.nix + ms-python.python + ms-azuretools.vscode-docker + ms-vscode-remote.remote-ssh + ] + # ++ pkgs.vscode-utils.extensionsFromVscodeMarketplace [ + # { + # name = "remote-ssh-edit"; + # publisher = "ms-vscode-remote"; + # version = "0.47.2"; + # sha256 = "1hp6gjh4xp2m1xlm1jsdzxw9d8frkiidhph6nvl24d0h8z34w49g"; + # } + # ] + ; + }) + ]; + + home-manager.users.talexander = + { pkgs, ... }: + { + home.file.".config/Code/User/settings.json" = { + source = ./files/settings.json; + }; + home.file.".config/Code/User/keybindings.json" = { + source = ./files/keybindings.json; + }; + }; + }) + ] + ); }