mirror of
https://github.com/nix-community/home-manager
synced 2024-11-23 11:39:46 +01:00
vscode: add module
This commit is contained in:
parent
ffdbefe22c
commit
6ab6488e5a
3 changed files with 60 additions and 0 deletions
|
@ -871,6 +871,13 @@ in
|
|||
A new module is available: 'services.nextcloud-client'.
|
||||
'';
|
||||
}
|
||||
|
||||
{
|
||||
time = "2018-11-25T22:55:12+00:00";
|
||||
message = ''
|
||||
A new module is available: 'programs.vscode'.
|
||||
'';
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
|
@ -67,6 +67,7 @@ let
|
|||
./programs/tmux.nix
|
||||
./programs/urxvt.nix
|
||||
./programs/vim.nix
|
||||
./programs/vscode.nix
|
||||
./programs/zathura.nix
|
||||
./programs/zsh.nix
|
||||
./services/blueman-applet.nix
|
||||
|
|
52
modules/programs/vscode.nix
Normal file
52
modules/programs/vscode.nix
Normal file
|
@ -0,0 +1,52 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
|
||||
cfg = config.programs.vscode;
|
||||
|
||||
in
|
||||
|
||||
{
|
||||
options = {
|
||||
programs.vscode = {
|
||||
enable = mkEnableOption "Visual Studio Code";
|
||||
|
||||
userSettings = mkOption {
|
||||
type = types.attrs;
|
||||
default = {};
|
||||
example = literalExample ''
|
||||
{
|
||||
"update.channel" = "none";
|
||||
"[nix]"."editor.tabSize" = 2;
|
||||
}
|
||||
'';
|
||||
description = ''
|
||||
Configuration written to
|
||||
<filename>~/.config/Code/User/settings.json</filename>.
|
||||
'';
|
||||
};
|
||||
|
||||
extensions = mkOption {
|
||||
type = types.listOf types.package;
|
||||
default = [];
|
||||
description = ''
|
||||
The extensions Visual Studio Code should be started with.
|
||||
These will override but not delete manually installed ones.
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home.packages = [
|
||||
(pkgs.vscode-with-extensions.override {
|
||||
vscodeExtensions = cfg.extensions;
|
||||
})
|
||||
];
|
||||
|
||||
xdg.configFile."Code/User/settings.json".text =
|
||||
builtins.toJSON cfg.userSettings;
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue