more vscode

This commit is contained in:
Lucy Hochkamp 2023-10-11 17:10:04 +02:00
parent 95128333e3
commit 360acefef9
No known key found for this signature in database
3 changed files with 190 additions and 3 deletions

90
flake.lock generated
View file

@ -118,6 +118,22 @@
"type": "github"
}
},
"flake-compat_2": {
"flake": false,
"locked": {
"lastModified": 1673956053,
"narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-parts": {
"inputs": {
"nixpkgs-lib": [
@ -215,6 +231,24 @@
"type": "github"
}
},
"flake-utils_3": {
"inputs": {
"systems": "systems_3"
},
"locked": {
"lastModified": 1681202837,
"narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "cfacdce06f30d2b68473a46042957675eebb3401",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"haskell-flake": {
"locked": {
"lastModified": 1684780604,
@ -433,6 +467,26 @@
"type": "github"
}
},
"nix-vscode-extensions": {
"inputs": {
"flake-compat": "flake-compat_2",
"flake-utils": "flake-utils_3",
"nixpkgs": "nixpkgs_3"
},
"locked": {
"lastModified": 1696987176,
"narHash": "sha256-JdfrQAZD4LVQSQ1UV4d6O+8582aJxcenTTR2QW1mwUw=",
"owner": "nix-community",
"repo": "nix-vscode-extensions",
"rev": "be62771c733f226651149c8a07c40c7c52c5ff5a",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nix-vscode-extensions",
"type": "github"
}
},
"nixos-hardware": {
"locked": {
"lastModified": 1696161939,
@ -532,6 +586,22 @@
}
},
"nixpkgs_3": {
"locked": {
"lastModified": 1684570954,
"narHash": "sha256-FX5y4Sm87RWwfu9PI71XFvuRpZLowh00FQpIJ1WfXqE=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "3005f20ce0aaa58169cdee57c8aa12e5f1b6e1b3",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_4": {
"locked": {
"lastModified": 1696323343,
"narHash": "sha256-u7WLUrh5eb+6SBYwtkaGL2ryHpLcHzmLml+a+VqKJWE=",
@ -698,8 +768,9 @@
"lolpizza": "lolpizza",
"miro": "miro",
"neovim-nightly-overlay": "neovim-nightly-overlay",
"nix-vscode-extensions": "nix-vscode-extensions",
"nixos-hardware": "nixos-hardware",
"nixpkgs": "nixpkgs_3",
"nixpkgs": "nixpkgs_4",
"nixpkgs-darwin": "nixpkgs-darwin",
"nixpkgs-master": "nixpkgs-master",
"nnn-nvim": "nnn-nvim",
@ -779,6 +850,21 @@
"type": "github"
}
},
"systems_4": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"utils": {
"locked": {
"lastModified": 1656928814,
@ -796,7 +882,7 @@
},
"utils_2": {
"inputs": {
"systems": "systems_3"
"systems": "systems_4"
},
"locked": {
"lastModified": 1694529238,

View file

@ -23,6 +23,7 @@
neovim-nightly-overlay.inputs.neovim-flake.url = "github:neovim/neovim?dir=contrib&rev=eb151a9730f0000ff46e0b3467e29bb9f02ae362";
neovim-nightly-overlay.inputs.neovim-flake.inputs.nixpkgs.follows = "nixpkgs-master";
# programs
xynoblog.url = "github:thexyno/blog";
xynoblog.inputs.nixpkgs.follows = "nixpkgs";
@ -43,6 +44,9 @@
noice-nvim.url = "github:folke/noice.nvim";
noice-nvim.flake = false;
## vscode
nix-vscode-extensions.url = "github:nix-community/nix-vscode-extensions";
## zsh
zsh-completions.url = "github:zsh-users/zsh-completions";
zsh-completions.flake = false;

View file

@ -1,17 +1,114 @@
{ pkgs, config, lib, ... }:
{ pkgs, config, lib, inputs, ... }:
let
cfg = config.ragon.vscode;
exts = inputs.nix-vscode-extensions.extensions.${pkgs.system};
in
{
options.ragon.vscode.enable = lib.mkOption { default = false; };
config = lib.mkIf cfg.enable {
home.packages = with pkgs; [
nil
nixpkgs-fmt
];
programs.vscode = {
enable = true;
extensions = with pkgs.vscode-extensions; [
vscodevim.vim # vim mode (hopefully good)
yzhang.markdown-all-in-one # markdown
jdinhlife.gruvbox # theme
mkhl.direnv # direnv
# Language Support
jnoortheen.nix-ide # nix
golang.go # go
ms-pyright.pyright # python
ms-dotnettools.csharp # c# und so
rust-lang.rust-analyzer # rust
] ++ pkgs.vscode-utils.extensionsFromVscodeMarketplace [
{
# swift lsp (official apple somehow)
name = "swift-lang";
publisher = "sswg";
version = "1.6.1";
sha256 = "sha256-4/Hb8hgQb8osVqjH6qZgaPC0XcY1YaIxcobhHLGGuxQ=";
}
];
userSettings =
let
fontFamily = "'JetBrainsMono Nerd Font', monospace";
in
{
"editor.fontFamily" = fontFamily;
"terminal.integrated.fontFamily" = fontFamily;
"workbench.colorTheme" = "Gruvbox Dark Soft";
"editor.autoClosingBrackets" = "never";
"editor.autoClosingQuotes" = "never";
"editor.minimap.autohide" = true;
# Addon Configuration
## Vim
"vim.leader" = "<space>";
"vim.normalModeKeyBindings" = [
{ before = [ "<C-h>" ]; after = [ "<C-w>" "h" ]; }
{ before = [ "<C-j>" ]; after = [ "<C-w>" "j" ]; }
{ before = [ "<C-k>" ]; after = [ "<C-w>" "k" ]; }
{ before = [ "<C-l>" ]; after = [ "<C-w>" "l" ]; }
];
"vim.normalModeKeyBindingsNonRecursive" = [
{
before = [ "<leader>" "s" ];
"commands" = [ "workbench.action.splitEditor" ];
quiet = true;
}
{
before = [ "<leader>" "a" "s" ];
"commands" = [ "workbench.action.splitEditorDown" ];
quiet = true;
}
{
before = [ "<leader>" "q" ];
"commands" = [ "workbench.action.closeActiveEditor" ];
quiet = true;
}
{
before = [ "<leader>" "f" ];
"commands" = [ "editor.action.formatDocument" ];
quiet = true;
}
{
before = [ "]" "g" ];
"commands" = [ "editor.action.marker.next" ];
quiet = true;
}
{
before = [ "[" "g" ];
"commands" = [ "editor.action.marker.prev" ];
quiet = true;
}
{
before = [ "<Tab>" ];
"commands" = [ "workbench.view.explorer" ];
quiet = true;
}
{
before = [ "<S-Tab>" ];
"commands" = [ "workbench.action.closeSidebar" ];
quiet = true;
}
{
before = [ "<leader>" "t" ];
"commands" = [ "terminal.focus" ];
quiet = true;
}
];
## Nix
"nix.serverPath" = "nil";
"nix.enableLanguageServer" = true;
};
};
};
}