Skip to content

Commit

Permalink
Merge branch 'main' into walk-go
Browse files Browse the repository at this point in the history
  • Loading branch information
kachick committed Aug 16, 2024
2 parents 574350f + f420ca2 commit 9825d78
Show file tree
Hide file tree
Showing 20 changed files with 307 additions and 61 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci-home.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ jobs:
zsh -c 'irb --version'
zsh -c 'alacritty --version'
zsh -c 'ssh -V'
zsh -c 'hx --health'
- name: Run homemade commands
run: |
zsh -c 'la ~; lat ~/.config'
Expand Down
2 changes: 2 additions & 0 deletions Makefile.toml
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ args = [
'backup',
'--flake',
'.#${@}',
'--show-trace',
]

[tasks.apply]
Expand All @@ -112,6 +113,7 @@ args = [
'backup',
'--flake',
'.#${@}',
'--show-trace',
]

[tasks.ci-dev]
Expand Down
3 changes: 3 additions & 0 deletions config/micro/bindings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"Ctrl-t": "command:fzfinder"
}
1 change: 1 addition & 0 deletions config/vscode/extensions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ tekumara.typos-vscode
timonwong.shellcheck
veelenga.crystal-ameba
davidanson.vscode-markdownlint
kachick.blueberry-brackets-dark-theme
5 changes: 5 additions & 0 deletions config/vscode/keybindings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// 既定値を上書きするには、このファイル内にキー バインドを挿入します
[
{ "key": "ctrl+e", "command": "-workbench.action.quickOpen" },
{ "key": "ctrl+q", "command": "-workbench.action.quickOpenView" }
]
28 changes: 4 additions & 24 deletions config/vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,28 +36,6 @@
"[fish]": {
"editor.defaultFormatter": "bmalehorn.vscode-fish"
},
"workbench.colorCustomizations": {
"terminal.background": "#282C34",
"terminal.foreground": "#ABB2BF",
"terminalCursor.background": "#ABB2BF",
"terminalCursor.foreground": "#ABB2BF",
"terminal.ansiBlack": "#282C34",
"terminal.ansiBlue": "#61AFEF",
"terminal.ansiBrightBlack": "#545862",
"terminal.ansiBrightBlue": "#61AFEF",
"terminal.ansiBrightCyan": "#56B6C2",
"terminal.ansiBrightGreen": "#98C379",
"terminal.ansiBrightMagenta": "#C678DD",
"terminal.ansiBrightRed": "#E06C75",
"terminal.ansiBrightWhite": "#C8CCD4",
"terminal.ansiBrightYellow": "#E5C07B",
"terminal.ansiCyan": "#56B6C2",
"terminal.ansiGreen": "#98C379",
"terminal.ansiMagenta": "#C678DD",
"terminal.ansiRed": "#E06C75",
"terminal.ansiWhite": "#ABB2BF",
"terminal.ansiYellow": "#E5C07B"
},
"workbench.editor.enablePreview": false,
"typescript.updateImportsOnFileMove.enabled": "always",
"diffEditor.ignoreTrimWhitespace": true,
Expand Down Expand Up @@ -107,6 +85,7 @@
"javascript.updateImportsOnFileMove.enabled": "always",
"editor.guides.bracketPairs": true,
"editor.bracketPairColorization.enabled": true,
"editor.bracketPairColorization.independentColorPoolPerBracketType": true,
"elmLS.elmReviewDiagnostics": "warning",
"typescript.format.enable": false,
"editor.fontFamily": "'PlemolJP Console NF', '源ノ角ゴシック Code JP', monospace",
Expand All @@ -121,6 +100,7 @@
"editor.tabCompletion": "on",
"files.defaultLanguage": "powershell",
"editor.wordSeparators": "`~!@#%^&*()-=+[{]}\\|;:'\",.<>/?",
"workbench.colorTheme": "Iceberg",
"stylua.searchBinaryInPATH": true
"workbench.colorTheme": "Blueberry Brackets dark theme",
"stylua.searchBinaryInPATH": true,
"editor.cursorSurroundingLines": 5
}
12 changes: 6 additions & 6 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@
nil # Used in vscode Nix extension
nixd # Used in zed Nix extension
nixpkgs-lint-community
nix-init
nurl
# To get sha256 around pkgs.fetchFromGitHub in CLI
nix-prefetch-git
jq
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ go 1.22.5

require (
golang.org/x/exp v0.0.0-20230801115018-d63ba01acd4b
golang.org/x/sys v0.23.0
golang.org/x/sys v0.24.0
)
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
golang.org/x/exp v0.0.0-20230801115018-d63ba01acd4b h1:r+vk0EmXNmekl0S0BascoeeoHk/L7wmaW2QF90K+kYI=
golang.org/x/exp v0.0.0-20230801115018-d63ba01acd4b/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc=
golang.org/x/sys v0.23.0 h1:YfKFowiIMvtgl1UERQoTPPToxltDeZfbj4H7dVUCwmM=
golang.org/x/sys v0.23.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg=
golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
169 changes: 146 additions & 23 deletions home-manager/editor.nix
Original file line number Diff line number Diff line change
@@ -1,27 +1,20 @@
{ pkgs, ... }:

let
nordcolors = pkgs.stdenv.mkDerivation {
name = "micro-nordcolors";
src = pkgs.fetchFromGitHub {
owner = "KiranWells";
repo = "micro-nord-tc-colors";
rev = "f63c855735f755704c25c958abe45f12a4b2c8d3";
sha256 = "sha256-giCansV+9oa2OSQlt7DkLtL7B7sD00JUBaS9YsbJ9aU=";
};
buildPhase = ''
mkdir $out
'';
installPhase = ''
cp -rf ./colorschemes $out/colorschemes
'';
system = builtins.currentSystem;
};
in
{
lib,
pkgs,
homemade-pkgs,
...
}:

{
# For temporal use
xdg.configFile."micro/colorschemes/.keep".text = "";
xdg.configFile."micro/colorschemes/nord-tc.micro".source = "${nordcolors}/colorschemes/nord-tc.micro";
xdg.configFile."micro/colorschemes/nord-16.micro".source = "${nordcolors}/colorschemes/nord-16.micro";

xdg.configFile."micro/plug/fzfinder".source = homemade-pkgs.micro-fzfinder;
xdg.configFile."micro/plug/kdl".source = homemade-pkgs.micro-kdl;
xdg.configFile."micro/plug/nordcolors".source = homemade-pkgs.micro-nordcolors;

# Default keybinfings are https://github.com/zyedidia/micro/blob/master/runtime/help/keybindings.md
xdg.configFile."micro/bindings.json".source = ../config/micro/bindings.json;

# TODO: Consider to extract from nix managed, because of now also using in windows
# https://github.com/nix-community/home-manager/blob/release-24.05/modules/programs/micro.nix
Expand Down Expand Up @@ -67,15 +60,145 @@ in
# Embed candidates are https://github.com/zyedidia/micro/tree/c15abea64c20066fc0b4c328dfabd3e6ba3253a0/runtime/colorschemes
# But none of fit colors with other place, See #587 for further detail
colorscheme = "nord-16";

fzfcmd = lib.getExe pkgs.fzf;
fzfarg = "--preview '${lib.getExe pkgs.bat} --color=always {}'";
fzfopen = "newtab";
};
};

# https://github.com/nix-community/home-manager/blob/release-24.05/modules/programs/helix.nix
# https://docs.helix-editor.com/keymap.html
programs.helix = {
# Enabling this may cause colisions. Do not add in packages list
enable = true;

settings = {
theme = "base16_transparent";

editor = {
soft-wrap = {
enable = true;
};

lsp = {
display-inlay-hints = true;
display-messages = true;
};
};
};

# https://docs.helix-editor.com/lang-support.html
languages = {
language-server = {
typos = {
command = lib.getExe pkgs.typos-lsp;
config.config = "${../typos.toml}";
};
};

language = [
{
# https://github.com/helix-editor/helix/blob/24.03/languages.toml#L1563-L1570
name = "git-commit";
language-servers = [ "typos" ];

# To avoid conflicting with markdown headers. Should be synced with core.commentchar
comment-token = ";";
}
{
name = "bash";
auto-format = true;
formatter = {
command = lib.getExe pkgs.shfmt;
args = [
"--language-dialect"
"bash"
];
};
}
];
};

ignores = [
".git/"
".direnv/"
".node_modules/"
];

extraPackages = with pkgs; [
# https://github.com/helix-editor/helix/blob/24.03/languages.toml#L714
nil

# https://github.com/helix-editor/helix/blob/24.03/languages.toml#L925
nodePackages.bash-language-server

# https://github.com/helix-editor/helix/blob/24.03/languages.toml#L207
rust-analyzer

# https://github.com/helix-editor/helix/blob/24.03/languages.toml#L578
gopls
# https://github.com/helix-editor/helix/blob/24.03/languages.toml#L132-L133
golangci-lint-langserver

# https://github.com/helix-editor/helix/blob/24.03/languages.toml#L1478
marksman

# https://github.com/helix-editor/helix/blob/24.03/languages.toml#L1164
lua-language-server

## Not helpful. Didin't activated?
#
# https://github.com/helix-editor/helix/blob/24.03/languages.toml#L1202
# nodePackages.yaml-language-server

# # https://github.com/helix-editor/helix/blob/24.03/languages.toml#L271
# taplo

## Keep minimum for global use. Inject in each project repositories if you need these

# https://github.com/helix-editor/helix/blob/24.03/languages.toml#L714
# nodePackages.typescript-language-server

# https://github.com/helix-editor/helix/blob/24.03/languages.toml#L1547
# https://github.com/NixOS/nixpkgs/blob/733f5a9806175f86380b14529cb29e953690c148/pkgs/development/tools/language-servers/dockerfile-language-server-nodejs/default.nix#L28
# nodePackages.dockerfile-language-server-nodejs

# https://github.com/helix-editor/helix/blob/24.03/languages.toml#L1651
# nodePackages.graphql-language-service-cli

# https://github.com/helix-editor/helix/blob/24.03/languages.toml#L509
# crystalline

# https://github.com/helix-editor/helix/blob/24.03/languages.toml#L870
# solargraph # Can we prefer steep here?

# # https://github.com/helix-editor/helix/blob/24.03/languages.toml#L1967
# nu-lsp

# # https://github.com/helix-editor/helix/blob/24.03/languages.toml#L1669
# elm-language-server

# https://github.com/helix-editor/helix/blob/24.03/languages.toml#L1217
# haskell-language-server

# https://github.com/helix-editor/helix/blob/24.03/languages.toml#L1260
# zls
];
};

# https://github.com/nix-community/home-manager/blob/release-24.05/modules/programs/vim.nix
# https://nixos.wiki/wiki/Vim
programs.vim = {
# Enabling this may cause colisions. Do not add in packages list
enable = true;
# nix-env -f '<nixpkgs>' -qaP -A vimPlugins
plugins = [ pkgs.vimPlugins.iceberg-vim ];
plugins =
(with pkgs.vimPlugins; [
iceberg-vim
fzf-vim
])
++ [ homemade-pkgs.kdl-vim ];

settings = {
background = "dark";
Expand Down
5 changes: 5 additions & 0 deletions home-manager/firefox.nix
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ lib.mkMerge [

"browser.newtabpage.activity-stream.showSponsoredTopSites" = false; # `Sponsored shortcuts`
"browser.newtabpage.activity-stream.showSponsored" = false;

"browser.quitShortcut.disabled" = true;
"browser.warnOnQuitShortcut" = true; # By default true, just ensuring

"layout.spellcheckDefault" = true;
};
userChrome = builtins.readFile ../config/Firefox/userChrome.css;
};
Expand Down
12 changes: 7 additions & 5 deletions home-manager/git.nix
Original file line number Diff line number Diff line change
Expand Up @@ -68,16 +68,18 @@
};

core = {
# For git commit message 50/72 convention
editor = "micro -colorcolumn 72";
# Helix considers git commit message 50/72 convention by default
# https://github.com/helix-editor/helix/blob/24.03/languages.toml#L1569
editor = lib.getExe pkgs.helix;
quotepath = false;

# To avoid conflicting with markdown headers
commentchar = ";";
};

# Affect in rebase -i
sequence = {
# - For git commit message 50/72 convention
# - Consider prefixed 5 + 1 + 7 + 1 chars as "pick c290ca9 "
editor = "micro -colorcolumn 64";
editor = lib.getExe pkgs.helix;
};

init = {
Expand Down
10 changes: 10 additions & 0 deletions nixos/configuration.nix
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@
[
vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
micro
helix
edge-pkgs.zed-editor # version in nixos-24.05 does not enable IME
lapce # IME is not working on Windows, but stable even around IME on Wayland than vscode

Expand Down Expand Up @@ -282,6 +283,15 @@

programs.nix-ld.enable = false;

# https://github.com/NixOS/nixpkgs/blob/nixos-24.05/nixos/modules/programs/firefox.nix
programs.firefox = {
enable = true;
languagePacks = [
"en-US"
"ja"
];
};

# Prefer NixOS modules rather than home-manager for easy setting up
programs.goldwarden = {
package = edge-pkgs.goldwarden;
Expand Down
1 change: 1 addition & 0 deletions pkgs/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# What are these packages

- Tiny tools by me, they may be rewritten with another language.
- Nix packages that are not yet included in [NixOS/nixpkgs](https://github.com/NixOS/nixpkgs)
- Aliases across multiple shells

## Do not
Expand Down
Loading

0 comments on commit 9825d78

Please sign in to comment.