vscode stuff and try to make treefmt not suck
This commit is contained in:
parent
8c921fc1ab
commit
b5d3358f52
4 changed files with 70 additions and 9 deletions
|
@ -3,6 +3,7 @@ on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
push:
|
push:
|
||||||
pull_request:
|
pull_request:
|
||||||
|
|
||||||
env:
|
env:
|
||||||
ATTIC_TOKEN: ${{ secrets.ATTIC_TOKEN }}
|
ATTIC_TOKEN: ${{ secrets.ATTIC_TOKEN }}
|
||||||
NIX_CONFIG: |
|
NIX_CONFIG: |
|
||||||
|
@ -13,6 +14,7 @@ env:
|
||||||
accept-flake-config = true
|
accept-flake-config = true
|
||||||
system-features = nixos-test benchmark big-parallel kvm
|
system-features = nixos-test benchmark big-parallel kvm
|
||||||
TERM: ansi
|
TERM: ansi
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-machines:
|
build-machines:
|
||||||
strategy:
|
strategy:
|
||||||
|
@ -36,16 +38,20 @@ jobs:
|
||||||
remove-codeql: 'true'
|
remove-codeql: 'true'
|
||||||
remove-docker-images: 'true'
|
remove-docker-images: 'true'
|
||||||
build-mount-path: /nix
|
build-mount-path: /nix
|
||||||
|
|
||||||
- name: Install Nix
|
- name: Install Nix
|
||||||
uses: cachix/install-nix-action@v30
|
uses: cachix/install-nix-action@v30
|
||||||
|
|
||||||
- name: Sync repository
|
- name: Sync repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
persist-credentials: false
|
persist-credentials: false
|
||||||
|
|
||||||
- name: setup attic
|
- name: setup attic
|
||||||
run: |
|
run: |
|
||||||
nix profile install github:zhaofengli/attic
|
nix profile install github:zhaofengli/attic
|
||||||
attic login cy7 https://cache.cy7.sh "$ATTIC_TOKEN"
|
attic login cy7 https://cache.cy7.sh "$ATTIC_TOKEN"
|
||||||
|
|
||||||
- name: build
|
- name: build
|
||||||
run: |
|
run: |
|
||||||
package=".#nixosConfigurations."${{ matrix.machine }}".config.system.build.toplevel"
|
package=".#nixosConfigurations."${{ matrix.machine }}".config.system.build.toplevel"
|
||||||
|
|
|
@ -134,7 +134,6 @@
|
||||||
imports = [
|
imports = [
|
||||||
inputs.treefmt.flakeModule
|
inputs.treefmt.flakeModule
|
||||||
];
|
];
|
||||||
debug = true;
|
|
||||||
systems = [
|
systems = [
|
||||||
"x86_64-linux"
|
"x86_64-linux"
|
||||||
];
|
];
|
||||||
|
@ -147,11 +146,14 @@
|
||||||
treefmt = {
|
treefmt = {
|
||||||
projectRootFile = "flake.nix";
|
projectRootFile = "flake.nix";
|
||||||
programs.nixfmt.enable = true;
|
programs.nixfmt.enable = true;
|
||||||
programs.stylua.enable = true;
|
|
||||||
programs.yamlfmt.enable = true;
|
|
||||||
programs.typos.enable = true;
|
programs.typos.enable = true;
|
||||||
programs.shellcheck.enable = true;
|
programs.shellcheck.enable = true;
|
||||||
|
|
||||||
|
programs.yamlfmt = {
|
||||||
|
enable = true;
|
||||||
|
settings.retain_line_breaks = true;
|
||||||
|
};
|
||||||
|
|
||||||
settings.global.excludes = [
|
settings.global.excludes = [
|
||||||
"secrets/*"
|
"secrets/*"
|
||||||
"**/*.png" # tries to format a png file
|
"**/*.png" # tries to format a png file
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{ pkgs, ... }:
|
{ pkgs, lib, ... }:
|
||||||
{
|
{
|
||||||
programs.vscode = {
|
programs.vscode = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
@ -23,10 +23,12 @@
|
||||||
tamasfe.even-better-toml
|
tamasfe.even-better-toml
|
||||||
golang.go
|
golang.go
|
||||||
ms-python.python
|
ms-python.python
|
||||||
|
christian-kohler.path-intellisense
|
||||||
];
|
];
|
||||||
userSettings =
|
userSettings =
|
||||||
let
|
let
|
||||||
vimCommonKeyBindings = [
|
vimCommonKeyBindings = [
|
||||||
|
# nice emacs bindings
|
||||||
{
|
{
|
||||||
"before" = [ "C-a" ];
|
"before" = [ "C-a" ];
|
||||||
"commands" = [ "cursorHome" ];
|
"commands" = [ "cursorHome" ];
|
||||||
|
@ -35,6 +37,19 @@
|
||||||
"before" = [ "C-e" ];
|
"before" = [ "C-e" ];
|
||||||
"commands" = [ "cursorEnd" ];
|
"commands" = [ "cursorEnd" ];
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
"before" = [ "C-b" ];
|
||||||
|
"commands" = [ "cursorLeft" ];
|
||||||
|
}
|
||||||
|
{
|
||||||
|
"before" = [ "C-f" ];
|
||||||
|
"commands" = [ "cursorRight" ];
|
||||||
|
}
|
||||||
|
# ctrl+h to turn off search highlighting
|
||||||
|
{
|
||||||
|
"before" = [ "C-h" ];
|
||||||
|
"commands" = [ ":nohl" ];
|
||||||
|
}
|
||||||
];
|
];
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
@ -74,7 +89,7 @@
|
||||||
|
|
||||||
"markdown-preview-enhanced.previewTheme" = "github-dark.css";
|
"markdown-preview-enhanced.previewTheme" = "github-dark.css";
|
||||||
"nix.enableLanguageServer" = true;
|
"nix.enableLanguageServer" = true;
|
||||||
"nix.serverPath" = "nil";
|
"nix.serverPath" = "${lib.getExe pkgs.nil}";
|
||||||
"bookmarks.saveBookmarksInProject" = true;
|
"bookmarks.saveBookmarksInProject" = true;
|
||||||
|
|
||||||
"cSpell.enabledFileTypes" = {
|
"cSpell.enabledFileTypes" = {
|
||||||
|
@ -84,6 +99,15 @@
|
||||||
|
|
||||||
# vim stuff
|
# vim stuff
|
||||||
"vim.leader" = ",";
|
"vim.leader" = ",";
|
||||||
|
"extensions.experimental.affinity" = {
|
||||||
|
"vscodevim.vim" = 1;
|
||||||
|
};
|
||||||
|
"vim.sneak" = true;
|
||||||
|
"vim.sneakUseIgnorecaseAndSmartcase" = true;
|
||||||
|
"vim.enableNeovim" = true;
|
||||||
|
"vim.hlsearch" = true;
|
||||||
|
"vim.easymotion" = true;
|
||||||
|
"editor.lineNumbers" = "relative";
|
||||||
"vim.normalModeKeyBindings" = vimCommonKeyBindings ++ [
|
"vim.normalModeKeyBindings" = vimCommonKeyBindings ++ [
|
||||||
{
|
{
|
||||||
"before" = [ ";" ];
|
"before" = [ ";" ];
|
||||||
|
@ -118,6 +142,13 @@
|
||||||
];
|
];
|
||||||
"commands" = [ "workbench.action.toggleSidebarVisibility" ];
|
"commands" = [ "workbench.action.toggleSidebarVisibility" ];
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
"before" = [
|
||||||
|
"<space>"
|
||||||
|
"s"
|
||||||
|
];
|
||||||
|
"commands" = [ "workbench.action.toggleSidebarVisibility" ];
|
||||||
|
}
|
||||||
{
|
{
|
||||||
"before" = [
|
"before" = [
|
||||||
"<leader>"
|
"<leader>"
|
||||||
|
@ -191,10 +222,33 @@
|
||||||
"commands" = [ "editor.action.outdentLines" ];
|
"commands" = [ "editor.action.outdentLines" ];
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
"extensions.experimental.affinity" = {
|
|
||||||
"vscodevim.vim" = 1;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
keybindings = [
|
||||||
|
# repeat these vim bindings here cause otherwise they get overridden by vscode
|
||||||
|
{
|
||||||
|
"key" = "ctrl+b";
|
||||||
|
"when" = "inputFocus";
|
||||||
|
"command" = "cursorLeft";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
"key" = "ctrl+f";
|
||||||
|
"when" = "inputFocus";
|
||||||
|
"command" = "cursorRight";
|
||||||
|
}
|
||||||
|
# clear default bindings that conflict
|
||||||
|
{
|
||||||
|
"key" = "ctrl+f";
|
||||||
|
"command" = "-actions.find";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
"key" = "ctrl+b";
|
||||||
|
"command" = "-workbench.action.toggleSidebarVisibility";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
"key" = "ctrl+w";
|
||||||
|
"command" = "-workbench.action.closeActiveEditor";
|
||||||
|
}
|
||||||
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -76,7 +76,6 @@
|
||||||
))
|
))
|
||||||
p7zip
|
p7zip
|
||||||
qbittorrent
|
qbittorrent
|
||||||
nil
|
|
||||||
android-tools
|
android-tools
|
||||||
frida-tools
|
frida-tools
|
||||||
mitmproxy
|
mitmproxy
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue