feat(code)!: improve interface
This commit is contained in:
parent
a6e8356cb5
commit
d2111cc645
1 changed files with 51 additions and 15 deletions
|
@ -9,21 +9,57 @@ let
|
||||||
cfg = config.my.programs.code;
|
cfg = config.my.programs.code;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.my.programs.code.enable = mkEnableOption "code";
|
options.my.programs.code = {
|
||||||
|
enable = mkEnableOption "code";
|
||||||
config = mkIf cfg.enable {
|
package = mkOption {
|
||||||
home-manager.users.moritz = {
|
type = types.package;
|
||||||
programs.vscode = {
|
default = pkgs.vscode;
|
||||||
enable = true;
|
};
|
||||||
package = pkgs.vscode-fhsWithPackages (ps: with ps; [ git ]);
|
extensions = mkOption {
|
||||||
extensions = with pkgs.vscode-extensions; [
|
type = types.listOf types.package;
|
||||||
bbenoist.nix
|
default = with pkgs.vscode-extensions; [
|
||||||
dracula-theme.theme-dracula
|
bbenoist.nix
|
||||||
esbenp.prettier-vscode
|
vscodevim.vim
|
||||||
pkief.material-icon-theme
|
] ++ pkgs.vscode-utils.extensionsFromVscodeMarketplace [
|
||||||
vscodevim.vim
|
{
|
||||||
];
|
name = "copilot-nightly";
|
||||||
};
|
publisher = "GitHub";
|
||||||
|
version = "1.86.118";
|
||||||
|
sha256 = "04nspnmd5cfnv3m9igww6h6la6pvhdqzqmdnbm1znapxqiw2m927";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
name = "copilot-chat";
|
||||||
|
publisher = "GitHub";
|
||||||
|
version = "0.1.2023052602";
|
||||||
|
sha256 = "0anlzzs4g7c9mmw7yxy5bgjcs0niwa3bswgvhwspf5fh8bbq5n44";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
wayland = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
environment.systemPackages =
|
||||||
|
let
|
||||||
|
withExtensions = pkgs.vscode-with-extensions.override {
|
||||||
|
vscode = cfg.package;
|
||||||
|
vscodeExtensions = cfg.extensions;
|
||||||
|
};
|
||||||
|
maybeExtensions = if cfg.extensions == [ ] then cfg.package else withExtensions;
|
||||||
|
withWayland = pkgs.symlinkJoin {
|
||||||
|
name = "${maybeExtensions.name}-wayland";
|
||||||
|
paths = [ maybeExtensions ];
|
||||||
|
nativeBuildInputs = [ pkgs.makeWrapper ];
|
||||||
|
postBuild = ''
|
||||||
|
wrapProgram $out/bin/code* \
|
||||||
|
--set NIXOS_OZONE_WL 1
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
final = if cfg.wayland then withWayland else maybeExtensions;
|
||||||
|
in
|
||||||
|
[ final ];
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue