mirror of
https://github.com/nmasur/dotfiles
synced 2025-07-07 10:10:14 +00:00
Compare commits
27 Commits
neovim-lua
...
e011a1c6f1
Author | SHA1 | Date | |
---|---|---|---|
e011a1c6f1 | |||
1d8638777c | |||
2620b43925 | |||
7d53a80d49 | |||
9b12369e43 | |||
427bd1a421 | |||
74e346fa63 | |||
4a803427fb | |||
d127ccacb0 | |||
54e89d3acd | |||
b258a40181 | |||
dfacb580ae | |||
650d1e91a2 | |||
397b08fab4 | |||
33e8a6bc9b | |||
7a39acef1a | |||
3438446347 | |||
dee7c7302a | |||
0d052a6463 | |||
8b98b8f29d | |||
96c64c4da1 | |||
47a1823af4 | |||
d86534727e | |||
13e5b9ddc5 | |||
bb200016cb | |||
dc00ef26b5 | |||
cf62184744 |
24
README.md
24
README.md
@ -6,12 +6,28 @@ configuration may be difficult to translate to a non-Nix system.
|
|||||||
|
|
||||||
However, some of the configurations are easier to lift directly:
|
However, some of the configurations are easier to lift directly:
|
||||||
|
|
||||||
- [Neovim](https://github.com/nmasur/dotfiles/tree/master/modules/neovim/lua)
|
- [Neovim](https://github.com/nmasur/dotfiles/tree/master/modules/neovim/config)
|
||||||
- [Fish functions](https://github.com/nmasur/dotfiles/tree/master/modules/shell/fish/functions)
|
- [Fish functions](https://github.com/nmasur/dotfiles/tree/master/modules/shell/fish/functions)
|
||||||
- [More fish aliases](https://github.com/nmasur/dotfiles/blob/master/modules/shell/fish/default.nix)
|
- [More fish aliases](https://github.com/nmasur/dotfiles/blob/master/modules/shell/fish/default.nix)
|
||||||
- [Git aliases](https://github.com/nmasur/dotfiles/blob/master/modules/shell/git.nix)
|
- [Git aliases](https://github.com/nmasur/dotfiles/blob/master/modules/shell/git.nix)
|
||||||
- [Hammerspoon](https://github.com/nmasur/dotfiles/tree/master/modules/darwin/hammerspoon)
|
- [Hammerspoon](https://github.com/nmasur/dotfiles/tree/master/modules/darwin/hammerspoon)
|
||||||
|
|
||||||
|
Try out my Neovim config:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
nix run github:nmasur/dotfiles#neovim
|
||||||
|
```
|
||||||
|
|
||||||
|
Or build it as a package:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
nix build github:nmasur/dotfiles#neovim
|
||||||
|
```
|
||||||
|
|
||||||
|
If you already have a Neovim configuration, you may need to move it out of
|
||||||
|
`~/.config/nvim` or set `XDG_CONFIG_HOME` to another value; otherwise, both
|
||||||
|
configs might conflict with each other.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
# Installation
|
# Installation
|
||||||
@ -87,12 +103,6 @@ openssl s_client -showcerts -verify 5 -connect cache.nixos.org:443 < /dev/null
|
|||||||
sudo nvim $NIX_SSL_CERT_FILE
|
sudo nvim $NIX_SSL_CERT_FILE
|
||||||
```
|
```
|
||||||
|
|
||||||
### Dealing with Neovim issues:
|
|
||||||
|
|
||||||
Update Neovim Packer plugins: `:PackerSync`
|
|
||||||
|
|
||||||
Update TreeSitter languages: `:TSUpdateSync`
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
# Flake Templates
|
# Flake Templates
|
||||||
|
@ -1,6 +1,25 @@
|
|||||||
{ pkgs, ... }: rec {
|
{ pkgs, ... }: rec {
|
||||||
|
|
||||||
default = readme;
|
default = {
|
||||||
|
type = "app";
|
||||||
|
program = builtins.toString (pkgs.writeShellScript "default" ''
|
||||||
|
${pkgs.gum}/bin/gum style --margin "1 2" --padding "0 2" --foreground "15" --background "55" "Options"
|
||||||
|
${pkgs.gum}/bin/gum format --type=template -- ' {{ Italic "Run with" }} {{ Color "15" "69" " nix run github:nmasur/dotfiles#" }}{{ Color "15" "62" "someoption" }}{{ Color "15" "69" " " }}.'
|
||||||
|
echo ""
|
||||||
|
echo ""
|
||||||
|
${pkgs.gum}/bin/gum format --type=template -- \
|
||||||
|
' • {{ Color "15" "57" " readme " }} {{ Italic "Documentation for this repository." }}' \
|
||||||
|
' • {{ Color "15" "57" " rebuild " }} {{ Italic "Switch to this configuration." }}' \
|
||||||
|
' • {{ Color "15" "57" " installer " }} {{ Italic "Format and install from nothing." }}' \
|
||||||
|
' • {{ Color "15" "57" " neovim " }} {{ Italic "Test out the Neovim package." }}' \
|
||||||
|
' • {{ Color "15" "57" " loadkey " }} {{ Italic "Load an ssh key for this machine using melt." }}' \
|
||||||
|
' • {{ Color "15" "57" " encrypt-secret " }} {{ Italic "Encrypt a secret for all machines." }}' \
|
||||||
|
' • {{ Color "15" "57" " reencrypt-secrets " }} {{ Italic "Reencrypt all secrets when new machine is added." }}' \
|
||||||
|
' • {{ Color "15" "57" " netdata " }} {{ Italic "Connect a machine to Netdata cloud." }}'
|
||||||
|
echo ""
|
||||||
|
echo ""
|
||||||
|
'');
|
||||||
|
};
|
||||||
|
|
||||||
# Format and install from nothing
|
# Format and install from nothing
|
||||||
installer = import ./installer.nix { inherit pkgs; };
|
installer = import ./installer.nix { inherit pkgs; };
|
||||||
@ -8,6 +27,20 @@
|
|||||||
# Display the readme for this repository
|
# Display the readme for this repository
|
||||||
readme = import ./readme.nix { inherit pkgs; };
|
readme = import ./readme.nix { inherit pkgs; };
|
||||||
|
|
||||||
|
# Rebuild
|
||||||
|
rebuild = {
|
||||||
|
type = "app";
|
||||||
|
program = builtins.toString (pkgs.writeShellScript "rebuild" ''
|
||||||
|
echo ${pkgs.system}
|
||||||
|
SYSTEM=${if pkgs.stdenv.isDarwin then "darwin" else "linux"}
|
||||||
|
if [ "$SYSTEM" == "darwin" ]; then
|
||||||
|
darwin-rebuild switch --flake github:nmasur/dotfiles#macbook
|
||||||
|
else
|
||||||
|
nixos-rebuild switch --flake github:nmasur/dotfiles
|
||||||
|
fi
|
||||||
|
'');
|
||||||
|
};
|
||||||
|
|
||||||
# Load the SSH key for this machine
|
# Load the SSH key for this machine
|
||||||
loadkey = import ./loadkey.nix { inherit pkgs; };
|
loadkey = import ./loadkey.nix { inherit pkgs; };
|
||||||
|
|
||||||
@ -20,4 +53,19 @@
|
|||||||
# Connect machine metrics to Netdata Cloud
|
# Connect machine metrics to Netdata Cloud
|
||||||
netdata = import ./netdata-cloud.nix { inherit pkgs; };
|
netdata = import ./netdata-cloud.nix { inherit pkgs; };
|
||||||
|
|
||||||
|
# Run neovim as an app
|
||||||
|
neovim = {
|
||||||
|
type = "app";
|
||||||
|
program = "${
|
||||||
|
(import ../modules/neovim/package {
|
||||||
|
inherit pkgs;
|
||||||
|
colors = import ../modules/colorscheme/gruvbox/neovim-gruvbox.nix {
|
||||||
|
inherit pkgs;
|
||||||
|
};
|
||||||
|
})
|
||||||
|
}/bin/nvim";
|
||||||
|
};
|
||||||
|
|
||||||
|
nvim = neovim;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
type = "app";
|
type = "app";
|
||||||
|
|
||||||
program = builtins.toString (pkgs.writeShellScript "readme" ''
|
program = builtins.toString (pkgs.writeShellScript "readme" ''
|
||||||
${pkgs.glow}/bin/glow ${builtins.toString ../README.md}
|
${pkgs.glow}/bin/glow --pager ${builtins.toString ../README.md}
|
||||||
'');
|
'');
|
||||||
|
|
||||||
}
|
}
|
||||||
|
346
flake.lock
generated
346
flake.lock
generated
@ -1,5 +1,53 @@
|
|||||||
{
|
{
|
||||||
"nodes": {
|
"nodes": {
|
||||||
|
"Comment-nvim-src": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1668781964,
|
||||||
|
"narHash": "sha256-po1MyuuOH3e8yJTAtkxnusFSJuNpQnjpe+zfWPoO62E=",
|
||||||
|
"owner": "numToStr",
|
||||||
|
"repo": "Comment.nvim",
|
||||||
|
"rev": "5f01c1a89adafc52bf34e3bf690f80d9d726715d",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "numToStr",
|
||||||
|
"repo": "Comment.nvim",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"bufferline-nvim-src": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1668632062,
|
||||||
|
"narHash": "sha256-qGl1jwBaMFWsrth7F20KrfJpyVENF8GEOJsVBBcSTVA=",
|
||||||
|
"owner": "akinsho",
|
||||||
|
"repo": "bufferline.nvim",
|
||||||
|
"rev": "4ecfa81e470a589e74adcde3d5bb1727dd407363",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "akinsho",
|
||||||
|
"repo": "bufferline.nvim",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"cmp-nvim-lsp-src": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1668566979,
|
||||||
|
"narHash": "sha256-Mqkp8IH/laUx0cK7S0BjusTT+OtOOJOamZM4+93RHdU=",
|
||||||
|
"owner": "hrsh7th",
|
||||||
|
"repo": "cmp-nvim-lsp",
|
||||||
|
"rev": "59224771f91b86d1de12570b4070fe4ad7cd1eeb",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "hrsh7th",
|
||||||
|
"repo": "cmp-nvim-lsp",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"darwin": {
|
"darwin": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
@ -7,11 +55,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1666776005,
|
"lastModified": 1668784520,
|
||||||
"narHash": "sha256-HwSMF19PpczfqNHKcFsA6cF4PVbG00uUSdbq6q3jB5o=",
|
"narHash": "sha256-gGgVAMwYPPmrfnvnoRi6OkEB5KRsNTb9uYzEceLdO/g=",
|
||||||
"owner": "lnl7",
|
"owner": "lnl7",
|
||||||
"repo": "nix-darwin",
|
"repo": "nix-darwin",
|
||||||
"rev": "f6648ca0698d1611d7eadfa72b122252b833f86c",
|
"rev": "6349b99bc2b96ded34d068a88c7c5ced406b7f7f",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@ -26,11 +74,11 @@
|
|||||||
"nixpkgs": "nixpkgs"
|
"nixpkgs": "nixpkgs"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1668992358,
|
"lastModified": 1670028550,
|
||||||
"narHash": "sha256-24iH+wIbE1bKCFmqslwOpfrDypJ40mk1uGIqRUxDXxY=",
|
"narHash": "sha256-jrCEzbRfcNBSy0YHYPLpMSeoluryej3EuqdMZsR1bhQ=",
|
||||||
"owner": "bandithedoge",
|
"owner": "bandithedoge",
|
||||||
"repo": "nixpkgs-firefox-darwin",
|
"repo": "nixpkgs-firefox-darwin",
|
||||||
"rev": "066d4fd658acd075b45405eda9e3bca6a71a47b1",
|
"rev": "8f3697c4ea0b138255a30b65510a25d393c4ce4c",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@ -56,6 +104,21 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"flake-utils": {
|
"flake-utils": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1667395993,
|
||||||
|
"narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=",
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "flake-utils",
|
||||||
|
"rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "flake-utils",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"flake-utils_2": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1659877975,
|
"lastModified": 1659877975,
|
||||||
"narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=",
|
"narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=",
|
||||||
@ -70,6 +133,21 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"flake-utils_3": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1667395993,
|
||||||
|
"narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=",
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "flake-utils",
|
||||||
|
"rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "flake-utils",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"home-manager": {
|
"home-manager": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
@ -78,11 +156,11 @@
|
|||||||
"utils": "utils"
|
"utils": "utils"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1666903647,
|
"lastModified": 1670280307,
|
||||||
"narHash": "sha256-sFI1Gh9DTGzHnBINondupUGYbe+T0wZcpcZjkW0qffM=",
|
"narHash": "sha256-3x+0whP1nCz5adQMIsBA3L9fI/ABOpRUJdbw0AmxBnU=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "home-manager",
|
"repo": "home-manager",
|
||||||
"rev": "213a06295dff96668a1d673b9fd1c03ce1de6745",
|
"rev": "2af0d07678fc15612345e0dd55337550dcf6465f",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@ -92,6 +170,47 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"nil": {
|
||||||
|
"inputs": {
|
||||||
|
"flake-utils": "flake-utils",
|
||||||
|
"nixpkgs": "nixpkgs_2",
|
||||||
|
"rust-overlay": "rust-overlay"
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1670273694,
|
||||||
|
"narHash": "sha256-Rb+AIMyncKNnP0EahDg5w37v6TXlGtd2SczugSQzMQU=",
|
||||||
|
"owner": "oxalica",
|
||||||
|
"repo": "nil",
|
||||||
|
"rev": "101387fb2f54ebc67c894979d1ae0efac2b4ad5c",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "oxalica",
|
||||||
|
"repo": "nil",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nix2vim": {
|
||||||
|
"inputs": {
|
||||||
|
"flake-utils": "flake-utils_2",
|
||||||
|
"nixpkgs": [
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1666021730,
|
||||||
|
"narHash": "sha256-eXd9bqYleh+BZsUybKCj7rNhnwoV0tzsuGGXKmW/+NA=",
|
||||||
|
"owner": "gytis-ivaskevicius",
|
||||||
|
"repo": "nix2vim",
|
||||||
|
"rev": "f3b56da72278cd720fe7fb4b6d001047b7179669",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "gytis-ivaskevicius",
|
||||||
|
"repo": "nix2vim",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"nixlib": {
|
"nixlib": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1636849918,
|
"lastModified": 1636849918,
|
||||||
@ -115,11 +234,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1666812839,
|
"lastModified": 1669065280,
|
||||||
"narHash": "sha256-0nBDgjPU+iDsvz89W+cDEyhnFGSwCJmwDl/gMGqYiU0=",
|
"narHash": "sha256-3+pq1oJWjGDLfd8G/vR3IIFZ+EQ/aglukA0bTiMlf3o=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "nixos-generators",
|
"repo": "nixos-generators",
|
||||||
"rev": "41f3518bc194389df22a3d198215eae75e6b5ab9",
|
"rev": "50aeec40f2072d2ab267c8ec8a345573704ec110",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@ -146,11 +265,27 @@
|
|||||||
},
|
},
|
||||||
"nixpkgs_2": {
|
"nixpkgs_2": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1666959691,
|
"lastModified": 1669809720,
|
||||||
"narHash": "sha256-TRpWA3t8ata79HOGtFd5dDCl1kJQmIE16PDF53/Hcxo=",
|
"narHash": "sha256-RMT77f6CPOYtLLQ2esj+EJ1BPVWxf4RDidjrSvA5OhI=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "448a599c49978c2794401bfc3a2e1fba1a8663be",
|
"rev": "227de2b3bbec142f912c09d5e8a1b4e778aa54fb",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nixos",
|
||||||
|
"ref": "nixpkgs-unstable",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nixpkgs_3": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1670152712,
|
||||||
|
"narHash": "sha256-LJttwIvJqsZIj8u1LxVRv82vwUtkzVqQVi7Wb8gxPS4=",
|
||||||
|
"owner": "nixos",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"rev": "14ddeaebcbe9a25748221d1d7ecdf98e20e2325e",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@ -160,13 +295,13 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs_3": {
|
"nixpkgs_4": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1660318005,
|
"lastModified": 1667653703,
|
||||||
"narHash": "sha256-g9WCa9lVUmOV6dYRbEPjv/TLOR5hamjeCcKExVGS3OQ=",
|
"narHash": "sha256-Xow4vx52/g5zkhlgZnMEm/TEXsj+13jTPCc2jIhW1xU=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "5c211b47aeadcc178c5320afd4e74c7eed5c389f",
|
"rev": "f09ad462c5a121d0239fde645aacb2221553a217",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@ -175,13 +310,29 @@
|
|||||||
"type": "indirect"
|
"type": "indirect"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"null-ls-nvim-src": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1670247790,
|
||||||
|
"narHash": "sha256-fAqhpPJV53XmFQaJ7xnTOd+DKFLxGyfDnvSYW6ZOMQc=",
|
||||||
|
"owner": "jose-elias-alvarez",
|
||||||
|
"repo": "null-ls.nvim",
|
||||||
|
"rev": "b3d2ebdb75cf1fa4290822b43dc31f61bd0023f8",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "jose-elias-alvarez",
|
||||||
|
"repo": "null-ls.nvim",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"nur": {
|
"nur": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1667025500,
|
"lastModified": 1670315682,
|
||||||
"narHash": "sha256-88akaieCIrqta3Uyha7Zv3FJWzKJebb2BrOdZba1zdI=",
|
"narHash": "sha256-/v0RgZZIjvsFuJbJLUlzRbzSlYFXq3olgJTuJBNtcoY=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "nur",
|
"repo": "nur",
|
||||||
"rev": "21dd192519af12a01f1348bbfa86cde47f7aa392",
|
"rev": "af814db16c89385c65e758608296440555f61ccc",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@ -190,25 +341,158 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"nvim-lspconfig-src": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1670318621,
|
||||||
|
"narHash": "sha256-cySTYqdmOktCmwC0mh6gJoGYzyfrOVqNtUBOV5RBSCw=",
|
||||||
|
"owner": "neovim",
|
||||||
|
"repo": "nvim-lspconfig",
|
||||||
|
"rev": "8faa599646f482d3ed04e645eb04af94bcd12feb",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "neovim",
|
||||||
|
"repo": "nvim-lspconfig",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nvim-tree-lua-src": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1670039798,
|
||||||
|
"narHash": "sha256-mQfo9KlNHbZtDIO3U8BZ7PGVBP5EtLUDpETq+bfqpVU=",
|
||||||
|
"owner": "kyazdani42",
|
||||||
|
"repo": "nvim-tree.lua",
|
||||||
|
"rev": "f8489c992998e1e1b45aec65bdb9615e5cd59a61",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "kyazdani42",
|
||||||
|
"repo": "nvim-tree.lua",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nvim-treesitter-src": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1670321697,
|
||||||
|
"narHash": "sha256-lL9cPP7t852Zst1n0nWDp1r31Sx17T+xAiJvIylh4vo=",
|
||||||
|
"owner": "nvim-treesitter",
|
||||||
|
"repo": "nvim-treesitter",
|
||||||
|
"rev": "7eb553ce4dc9af6631a823b5e4b5aa33fdc45bfd",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nvim-treesitter",
|
||||||
|
"repo": "nvim-treesitter",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
|
"Comment-nvim-src": "Comment-nvim-src",
|
||||||
|
"bufferline-nvim-src": "bufferline-nvim-src",
|
||||||
|
"cmp-nvim-lsp-src": "cmp-nvim-lsp-src",
|
||||||
"darwin": "darwin",
|
"darwin": "darwin",
|
||||||
"firefox-darwin": "firefox-darwin",
|
"firefox-darwin": "firefox-darwin",
|
||||||
"home-manager": "home-manager",
|
"home-manager": "home-manager",
|
||||||
|
"nil": "nil",
|
||||||
|
"nix2vim": "nix2vim",
|
||||||
"nixos-generators": "nixos-generators",
|
"nixos-generators": "nixos-generators",
|
||||||
"nixpkgs": "nixpkgs_2",
|
"nixpkgs": "nixpkgs_3",
|
||||||
|
"null-ls-nvim-src": "null-ls-nvim-src",
|
||||||
"nur": "nur",
|
"nur": "nur",
|
||||||
|
"nvim-lspconfig-src": "nvim-lspconfig-src",
|
||||||
|
"nvim-tree-lua-src": "nvim-tree-lua-src",
|
||||||
|
"nvim-treesitter-src": "nvim-treesitter-src",
|
||||||
|
"telescope-nvim-src": "telescope-nvim-src",
|
||||||
|
"telescope-project-nvim-src": "telescope-project-nvim-src",
|
||||||
|
"toggleterm-nvim-src": "toggleterm-nvim-src",
|
||||||
"wallpapers": "wallpapers",
|
"wallpapers": "wallpapers",
|
||||||
"wsl": "wsl"
|
"wsl": "wsl"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"rust-overlay": {
|
||||||
|
"inputs": {
|
||||||
|
"flake-utils": [
|
||||||
|
"nil",
|
||||||
|
"flake-utils"
|
||||||
|
],
|
||||||
|
"nixpkgs": [
|
||||||
|
"nil",
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1669775522,
|
||||||
|
"narHash": "sha256-6xxGArBqssX38DdHpDoPcPvB/e79uXyQBwpBcaO/BwY=",
|
||||||
|
"owner": "oxalica",
|
||||||
|
"repo": "rust-overlay",
|
||||||
|
"rev": "3158e47f6b85a288d12948aeb9a048e0ed4434d6",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "oxalica",
|
||||||
|
"repo": "rust-overlay",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"telescope-nvim-src": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1669979094,
|
||||||
|
"narHash": "sha256-5UgCqnDs4iubnq7gER1wC8Mk9UZuo8cWqDB8ZbyGCRI=",
|
||||||
|
"owner": "nvim-telescope",
|
||||||
|
"repo": "telescope.nvim",
|
||||||
|
"rev": "cabf991b1d3996fa6f3232327fc649bbdf676496",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nvim-telescope",
|
||||||
|
"repo": "telescope.nvim",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"telescope-project-nvim-src": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1665406281,
|
||||||
|
"narHash": "sha256-ZBFgUlW+h7vndazZ0lZux8i7yQHKJNDPQPZ2z96Rfpk=",
|
||||||
|
"owner": "nvim-telescope",
|
||||||
|
"repo": "telescope-project.nvim",
|
||||||
|
"rev": "ff4d3cea905383a67d1a47b9dd210c4907d858c2",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nvim-telescope",
|
||||||
|
"repo": "telescope-project.nvim",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"toggleterm-nvim-src": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1667475764,
|
||||||
|
"narHash": "sha256-gazqaTsK5hAFqk6OONqTsR/zmjN3P8fPKsYufBhkeRA=",
|
||||||
|
"owner": "akinsho",
|
||||||
|
"repo": "toggleterm.nvim",
|
||||||
|
"rev": "3ba683827c623affb4d9aa518e97b34db2623093",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "akinsho",
|
||||||
|
"repo": "toggleterm.nvim",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"utils": {
|
"utils": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1659877975,
|
"lastModified": 1667395993,
|
||||||
"narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=",
|
"narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=",
|
||||||
"owner": "numtide",
|
"owner": "numtide",
|
||||||
"repo": "flake-utils",
|
"repo": "flake-utils",
|
||||||
"rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0",
|
"rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@ -236,15 +520,15 @@
|
|||||||
"wsl": {
|
"wsl": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-compat": "flake-compat",
|
"flake-compat": "flake-compat",
|
||||||
"flake-utils": "flake-utils",
|
"flake-utils": "flake-utils_3",
|
||||||
"nixpkgs": "nixpkgs_3"
|
"nixpkgs": "nixpkgs_4"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1666720338,
|
"lastModified": 1669863592,
|
||||||
"narHash": "sha256-7V91ZtTz7zDXb6hivktQ9RlBglP+WEkYFSciPJHwMJw=",
|
"narHash": "sha256-g0YVtM5Hi8k27yIWvPR7ZRRE1JscL6XtC5dv9Li1tMM=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "NixOS-WSL",
|
"repo": "NixOS-WSL",
|
||||||
"rev": "7bfb8f5aa91fee30a189eae32cda8ddc465076df",
|
"rev": "522219248de4b5876f18e47f34d979dd9f4fcbdc",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
88
flake.nix
88
flake.nix
@ -41,6 +41,57 @@
|
|||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# Convert Nix to Neovim config
|
||||||
|
nix2vim = {
|
||||||
|
url = "github:gytis-ivaskevicius/nix2vim";
|
||||||
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
};
|
||||||
|
|
||||||
|
# Nix language server
|
||||||
|
nil.url = "github:oxalica/nil";
|
||||||
|
|
||||||
|
# Neovim plugins
|
||||||
|
nvim-lspconfig-src = {
|
||||||
|
url = "github:neovim/nvim-lspconfig";
|
||||||
|
flake = false;
|
||||||
|
};
|
||||||
|
cmp-nvim-lsp-src = {
|
||||||
|
url = "github:hrsh7th/cmp-nvim-lsp";
|
||||||
|
flake = false;
|
||||||
|
};
|
||||||
|
null-ls-nvim-src = {
|
||||||
|
url = "github:jose-elias-alvarez/null-ls.nvim";
|
||||||
|
flake = false;
|
||||||
|
};
|
||||||
|
Comment-nvim-src = {
|
||||||
|
url = "github:numToStr/Comment.nvim";
|
||||||
|
flake = false;
|
||||||
|
};
|
||||||
|
nvim-treesitter-src = {
|
||||||
|
url = "github:nvim-treesitter/nvim-treesitter";
|
||||||
|
flake = false;
|
||||||
|
};
|
||||||
|
telescope-nvim-src = {
|
||||||
|
url = "github:nvim-telescope/telescope.nvim";
|
||||||
|
flake = false;
|
||||||
|
};
|
||||||
|
telescope-project-nvim-src = {
|
||||||
|
url = "github:nvim-telescope/telescope-project.nvim";
|
||||||
|
flake = false;
|
||||||
|
};
|
||||||
|
toggleterm-nvim-src = {
|
||||||
|
url = "github:akinsho/toggleterm.nvim";
|
||||||
|
flake = false;
|
||||||
|
};
|
||||||
|
bufferline-nvim-src = {
|
||||||
|
url = "github:akinsho/bufferline.nvim";
|
||||||
|
flake = false;
|
||||||
|
};
|
||||||
|
nvim-tree-lua-src = {
|
||||||
|
url = "github:kyazdani42/nvim-tree.lua";
|
||||||
|
flake = false;
|
||||||
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = { self, nixpkgs, ... }@inputs:
|
outputs = { self, nixpkgs, ... }@inputs:
|
||||||
@ -57,6 +108,13 @@
|
|||||||
dotfilesRepo = "git@github.com:nmasur/dotfiles";
|
dotfilesRepo = "git@github.com:nmasur/dotfiles";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# Common overlays to always use
|
||||||
|
overlays = [
|
||||||
|
inputs.nur.overlay
|
||||||
|
inputs.nix2vim.overlay
|
||||||
|
(import ./modules/neovim/plugins-overlay.nix inputs)
|
||||||
|
];
|
||||||
|
|
||||||
# System types to support.
|
# System types to support.
|
||||||
supportedSystems =
|
supportedSystems =
|
||||||
[ "x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin" ];
|
[ "x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin" ];
|
||||||
@ -67,13 +125,13 @@
|
|||||||
in rec {
|
in rec {
|
||||||
|
|
||||||
nixosConfigurations = {
|
nixosConfigurations = {
|
||||||
desktop = import ./hosts/desktop { inherit inputs globals; };
|
desktop = import ./hosts/desktop { inherit inputs globals overlays; };
|
||||||
wsl = import ./hosts/wsl { inherit inputs globals; };
|
wsl = import ./hosts/wsl { inherit inputs globals overlays; };
|
||||||
oracle = import ./hosts/oracle { inherit inputs globals; };
|
oracle = import ./hosts/oracle { inherit inputs globals overlays; };
|
||||||
};
|
};
|
||||||
|
|
||||||
darwinConfigurations = {
|
darwinConfigurations = {
|
||||||
macbook = import ./hosts/macbook { inherit inputs globals; };
|
macbook = import ./hosts/macbook { inherit inputs globals overlays; };
|
||||||
};
|
};
|
||||||
|
|
||||||
# For quickly applying local settings with:
|
# For quickly applying local settings with:
|
||||||
@ -86,17 +144,29 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
# Package servers into images with a generator
|
# Package servers into images with a generator
|
||||||
packages.aws = nixpkgs.lib.genAttrs [ "x86_64-linux" "aarch64-linux" ]
|
packages = forAllSystems (system: {
|
||||||
(system: {
|
|
||||||
"${system}" = import ./hosts/aws { inherit inputs globals system; };
|
aws = {
|
||||||
|
"${system}" =
|
||||||
|
import ./hosts/aws { inherit inputs globals system overlays; };
|
||||||
|
};
|
||||||
|
|
||||||
|
neovim = let pkgs = import nixpkgs { inherit system overlays; };
|
||||||
|
in import ./modules/neovim/package {
|
||||||
|
inherit pkgs;
|
||||||
|
colors = import ./modules/colorscheme/gruvbox/neovim-gruvbox.nix {
|
||||||
|
inherit pkgs;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
apps = forAllSystems (system:
|
apps = forAllSystems (system:
|
||||||
let pkgs = import nixpkgs { inherit system; };
|
let pkgs = import nixpkgs { inherit system overlays; };
|
||||||
in import ./apps { inherit pkgs; });
|
in import ./apps { inherit pkgs; });
|
||||||
|
|
||||||
devShells = forAllSystems (system:
|
devShells = forAllSystems (system:
|
||||||
let pkgs = import nixpkgs { inherit system; };
|
let pkgs = import nixpkgs { inherit system overlays; };
|
||||||
in {
|
in {
|
||||||
|
|
||||||
# Used to run commands and edit files in this repo
|
# Used to run commands and edit files in this repo
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ inputs, globals, ... }:
|
{ inputs, globals, overlays, ... }:
|
||||||
|
|
||||||
with inputs;
|
with inputs;
|
||||||
|
|
||||||
@ -22,7 +22,7 @@ darwin.lib.darwinSystem {
|
|||||||
};
|
};
|
||||||
mailUser = globals.user;
|
mailUser = globals.user;
|
||||||
networking.hostName = "noah-masur-mac";
|
networking.hostName = "noah-masur-mac";
|
||||||
nixpkgs.overlays = [ nur.overlay firefox-darwin.overlay ];
|
nixpkgs.overlays = [ firefox-darwin.overlay ] ++ overlays;
|
||||||
# Set registry to flake packages, used for nix X commands
|
# Set registry to flake packages, used for nix X commands
|
||||||
nix.registry.nixpkgs.flake = nixpkgs;
|
nix.registry.nixpkgs.flake = nixpkgs;
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ inputs, globals, ... }:
|
{ inputs, globals, overlays, ... }:
|
||||||
|
|
||||||
with inputs;
|
with inputs;
|
||||||
|
|
||||||
@ -15,7 +15,8 @@ nixpkgs.lib.nixosSystem {
|
|||||||
home-manager.nixosModules.home-manager
|
home-manager.nixosModules.home-manager
|
||||||
{
|
{
|
||||||
gui.enable = false;
|
gui.enable = false;
|
||||||
colorscheme = (import ../../modules/colorscheme/gruvbox);
|
theme = { colors = (import ../../modules/colorscheme/gruvbox).dark; };
|
||||||
|
nixpkgs.overlays = overlays;
|
||||||
|
|
||||||
# FQDNs for various services
|
# FQDNs for various services
|
||||||
networking.hostName = "oracle";
|
networking.hostName = "oracle";
|
||||||
|
@ -7,9 +7,10 @@
|
|||||||
|
|
||||||
home-manager.users.${config.user} = {
|
home-manager.users.${config.user} = {
|
||||||
|
|
||||||
programs.firefox = {
|
programs.firefox = rec {
|
||||||
enable = true;
|
enable = true;
|
||||||
package = lib.mkIf pkgs.stdenv.isDarwin pkgs.firefox-bin;
|
package =
|
||||||
|
if pkgs.stdenv.isDarwin then pkgs.firefox-bin else pkgs.firefox;
|
||||||
extensions = with pkgs.nur.repos.rycee.firefox-addons; [
|
extensions = with pkgs.nur.repos.rycee.firefox-addons; [
|
||||||
ublock-origin
|
ublock-origin
|
||||||
vimium
|
vimium
|
||||||
@ -20,26 +21,33 @@
|
|||||||
okta-browser-plugin
|
okta-browser-plugin
|
||||||
sponsorblock
|
sponsorblock
|
||||||
reddit-enhancement-suite
|
reddit-enhancement-suite
|
||||||
|
return-youtube-dislikes
|
||||||
bypass-paywalls-clean
|
bypass-paywalls-clean
|
||||||
markdownload
|
markdownload
|
||||||
darkreader
|
darkreader
|
||||||
snowflake
|
snowflake
|
||||||
don-t-fuck-with-paste
|
don-t-fuck-with-paste
|
||||||
i-dont-care-about-cookies
|
i-dont-care-about-cookies
|
||||||
|
wappalyzer
|
||||||
];
|
];
|
||||||
profiles.Profile0 = {
|
profiles.default = {
|
||||||
id = 0;
|
id = 0;
|
||||||
name = "default";
|
name = "default";
|
||||||
isDefault = true;
|
isDefault = true;
|
||||||
settings = {
|
settings = {
|
||||||
|
"app.update.auto" = false;
|
||||||
"browser.aboutConfig.showWarning" = false;
|
"browser.aboutConfig.showWarning" = false;
|
||||||
"browser.warnOnQuit" = false;
|
"browser.warnOnQuit" = false;
|
||||||
"browser.quitShortcut.disabled" = true;
|
"browser.quitShortcut.disabled" =
|
||||||
|
if pkgs.stdenv.isLinux then true else false;
|
||||||
"browser.theme.dark-private-windows" = true;
|
"browser.theme.dark-private-windows" = true;
|
||||||
"browser.toolbars.bookmarks.visibility" = "newtab";
|
"browser.toolbars.bookmarks.visibility" = "newtab";
|
||||||
"browser.startup.page" = 3; # Restore previous session
|
"browser.startup.page" = 3; # Restore previous session
|
||||||
"browser.newtabpage.enabled" = false; # Make new tabs blank
|
"browser.newtabpage.enabled" = false; # Make new tabs blank
|
||||||
"dom.forms.autocomplete.formautofill" = false; # Disable autofill
|
"dom.forms.autocomplete.formautofill" = false; # Disable autofill
|
||||||
|
"extensions.formautofill.creditCards.enabled" =
|
||||||
|
false; # Disable credit cards
|
||||||
|
"dom.payments.defaults.saveAddress" = false; # Disable address save
|
||||||
"general.autoScroll" = true; # Drag middle-mouse to scroll
|
"general.autoScroll" = true; # Drag middle-mouse to scroll
|
||||||
"services.sync.prefs.sync.general.autoScroll" =
|
"services.sync.prefs.sync.general.autoScroll" =
|
||||||
false; # Prevent disabling autoscroll
|
false; # Prevent disabling autoscroll
|
||||||
@ -60,6 +68,22 @@
|
|||||||
.toolbar-items {
|
.toolbar-items {
|
||||||
background-color: ${config.theme.colors.base00} !important;
|
background-color: ${config.theme.colors.base00} !important;
|
||||||
}
|
}
|
||||||
|
/* Extra tab bar sides on macOS */
|
||||||
|
.titlebar-spacer {
|
||||||
|
background-color: ${config.theme.colors.base00} !important;
|
||||||
|
}
|
||||||
|
.titlebar-buttonbox-container {
|
||||||
|
background-color: ${config.theme.colors.base00} !important;
|
||||||
|
}
|
||||||
|
#tabbrowser-tabs {
|
||||||
|
border-inline-start: 0 !important;
|
||||||
|
}
|
||||||
|
/* Private Browsing indicator on macOS */
|
||||||
|
#private-browsing-indicator-with-label {
|
||||||
|
background-color: ${config.theme.colors.base00} !important;
|
||||||
|
margin-inline: 0 !important;
|
||||||
|
padding-inline: 7px;
|
||||||
|
}
|
||||||
/* Tabs themselves */
|
/* Tabs themselves */
|
||||||
.tabbrowser-tab .tab-stack {
|
.tabbrowser-tab .tab-stack {
|
||||||
border-radius: 5px 5px 0 0;
|
border-radius: 5px 5px 0 0;
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
base0D = "#83a598"; # blue
|
base0D = "#83a598"; # blue
|
||||||
base0E = "#d3869b"; # purple
|
base0E = "#d3869b"; # purple
|
||||||
base0F = "#d65d0e"; # brown
|
base0F = "#d65d0e"; # brown
|
||||||
neovimConfig = ./neovim.lua;
|
neovimConfig = ./neovim-gruvbox.nix;
|
||||||
batTheme = "gruvbox-dark";
|
batTheme = "gruvbox-dark";
|
||||||
};
|
};
|
||||||
light = {
|
light = {
|
||||||
@ -39,7 +39,7 @@
|
|||||||
base0D = "#076678"; # blue
|
base0D = "#076678"; # blue
|
||||||
base0E = "#8f3f71"; # purple
|
base0E = "#8f3f71"; # purple
|
||||||
base0F = "#d65d0e"; # brown
|
base0F = "#d65d0e"; # brown
|
||||||
neovimConfig = ./neovim.lua;
|
neovimConfig = ./neovim-gruvbox.nix;
|
||||||
batTheme = "gruvbox-light";
|
batTheme = "gruvbox-light";
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
12
modules/colorscheme/gruvbox/neovim-gruvbox.nix
Normal file
12
modules/colorscheme/gruvbox/neovim-gruvbox.nix
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
{ pkgs, ... }: {
|
||||||
|
|
||||||
|
plugins = [ pkgs.vimPlugins.vim-gruvbox8 ];
|
||||||
|
|
||||||
|
vim.g.gruvbox_italicize_strings = 0;
|
||||||
|
vim.o.background = "dark";
|
||||||
|
vimscript = ''
|
||||||
|
let g:gruvbox_italicize_strings = 0
|
||||||
|
colorscheme gruvbox8
|
||||||
|
'';
|
||||||
|
|
||||||
|
}
|
@ -7,9 +7,9 @@
|
|||||||
programs.himalaya = { enable = true; };
|
programs.himalaya = { enable = true; };
|
||||||
accounts.email.accounts.home.himalaya = {
|
accounts.email.accounts.home.himalaya = {
|
||||||
enable = true;
|
enable = true;
|
||||||
settings = {
|
|
||||||
backend = "imap";
|
backend = "imap";
|
||||||
sender = "smtp";
|
sender = "smtp";
|
||||||
|
settings = {
|
||||||
downloads-dir = config.userDirs.download;
|
downloads-dir = config.userDirs.download;
|
||||||
smtp-insecure = true;
|
smtp-insecure = true;
|
||||||
};
|
};
|
||||||
|
22
modules/neovim/config/bufferline.nix
Normal file
22
modules/neovim/config/bufferline.nix
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
{ pkgs, ... }: {
|
||||||
|
plugins = [
|
||||||
|
pkgs.vimPlugins.bufferline-nvim
|
||||||
|
pkgs.vimPlugins.vim-bbye # Better closing of buffers
|
||||||
|
];
|
||||||
|
setup.bufferline = {
|
||||||
|
options = {
|
||||||
|
diagnostics = "nvim_lsp";
|
||||||
|
always_show_bufferline = false;
|
||||||
|
separator_style = "slant";
|
||||||
|
offsets = [{ filetype = "NvimTree"; }];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
lua = ''
|
||||||
|
-- Move buffers
|
||||||
|
vim.keymap.set("n", "L", ":BufferLineCycleNext<CR>", { silent = true })
|
||||||
|
vim.keymap.set("n", "H", ":BufferLineCyclePrev<CR>", { silent = true })
|
||||||
|
|
||||||
|
-- Kill buffer
|
||||||
|
vim.keymap.set("n", "<Leader>x", " :Bdelete<CR>", { silent = true })
|
||||||
|
'';
|
||||||
|
}
|
155
modules/neovim/config/completion.nix
Normal file
155
modules/neovim/config/completion.nix
Normal file
@ -0,0 +1,155 @@
|
|||||||
|
{ pkgs, dsl, ... }: {
|
||||||
|
|
||||||
|
plugins = [
|
||||||
|
pkgs.vimPlugins.cmp-nvim-lsp
|
||||||
|
pkgs.vimPlugins.cmp-buffer
|
||||||
|
pkgs.vimPlugins.cmp-path
|
||||||
|
pkgs.vimPlugins.cmp-cmdline
|
||||||
|
pkgs.vimPlugins.cmp-nvim-lua
|
||||||
|
pkgs.vimPlugins.luasnip
|
||||||
|
pkgs.vimPlugins.cmp_luasnip
|
||||||
|
pkgs.vimPlugins.cmp-rg
|
||||||
|
pkgs.vimPlugins.friendly-snippets
|
||||||
|
];
|
||||||
|
|
||||||
|
use.cmp.setup = dsl.callWith {
|
||||||
|
|
||||||
|
# Disable in telescope buffers
|
||||||
|
enabled = dsl.rawLua ''
|
||||||
|
function()
|
||||||
|
if vim.bo.buftype == "prompt" then
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
'';
|
||||||
|
|
||||||
|
snippet.expand = dsl.rawLua ''
|
||||||
|
function(args)
|
||||||
|
require("luasnip").lsp_expand(args.body)
|
||||||
|
end
|
||||||
|
'';
|
||||||
|
|
||||||
|
mapping = {
|
||||||
|
"['<C-n>']" = dsl.rawLua
|
||||||
|
"require('cmp').mapping.select_next_item({ behavior = require('cmp').SelectBehavior.Insert })";
|
||||||
|
"['<C-p>']" = dsl.rawLua
|
||||||
|
"require('cmp').mapping.select_prev_item({ behavior = require('cmp').SelectBehavior.Insert })";
|
||||||
|
"['<Down>']" = dsl.rawLua
|
||||||
|
"require('cmp').mapping.select_next_item({ behavior = require('cmp').SelectBehavior.Select })";
|
||||||
|
"['<Up>']" = dsl.rawLua
|
||||||
|
"require('cmp').mapping.select_prev_item({ behavior = require('cmp').SelectBehavior.Select })";
|
||||||
|
"['<C-d>']" = dsl.rawLua "require('cmp').mapping.scroll_docs(-4)";
|
||||||
|
"['<C-f>']" = dsl.rawLua "require('cmp').mapping.scroll_docs(4)";
|
||||||
|
"['<C-e>']" = dsl.rawLua "require('cmp').mapping.abort()";
|
||||||
|
"['<CR>']" = dsl.rawLua
|
||||||
|
"require('cmp').mapping.confirm({ behavior = require('cmp').ConfirmBehavior.Replace, select = true, })";
|
||||||
|
"['<C-r>']" = dsl.rawLua
|
||||||
|
"require('cmp').mapping.confirm({ behavior = require('cmp').ConfirmBehavior.Replace, select = true, })";
|
||||||
|
"['<Esc>']" = dsl.rawLua ''
|
||||||
|
function(_)
|
||||||
|
cmp.mapping({
|
||||||
|
i = cmp.mapping.abort(),
|
||||||
|
c = cmp.mapping.close(),
|
||||||
|
})
|
||||||
|
vim.cmd("stopinsert") --- Abort and leave insert mode
|
||||||
|
end
|
||||||
|
'';
|
||||||
|
"['<C-l>']" = dsl.rawLua ''
|
||||||
|
cmp.mapping(function(_)
|
||||||
|
if require("luasnip").expand_or_jumpable() then
|
||||||
|
require("luasnip").expand_or_jump()
|
||||||
|
end
|
||||||
|
end, { "i", "s" })
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
sources = [
|
||||||
|
{ name = "nvim_lua"; }
|
||||||
|
{ name = "nvim_lsp"; }
|
||||||
|
{ name = "luasnip"; }
|
||||||
|
{ name = "path"; }
|
||||||
|
{
|
||||||
|
name = "buffer";
|
||||||
|
keyword_length = 3;
|
||||||
|
max_item_count = 10;
|
||||||
|
}
|
||||||
|
{
|
||||||
|
name = "rg";
|
||||||
|
keyword_length = 6;
|
||||||
|
max_item_count = 10;
|
||||||
|
option = { additional_arguments = "--ignore-case"; };
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
formatting = {
|
||||||
|
fields = [ "kind" "abbr" "menu" ];
|
||||||
|
format = dsl.rawLua ''
|
||||||
|
function(entry, vim_item)
|
||||||
|
local kind_icons = {
|
||||||
|
Text = "",
|
||||||
|
Method = "m",
|
||||||
|
Function = "",
|
||||||
|
Constructor = "",
|
||||||
|
Field = "",
|
||||||
|
Variable = "",
|
||||||
|
Class = "",
|
||||||
|
Interface = "",
|
||||||
|
Module = "",
|
||||||
|
Property = "",
|
||||||
|
Unit = "",
|
||||||
|
Value = "",
|
||||||
|
Enum = "",
|
||||||
|
Keyword = "",
|
||||||
|
Snippet = "",
|
||||||
|
Color = "",
|
||||||
|
File = "",
|
||||||
|
Reference = "",
|
||||||
|
Folder = "",
|
||||||
|
EnumMember = "",
|
||||||
|
Constant = "",
|
||||||
|
Struct = "",
|
||||||
|
Event = "",
|
||||||
|
Operator = "",
|
||||||
|
TypeParameter = "",
|
||||||
|
}
|
||||||
|
vim_item.kind = string.format("%s", kind_icons[vim_item.kind])
|
||||||
|
vim_item.menu = ({
|
||||||
|
luasnip = "[Snippet]",
|
||||||
|
buffer = "[Buffer]",
|
||||||
|
path = "[Path]",
|
||||||
|
rg = "[Grep]",
|
||||||
|
nvim_lsp = "[LSP]",
|
||||||
|
nvim_lua = "[Lua]",
|
||||||
|
})[entry.source.name]
|
||||||
|
return vim_item
|
||||||
|
end
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
experimental = {
|
||||||
|
native_menu = false; # Use cmp menu instead of Vim menu
|
||||||
|
ghost_text = true; # Show preview auto-completion
|
||||||
|
};
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
lua = ''
|
||||||
|
-- Use buffer source for `/`
|
||||||
|
require('cmp').setup.cmdline("/", {
|
||||||
|
sources = {
|
||||||
|
{ name = "buffer", keyword_length = 5 },
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
-- Use cmdline & path source for ':'
|
||||||
|
require('cmp').setup.cmdline(":", {
|
||||||
|
sources = require('cmp').config.sources({
|
||||||
|
{ name = "path" },
|
||||||
|
}, {
|
||||||
|
{ name = "cmdline" },
|
||||||
|
}),
|
||||||
|
})
|
||||||
|
'';
|
||||||
|
|
||||||
|
}
|
35
modules/neovim/config/gitsigns.lua
Normal file
35
modules/neovim/config/gitsigns.lua
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
vim.keymap.set("", "<Space>", "<Nop>", { silent = true })
|
||||||
|
vim.g.mapleader = " "
|
||||||
|
vim.g.maplocalleader = " "
|
||||||
|
|
||||||
|
local gitsigns = require("gitsigns")
|
||||||
|
vim.keymap.set("n", "<Leader>gB", gitsigns.blame_line)
|
||||||
|
vim.keymap.set("n", "<Leader>gp", gitsigns.preview_hunk)
|
||||||
|
vim.keymap.set("v", "<Leader>gp", gitsigns.preview_hunk)
|
||||||
|
vim.keymap.set("n", "<Leader>gd", gitsigns.diffthis)
|
||||||
|
vim.keymap.set("v", "<Leader>gd", gitsigns.diffthis)
|
||||||
|
vim.keymap.set("n", "<Leader>rgf", gitsigns.reset_buffer)
|
||||||
|
vim.keymap.set("v", "<Leader>hs", gitsigns.stage_hunk)
|
||||||
|
vim.keymap.set("n", "<Leader>hr", gitsigns.reset_hunk)
|
||||||
|
vim.keymap.set("v", "<Leader>hr", gitsigns.reset_hunk)
|
||||||
|
|
||||||
|
-- Navigation
|
||||||
|
vim.keymap.set("n", "]g", function()
|
||||||
|
if vim.wo.diff then
|
||||||
|
return "]g"
|
||||||
|
end
|
||||||
|
vim.schedule(function()
|
||||||
|
gitsigns.next_hunk()
|
||||||
|
end)
|
||||||
|
return "<Ignore>"
|
||||||
|
end, { expr = true })
|
||||||
|
|
||||||
|
vim.keymap.set("n", "[g", function()
|
||||||
|
if vim.wo.diff then
|
||||||
|
return "[g"
|
||||||
|
end
|
||||||
|
vim.schedule(function()
|
||||||
|
gitsigns.prev_hunk()
|
||||||
|
end)
|
||||||
|
return "<Ignore>"
|
||||||
|
end, { expr = true })
|
5
modules/neovim/config/gitsigns.nix
Normal file
5
modules/neovim/config/gitsigns.nix
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
{ pkgs, ... }: {
|
||||||
|
plugins = [ pkgs.vimPlugins.gitsigns-nvim ];
|
||||||
|
setup.gitsigns = { };
|
||||||
|
lua = builtins.readFile ./gitsigns.lua;
|
||||||
|
}
|
10
modules/neovim/config/lsp.lua
Normal file
10
modules/neovim/config/lsp.lua
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
vim.keymap.set("n", "gd", vim.lsp.buf.definition)
|
||||||
|
vim.keymap.set("n", "gT", vim.lsp.buf.type_definition)
|
||||||
|
vim.keymap.set("n", "gi", vim.lsp.buf.implementation)
|
||||||
|
vim.keymap.set("n", "gh", vim.lsp.buf.hover)
|
||||||
|
-- vim.keymap.set("n", "gr", telescope.lsp_references)
|
||||||
|
vim.keymap.set("n", "<Leader>R", vim.lsp.buf.rename)
|
||||||
|
vim.keymap.set("n", "]e", vim.diagnostic.goto_next)
|
||||||
|
vim.keymap.set("n", "[e", vim.diagnostic.goto_prev)
|
||||||
|
vim.keymap.set("n", "<Leader>de", vim.diagnostic.open_float)
|
||||||
|
vim.keymap.set("n", "<Leader>E", vim.lsp.buf.code_action)
|
63
modules/neovim/config/lsp.nix
Normal file
63
modules/neovim/config/lsp.nix
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
{ pkgs, dsl, ... }: {
|
||||||
|
|
||||||
|
plugins = [
|
||||||
|
pkgs.vimPlugins.nvim-lspconfig
|
||||||
|
pkgs.vimPlugins.lsp-colors-nvim
|
||||||
|
pkgs.vimPlugins.null-ls-nvim
|
||||||
|
];
|
||||||
|
|
||||||
|
use.lspconfig.sumneko_lua.setup = dsl.callWith {
|
||||||
|
settings = { Lua = { diagnostics = { globals = [ "vim" "hs" ]; }; }; };
|
||||||
|
capabilities = dsl.rawLua "require('cmp_nvim_lsp').default_capabilities()";
|
||||||
|
cmd = [ "${pkgs.sumneko-lua-language-server}/bin/lua-language-server" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
use.lspconfig.nil_ls.setup = dsl.callWith {
|
||||||
|
cmd = [ "${pkgs.nil}/bin/nil" ];
|
||||||
|
capabilities = dsl.rawLua "require('cmp_nvim_lsp').default_capabilities()";
|
||||||
|
};
|
||||||
|
|
||||||
|
use.lspconfig.pyright.setup = dsl.callWith {
|
||||||
|
cmd = [ "${pkgs.pyright}/bin/pyright-langserver" "--stdio" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
use.lspconfig.terraformls.setup =
|
||||||
|
dsl.callWith { cmd = [ "${pkgs.terraform-ls}/bin/terraform-ls" "serve" ]; };
|
||||||
|
|
||||||
|
vim.api.nvim_create_augroup = dsl.callWith [ "LspFormatting" { } ];
|
||||||
|
|
||||||
|
lua = ''
|
||||||
|
${builtins.readFile ./lsp.lua}
|
||||||
|
|
||||||
|
require("null-ls").setup({
|
||||||
|
sources = {
|
||||||
|
require("null-ls").builtins.formatting.stylua.with({ command = "${pkgs.stylua}/bin/stylua" }),
|
||||||
|
require("null-ls").builtins.formatting.black.with({ command = "${pkgs.black}/bin/black" }),
|
||||||
|
require("null-ls").builtins.diagnostics.flake8.with({ command = "${pkgs.python310Packages.flake8}/bin/flake8" }),
|
||||||
|
require("null-ls").builtins.formatting.fish_indent.with({ command = "${pkgs.fish}/bin/fish_indent" }),
|
||||||
|
require("null-ls").builtins.formatting.nixfmt.with({ command = "${pkgs.nixfmt}/bin/nixfmt" }),
|
||||||
|
require("null-ls").builtins.formatting.rustfmt.with({ command = "${pkgs.rustfmt}/bin/rustfmt" }),
|
||||||
|
require("null-ls").builtins.diagnostics.shellcheck.with({ command = "${pkgs.shellcheck}/bin/shellcheck" }),
|
||||||
|
require("null-ls").builtins.formatting.shfmt.with({
|
||||||
|
command = "${pkgs.shfmt}/bin/shfmt",
|
||||||
|
extra_args = { "-i", "4", "-ci" },
|
||||||
|
}),
|
||||||
|
require("null-ls").builtins.formatting.terraform_fmt.with({ command = "${pkgs.terraform}/bin/terraform" }),
|
||||||
|
},
|
||||||
|
|
||||||
|
on_attach = function(client, bufnr)
|
||||||
|
if client.supports_method("textDocument/formatting") then
|
||||||
|
vim.api.nvim_clear_autocmds({ group = augroup, buffer = bufnr })
|
||||||
|
vim.api.nvim_create_autocmd("BufWritePre", {
|
||||||
|
group = augroup,
|
||||||
|
buffer = bufnr,
|
||||||
|
callback = function()
|
||||||
|
vim.lsp.buf.format({ bufnr = bufnr })
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
'';
|
||||||
|
|
||||||
|
}
|
70
modules/neovim/config/misc.nix
Normal file
70
modules/neovim/config/misc.nix
Normal file
@ -0,0 +1,70 @@
|
|||||||
|
{ pkgs, dsl, lib, ... }: {
|
||||||
|
plugins = [
|
||||||
|
pkgs.vimPlugins.vim-surround # Keybinds for surround characters
|
||||||
|
pkgs.vimPlugins.vim-eunuch # File manipulation commands
|
||||||
|
pkgs.vimPlugins.vim-fugitive # Git commands
|
||||||
|
pkgs.vimPlugins.vim-repeat # Better repeat using .
|
||||||
|
pkgs.vimPlugins.comment-nvim # Smart comment commands
|
||||||
|
pkgs.vimPlugins.impatient-nvim # Faster load times
|
||||||
|
pkgs.vimPlugins.glow-nvim # Markdown preview popup
|
||||||
|
pkgs.vimPlugins.nvim-colorizer-lua # Hex color previews
|
||||||
|
];
|
||||||
|
|
||||||
|
setup.Comment = { };
|
||||||
|
setup.colorizer = { };
|
||||||
|
|
||||||
|
vim.o = {
|
||||||
|
termguicolors = true; # Set to truecolor
|
||||||
|
hidden = true; # Don't unload buffers when leaving them
|
||||||
|
list = true; # Reveal whitespace with dashes
|
||||||
|
expandtab = true; # Tabs into spaces
|
||||||
|
shiftwidth = 4; # Amount to shift with > key
|
||||||
|
softtabstop = 4; # Amount to shift with <TAB> key
|
||||||
|
ignorecase = true; # Ignore case when searching
|
||||||
|
smartcase = true; # Check case when using capitals in search
|
||||||
|
infercase = true; # Don't match cases when completing suggestions
|
||||||
|
incsearch = true; # Search while typing
|
||||||
|
visualbell = true; # No sounds
|
||||||
|
scrolljump = 1; # Number of lines to scroll
|
||||||
|
scrolloff = 3; # Margin of lines to see while scrolling
|
||||||
|
splitright = true; # Vertical splits on the right side
|
||||||
|
splitbelow = true; # Horizontal splits on the bottom side
|
||||||
|
pastetoggle = "<F3>"; # Use F3 to enter raw paste mode
|
||||||
|
clipboard = "unnamedplus"; # Uses system clipboard for yanking
|
||||||
|
updatetime = 300; # Faster diagnostics
|
||||||
|
mouse = "nv"; # Mouse interaction / scrolling
|
||||||
|
inccommand = "split"; # Live preview search and replace
|
||||||
|
};
|
||||||
|
|
||||||
|
vim.wo = {
|
||||||
|
number = true; # Show line numbers
|
||||||
|
relativenumber = true; # Relative numbers instead of absolute
|
||||||
|
};
|
||||||
|
|
||||||
|
# Better backup, swap and undo storage
|
||||||
|
vim.o.backup = true; # Easier to recover and more secure
|
||||||
|
vim.bo.swapfile = false; # Instead of swaps, create backups
|
||||||
|
vim.bo.undofile = true; # Keeps undos after quit
|
||||||
|
vim.o.backupdir = dsl.rawLua ''vim.fn.stdpath("cache") .. "/backup"'';
|
||||||
|
|
||||||
|
# Required for nvim-cmp completion
|
||||||
|
vim.opt.completeopt = [ "menu" "menuone" "noselect" ];
|
||||||
|
|
||||||
|
lua = lib.mkBefore ''
|
||||||
|
require("impatient")
|
||||||
|
${builtins.readFile ../lua/keybinds.lua};
|
||||||
|
${builtins.readFile ../lua/settings.lua};
|
||||||
|
'';
|
||||||
|
|
||||||
|
vimscript = ''
|
||||||
|
" Remember last position when reopening file
|
||||||
|
au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$") | exe "normal! g`\"" | endif
|
||||||
|
|
||||||
|
" LaTeX options
|
||||||
|
au FileType tex inoremap ;bf \textbf{}<Esc>i
|
||||||
|
au BufWritePost *.tex silent! execute "!pdflatex -output-directory=%:p:h % >/dev/null 2>&1" | redraw!
|
||||||
|
|
||||||
|
" Flash highlight when yanking
|
||||||
|
au TextYankPost * silent! lua vim.highlight.on_yank { timeout = 250 }
|
||||||
|
'';
|
||||||
|
}
|
9
modules/neovim/config/statusline.nix
Normal file
9
modules/neovim/config/statusline.nix
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
{ pkgs, ... }: {
|
||||||
|
plugins = [ pkgs.vimPlugins.lualine-nvim ];
|
||||||
|
setup.lualine = {
|
||||||
|
options = {
|
||||||
|
theme = "gruvbox";
|
||||||
|
icons_enabled = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
52
modules/neovim/config/syntax.nix
Normal file
52
modules/neovim/config/syntax.nix
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
{ pkgs, ... }: {
|
||||||
|
|
||||||
|
plugins = [
|
||||||
|
(pkgs.vimPlugins.nvim-treesitter.withPlugins (plugins:
|
||||||
|
with pkgs.tree-sitter-grammars; [
|
||||||
|
tree-sitter-hcl
|
||||||
|
tree-sitter-python
|
||||||
|
tree-sitter-lua
|
||||||
|
tree-sitter-nix
|
||||||
|
tree-sitter-fish
|
||||||
|
tree-sitter-toml
|
||||||
|
tree-sitter-yaml
|
||||||
|
tree-sitter-json
|
||||||
|
]))
|
||||||
|
pkgs.vimPlugins.vim-matchup # Better % jumping in languages
|
||||||
|
pkgs.vimPlugins.nginx-vim
|
||||||
|
pkgs.vimPlugins.vim-helm
|
||||||
|
pkgs.vimPlugins.vim-puppet
|
||||||
|
];
|
||||||
|
|
||||||
|
setup."nvim-treesitter.configs" = {
|
||||||
|
highlight = { enable = true; };
|
||||||
|
indent = { enable = true; };
|
||||||
|
|
||||||
|
textobjects = {
|
||||||
|
select = {
|
||||||
|
enable = true;
|
||||||
|
lookahead = true; # Jump forward automatically
|
||||||
|
|
||||||
|
keymaps = {
|
||||||
|
"['af']" = "@function.outer";
|
||||||
|
"['if']" = "@function.inner";
|
||||||
|
"['ac']" = "@class.outer";
|
||||||
|
"['ic']" = "@class.inner";
|
||||||
|
"['al']" = "@loop.outer";
|
||||||
|
"['il']" = "@loop.inner";
|
||||||
|
"['aa']" = "@call.outer";
|
||||||
|
"['ia']" = "@call.inner";
|
||||||
|
"['ar']" = "@parameter.outer";
|
||||||
|
"['ir']" = "@parameter.inner";
|
||||||
|
"['aC']" = "@comment.outer";
|
||||||
|
"['iC']" = "@comment.outer";
|
||||||
|
"['a/']" = "@comment.outer";
|
||||||
|
"['i/']" = "@comment.outer";
|
||||||
|
"['a;']" = "@statement.outer";
|
||||||
|
"['i;']" = "@statement.outer";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
69
modules/neovim/config/telescope.lua
Normal file
69
modules/neovim/config/telescope.lua
Normal file
@ -0,0 +1,69 @@
|
|||||||
|
local telescope = require("telescope.builtin")
|
||||||
|
vim.keymap.set("n", "<Leader>k", telescope.keymaps)
|
||||||
|
vim.keymap.set("n", "<Leader>/", telescope.live_grep)
|
||||||
|
vim.keymap.set("n", "<Leader>ff", telescope.find_files)
|
||||||
|
vim.keymap.set("n", "<Leader>fp", telescope.git_files)
|
||||||
|
vim.keymap.set("n", "<Leader>fw", telescope.grep_string)
|
||||||
|
vim.keymap.set("n", "<Leader>b", telescope.buffers)
|
||||||
|
vim.keymap.set("n", "<Leader>hh", telescope.help_tags)
|
||||||
|
vim.keymap.set("n", "<Leader>fr", telescope.oldfiles)
|
||||||
|
vim.keymap.set("n", "<Leader>cc", telescope.commands)
|
||||||
|
vim.keymap.set("n", "<Leader>gc", telescope.git_commits)
|
||||||
|
vim.keymap.set("n", "<Leader>gf", telescope.git_bcommits)
|
||||||
|
vim.keymap.set("n", "<Leader>gb", telescope.git_branches)
|
||||||
|
vim.keymap.set("n", "<Leader>gs", telescope.git_status)
|
||||||
|
vim.keymap.set("n", "<Leader>s", telescope.current_buffer_fuzzy_find)
|
||||||
|
|
||||||
|
vim.keymap.set("n", "<Leader>N", function()
|
||||||
|
local opts = {
|
||||||
|
prompt_title = "Search Notes",
|
||||||
|
cwd = "$NOTES_PATH",
|
||||||
|
}
|
||||||
|
telescope.live_grep(opts)
|
||||||
|
end)
|
||||||
|
|
||||||
|
vim.keymap.set("n", "<Leader>fN", function()
|
||||||
|
local opts = {
|
||||||
|
prompt_title = "Find Notes",
|
||||||
|
cwd = "$NOTES_PATH",
|
||||||
|
}
|
||||||
|
telescope.find_files(opts)
|
||||||
|
end)
|
||||||
|
|
||||||
|
vim.keymap.set("n", "<Leader>cr", function()
|
||||||
|
local opts = require("telescope.themes").get_ivy({
|
||||||
|
layout_config = {
|
||||||
|
bottom_pane = {
|
||||||
|
height = 15,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
telescope.command_history(opts)
|
||||||
|
end)
|
||||||
|
|
||||||
|
-- Zoxide
|
||||||
|
vim.keymap.set("n", "<Leader>fz", require("telescope").extensions.zoxide.list)
|
||||||
|
|
||||||
|
-- Project
|
||||||
|
require("telescope").load_extension("project")
|
||||||
|
vim.keymap.set("n", "<C-p>", function()
|
||||||
|
local opts = require("telescope.themes").get_ivy({
|
||||||
|
layout_config = {
|
||||||
|
bottom_pane = {
|
||||||
|
height = 10,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
require("telescope").extensions.project.project(opts)
|
||||||
|
end)
|
||||||
|
|
||||||
|
-- File browser
|
||||||
|
require("telescope").load_extension("file_browser")
|
||||||
|
vim.keymap.set("n", "<Leader>fa", require("telescope").extensions.file_browser.file_browser)
|
||||||
|
vim.keymap.set("n", "<Leader>fD", function()
|
||||||
|
local opts = {
|
||||||
|
prompt_title = "Find Downloads",
|
||||||
|
cwd = "~/downloads",
|
||||||
|
}
|
||||||
|
require("telescope").extensions.file_browser.file_browser(opts)
|
||||||
|
end)
|
34
modules/neovim/config/telescope.nix
Normal file
34
modules/neovim/config/telescope.nix
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
{ pkgs, dsl, ... }: {
|
||||||
|
|
||||||
|
plugins = [
|
||||||
|
pkgs.vimPlugins.telescope-nvim
|
||||||
|
pkgs.vimPlugins.telescope-project-nvim
|
||||||
|
pkgs.vimPlugins.telescope-fzy-native-nvim
|
||||||
|
pkgs.vimPlugins.telescope-file-browser-nvim
|
||||||
|
pkgs.vimPlugins.telescope-zoxide
|
||||||
|
];
|
||||||
|
|
||||||
|
setup.telescope = {
|
||||||
|
defaults = {
|
||||||
|
mappings = {
|
||||||
|
i = {
|
||||||
|
"['<esc>']" = dsl.rawLua "require('telescope.actions').close";
|
||||||
|
"['<C-h>']" = "which_key";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
pickers = {
|
||||||
|
find_files = { theme = "ivy"; };
|
||||||
|
oldfiles = { theme = "ivy"; };
|
||||||
|
buffers = { theme = "dropdown"; };
|
||||||
|
};
|
||||||
|
extensions = {
|
||||||
|
fzy_native = { };
|
||||||
|
zoxide = { };
|
||||||
|
project = { base_dirs = [ "~/dev" ]; };
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
lua = builtins.readFile ./telescope.lua;
|
||||||
|
|
||||||
|
}
|
40
modules/neovim/config/toggleterm.lua
Normal file
40
modules/neovim/config/toggleterm.lua
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
vim.keymap.set("t", "<A-CR>", "<C-\\><C-n>") --- Exit terminal mode
|
||||||
|
|
||||||
|
-- Only set these keymaps for toggleterm
|
||||||
|
vim.api.nvim_create_autocmd("TermOpen", {
|
||||||
|
pattern = "term://*toggleterm#*",
|
||||||
|
callback = function()
|
||||||
|
-- vim.keymap.set("t", "<Esc>", "<C-\\><C-n>") --- Exit terminal mode
|
||||||
|
vim.keymap.set("t", "<C-h>", "<C-\\><C-n><C-w>h")
|
||||||
|
vim.keymap.set("t", "<C-j>", "<C-\\><C-n><C-w>j")
|
||||||
|
vim.keymap.set("t", "<C-k>", "<C-\\><C-n><C-w>k")
|
||||||
|
vim.keymap.set("t", "<C-l>", "<C-\\><C-n><C-w>l")
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
local terminal = require("toggleterm.terminal").Terminal
|
||||||
|
|
||||||
|
local basicterminal = terminal:new()
|
||||||
|
function TERM_TOGGLE()
|
||||||
|
basicterminal:toggle()
|
||||||
|
end
|
||||||
|
|
||||||
|
local nixpkgs = terminal:new({ cmd = "nix repl '<nixpkgs>'" })
|
||||||
|
function NIXPKGS_TOGGLE()
|
||||||
|
nixpkgs:toggle()
|
||||||
|
end
|
||||||
|
|
||||||
|
local gitwatch = terminal:new({ cmd = "fish --interactive --init-command 'gh run watch'" })
|
||||||
|
function GITWATCH_TOGGLE()
|
||||||
|
gitwatch:toggle()
|
||||||
|
end
|
||||||
|
|
||||||
|
local k9s = terminal:new({ cmd = "k9s" })
|
||||||
|
function K9S_TOGGLE()
|
||||||
|
k9s:toggle()
|
||||||
|
end
|
||||||
|
|
||||||
|
vim.keymap.set("n", "<Leader>t", TERM_TOGGLE)
|
||||||
|
vim.keymap.set("n", "<Leader>P", NIXPKGS_TOGGLE)
|
||||||
|
vim.keymap.set("n", "<Leader>gw", GITWATCH_TOGGLE)
|
||||||
|
vim.keymap.set("n", "<Leader>9", K9S_TOGGLE)
|
13
modules/neovim/config/toggleterm.nix
Normal file
13
modules/neovim/config/toggleterm.nix
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
{ pkgs, dsl, ... }: {
|
||||||
|
|
||||||
|
plugins = [ pkgs.vimPlugins.toggleterm-nvim ];
|
||||||
|
|
||||||
|
use.toggleterm.setup = dsl.callWith {
|
||||||
|
open_mapping = dsl.rawLua "[[<c-\\>]]";
|
||||||
|
hide_numbers = true;
|
||||||
|
direction = "float";
|
||||||
|
};
|
||||||
|
|
||||||
|
lua = builtins.readFile ./toggleterm.lua;
|
||||||
|
|
||||||
|
}
|
77
modules/neovim/config/tree.nix
Normal file
77
modules/neovim/config/tree.nix
Normal file
@ -0,0 +1,77 @@
|
|||||||
|
{ pkgs, dsl, ... }: {
|
||||||
|
|
||||||
|
plugins = [ pkgs.vimPlugins.nvim-tree-lua pkgs.vimPlugins.nvim-web-devicons ];
|
||||||
|
|
||||||
|
# Disable netrw eagerly
|
||||||
|
# https://github.com/kyazdani42/nvim-tree.lua/commit/fb8735e96cecf004fbefb086ce85371d003c5129
|
||||||
|
vim.g = {
|
||||||
|
loaded = 1;
|
||||||
|
loaded_netrwPlugin = 1;
|
||||||
|
};
|
||||||
|
|
||||||
|
setup.nvim-tree = {
|
||||||
|
disable_netrw = true;
|
||||||
|
hijack_netrw = true;
|
||||||
|
update_focused_file = {
|
||||||
|
enable = true;
|
||||||
|
update_cwd = true;
|
||||||
|
ignore_list = { };
|
||||||
|
};
|
||||||
|
diagnostics = {
|
||||||
|
enable = true;
|
||||||
|
icons = {
|
||||||
|
hint = "";
|
||||||
|
info = "";
|
||||||
|
warning = "";
|
||||||
|
error = "";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
renderer = {
|
||||||
|
icons = {
|
||||||
|
glyphs = {
|
||||||
|
git = {
|
||||||
|
unstaged = "~";
|
||||||
|
staged = "+";
|
||||||
|
unmerged = "";
|
||||||
|
renamed = "➜";
|
||||||
|
deleted = "";
|
||||||
|
untracked = "?";
|
||||||
|
ignored = "◌";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
view = {
|
||||||
|
width = 30;
|
||||||
|
hide_root_folder = false;
|
||||||
|
side = "left";
|
||||||
|
mappings = {
|
||||||
|
custom_only = false;
|
||||||
|
list = [
|
||||||
|
{
|
||||||
|
key = [ "l" "<CR>" "o" ];
|
||||||
|
cb = dsl.rawLua
|
||||||
|
"require('nvim-tree.config').nvim_tree_callback('edit')";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
key = "h";
|
||||||
|
cb = dsl.rawLua
|
||||||
|
"require('nvim-tree.config').nvim_tree_callback('close_node')";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
key = "v";
|
||||||
|
cb = dsl.rawLua
|
||||||
|
"require('nvim-tree.config').nvim_tree_callback('vsplit')";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
number = false;
|
||||||
|
relativenumber = false;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
lua = ''
|
||||||
|
vim.keymap.set("n", "<Leader>e", ":NvimTreeFindFileToggle<CR>", { silent = true })
|
||||||
|
'';
|
||||||
|
|
||||||
|
}
|
@ -1,30 +1,20 @@
|
|||||||
{ config, pkgs, lib, ... }: {
|
{ config, pkgs, lib, ... }:
|
||||||
|
|
||||||
home-manager.users.${config.user} = {
|
let
|
||||||
|
|
||||||
home.packages = with pkgs; [
|
neovim = import ./package {
|
||||||
neovim
|
inherit pkgs;
|
||||||
gcc # for tree-sitter
|
colors = import config.theme.colors.neovimConfig { inherit pkgs; };
|
||||||
tree-sitter # for tree-sitter-gitignore parser
|
|
||||||
nodejs # for tree-sitter-gitignore parser
|
|
||||||
shfmt # used everywhere
|
|
||||||
shellcheck # used everywhere
|
|
||||||
];
|
|
||||||
|
|
||||||
xdg.configFile = {
|
|
||||||
"nvim/init.lua".source = ./init.lua;
|
|
||||||
"nvim/lua" = {
|
|
||||||
source = ./lua;
|
|
||||||
recursive = true; # Allows adding more files
|
|
||||||
};
|
|
||||||
"nvim/lua/packer/colors.lua".source = config.theme.colors.neovimConfig;
|
|
||||||
"nvim/lua/background.lua".text = ''
|
|
||||||
vim.o.background = "${
|
|
||||||
if config.theme.dark == true then "dark" else "light"
|
|
||||||
}"
|
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
in {
|
||||||
|
|
||||||
|
home-manager.users.${config.user} =
|
||||||
|
|
||||||
|
{
|
||||||
|
|
||||||
|
home.packages = [ neovim ];
|
||||||
|
|
||||||
programs.git.extraConfig.core.editor = "nvim";
|
programs.git.extraConfig.core.editor = "nvim";
|
||||||
home.sessionVariables = {
|
home.sessionVariables = {
|
||||||
EDITOR = "nvim";
|
EDITOR = "nvim";
|
||||||
@ -34,21 +24,16 @@
|
|||||||
shellAliases = { vim = "nvim"; };
|
shellAliases = { vim = "nvim"; };
|
||||||
shellAbbrs = {
|
shellAbbrs = {
|
||||||
v = lib.mkForce "nvim";
|
v = lib.mkForce "nvim";
|
||||||
vl = lib.mkForce "vim -c 'normal! `0' -c 'bdelete 1'";
|
vl = lib.mkForce "nvim -c 'normal! `0' -c 'bdelete 1'";
|
||||||
vll = "nvim -c 'Telescope oldfiles'";
|
vll = "nvim -c 'Telescope oldfiles'";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
programs.kitty.settings.scrollback_pager = lib.mkForce ''
|
||||||
# Always run packer.nvim sync
|
${neovim}/bin/nvim -c 'setlocal nonumber nolist showtabline=0 foldcolumn=0|Man!' -c "autocmd VimEnter * normal G" -'';
|
||||||
home.activation.nvimPackerSync =
|
|
||||||
config.home-manager.users.${config.user}.lib.dag.entryAfter
|
|
||||||
[ "writeBoundary" ] ''
|
|
||||||
$DRY_RUN_CMD ${pkgs.neovim}/bin/nvim --headless -c 'autocmd User PackerComplete quitall' -c 'PackerSync'
|
|
||||||
'';
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
# Used for icons in Vim
|
# # Used for icons in Vim
|
||||||
fonts.fonts = with pkgs; [ nerdfonts ];
|
# fonts.fonts = with pkgs; [ nerdfonts ];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -64,7 +64,6 @@ M.packer = function(use)
|
|||||||
})
|
})
|
||||||
|
|
||||||
-- Additional syntax sources
|
-- Additional syntax sources
|
||||||
use("bfontaine/Brewfile.vim") --- Brewfile syntax
|
|
||||||
use("chr4/nginx.vim") --- Nginx syntax
|
use("chr4/nginx.vim") --- Nginx syntax
|
||||||
use("towolf/vim-helm") --- Helm syntax
|
use("towolf/vim-helm") --- Helm syntax
|
||||||
use("rodjek/vim-puppet") --- Puppet syntax
|
use("rodjek/vim-puppet") --- Puppet syntax
|
||||||
|
@ -2,94 +2,15 @@
|
|||||||
-- Settings
|
-- Settings
|
||||||
-- ===========================================================================
|
-- ===========================================================================
|
||||||
|
|
||||||
vim.o.termguicolors = true --- Set to truecolor
|
|
||||||
vim.o.hidden = true --- Don't unload buffers when leaving them
|
|
||||||
vim.wo.number = true --- Show line numbers
|
|
||||||
vim.wo.relativenumber = true --- Relative numbers instead of absolute
|
|
||||||
vim.o.list = true --- Reveal whitespace with dashes
|
|
||||||
vim.o.expandtab = true --- Tabs into spaces
|
|
||||||
vim.o.shiftwidth = 4 --- Amount to shift with > key
|
|
||||||
vim.o.softtabstop = 4 --- Amount to shift with <TAB> key
|
|
||||||
vim.o.ignorecase = true --- Ignore case when searching
|
|
||||||
vim.o.smartcase = true --- Check case when using capitals in search
|
|
||||||
vim.o.infercase = true --- Don't match cases when completing suggestions
|
|
||||||
vim.o.incsearch = true --- Search while typing
|
|
||||||
vim.o.visualbell = true --- No sounds
|
|
||||||
vim.o.scrolljump = 1 --- Number of lines to scroll
|
|
||||||
vim.o.scrolloff = 3 --- Margin of lines to see while scrolling
|
|
||||||
vim.o.splitright = true --- Vertical splits on the right side
|
|
||||||
vim.o.splitbelow = true --- Horizontal splits on the bottom side
|
|
||||||
vim.o.pastetoggle = "<F3>" --- Use F3 to enter raw paste mode
|
|
||||||
vim.o.clipboard = "unnamedplus" --- Uses system clipboard for yanking
|
|
||||||
vim.o.updatetime = 300 --- Faster diagnostics
|
|
||||||
vim.o.mouse = "nv" --- Mouse interaction / scrolling
|
|
||||||
|
|
||||||
-- Neovim features
|
|
||||||
vim.o.inccommand = "split" --- Live preview search and replace
|
|
||||||
--- Required for nvim-cmp completion
|
|
||||||
vim.opt.completeopt = {
|
|
||||||
"menu",
|
|
||||||
"menuone",
|
|
||||||
"noselect",
|
|
||||||
}
|
|
||||||
|
|
||||||
-- Remember last position when reopening file
|
|
||||||
vim.api.nvim_exec(
|
|
||||||
[[
|
|
||||||
au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$") | exe "normal! g`\"" | endif
|
|
||||||
]],
|
|
||||||
false
|
|
||||||
)
|
|
||||||
|
|
||||||
-- Better backup, swap and undo storage
|
|
||||||
vim.o.backup = true --- Easier to recover and more secure
|
|
||||||
vim.bo.swapfile = false --- Instead of swaps, create backups
|
|
||||||
vim.bo.undofile = true --- Keeps undos after quit
|
|
||||||
|
|
||||||
-- Create backup directories if they don't exist
|
|
||||||
-- Should be fixed in 0.6 by https://github.com/neovim/neovim/pull/15433
|
|
||||||
vim.o.backupdir = vim.fn.stdpath("cache") .. "/backup"
|
|
||||||
vim.api.nvim_exec(
|
|
||||||
[[
|
|
||||||
if !isdirectory(&backupdir)
|
|
||||||
call mkdir(&backupdir, "p")
|
|
||||||
endif
|
|
||||||
]],
|
|
||||||
false
|
|
||||||
)
|
|
||||||
|
|
||||||
-- LaTeX options
|
|
||||||
vim.api.nvim_exec(
|
|
||||||
[[
|
|
||||||
au FileType tex inoremap ;bf \textbf{}<Esc>i
|
|
||||||
au BufWritePost *.tex silent! execute "!pdflatex -output-directory=%:p:h % >/dev/null 2>&1" | redraw!
|
|
||||||
]],
|
|
||||||
false
|
|
||||||
)
|
|
||||||
|
|
||||||
-- Highlight when yanking
|
|
||||||
vim.api.nvim_exec(
|
|
||||||
[[
|
|
||||||
au TextYankPost * silent! lua vim.highlight.on_yank { timeout = 250 }
|
|
||||||
]],
|
|
||||||
false
|
|
||||||
)
|
|
||||||
|
|
||||||
vim.filetype.add({
|
vim.filetype.add({
|
||||||
pattern = {
|
pattern = {
|
||||||
[".*%.tfvars"] = "terraform",
|
[".*%.tfvars"] = "terraform",
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
vim.api.nvim_create_autocmd("FileType", {
|
vim.api.nvim_create_autocmd("FileType", {
|
||||||
pattern = "*.eml",
|
pattern = "*.eml",
|
||||||
callback = function()
|
callback = function()
|
||||||
vim.o.wrapmargin = 79 -- Wrap text automatically
|
vim.o.wrapmargin = 79 -- Wrap text automatically
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
-- Netrw
|
|
||||||
vim.g.netrw_liststyle = 3 -- Change style to 'tree' view
|
|
||||||
vim.g.netrw_banner = 0 -- Remove useless banner
|
|
||||||
vim.g.netrw_winsize = 15 -- Explore window takes % of page
|
|
||||||
vim.g.netrw_browse_split = 4 -- Open in previous window
|
|
||||||
vim.g.netrw_altv = 1 -- Always split left
|
|
||||||
|
46
modules/neovim/package/default.nix
Normal file
46
modules/neovim/package/default.nix
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
# { inputs, globals, extraConfig ? [ ], ... }:
|
||||||
|
#
|
||||||
|
# let
|
||||||
|
#
|
||||||
|
# pkgs = import inputs.nixpkgs {
|
||||||
|
# system = inputs.system;
|
||||||
|
# overlays = [
|
||||||
|
# (import ./modules/neovim/plugins-overlay.nix inputs)
|
||||||
|
# inputs.nix2vim.overlay
|
||||||
|
# ];
|
||||||
|
# };
|
||||||
|
#
|
||||||
|
# in pkgs.neovimBuilder {
|
||||||
|
# package = pkgs.neovim-unwrapped;
|
||||||
|
# imports = [
|
||||||
|
# ./modules/neovim/plugins/bufferline.nix
|
||||||
|
# ./modules/neovim/plugins/completion.nix
|
||||||
|
# ./modules/neovim/plugins/gitsigns.nix
|
||||||
|
# ./modules/neovim/plugins/lsp.nix
|
||||||
|
# ./modules/neovim/plugins/misc.nix
|
||||||
|
# ./modules/neovim/plugins/statusline.nix
|
||||||
|
# ./modules/neovim/plugins/syntax.nix
|
||||||
|
# ./modules/neovim/plugins/telescope.nix
|
||||||
|
# ./modules/neovim/plugins/toggleterm.nix
|
||||||
|
# ./modules/neovim/plugins/tree.nix
|
||||||
|
# ] ++ extraConfig;
|
||||||
|
# }
|
||||||
|
|
||||||
|
{ pkgs, colors ? { }, ... }:
|
||||||
|
|
||||||
|
pkgs.neovimBuilder {
|
||||||
|
package = pkgs.neovim-unwrapped;
|
||||||
|
imports = [
|
||||||
|
../config/bufferline.nix
|
||||||
|
../config/completion.nix
|
||||||
|
../config/gitsigns.nix
|
||||||
|
../config/lsp.nix
|
||||||
|
../config/misc.nix
|
||||||
|
../config/statusline.nix
|
||||||
|
../config/syntax.nix
|
||||||
|
../config/telescope.nix
|
||||||
|
../config/toggleterm.nix
|
||||||
|
../config/tree.nix
|
||||||
|
colors
|
||||||
|
];
|
||||||
|
}
|
42
modules/neovim/plugins-overlay.nix
Normal file
42
modules/neovim/plugins-overlay.nix
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
# Adopted from here: https://github.com/DieracDelta/vimconfig/blob/801b62dd56cfee59574639904a6c95b525725f66/plugins.nix
|
||||||
|
|
||||||
|
inputs: final: prev:
|
||||||
|
|
||||||
|
let
|
||||||
|
|
||||||
|
# Use nixpkgs vimPlugin but with source directly from plugin author
|
||||||
|
withSrc = pkg: src: pkg.overrideAttrs (_: { inherit src; });
|
||||||
|
|
||||||
|
# Package plugin
|
||||||
|
plugin = pname: src:
|
||||||
|
prev.vimUtils.buildVimPluginFrom2Nix {
|
||||||
|
inherit pname src;
|
||||||
|
version = "master";
|
||||||
|
};
|
||||||
|
|
||||||
|
in {
|
||||||
|
|
||||||
|
nil = inputs.nil.packages.${prev.system}.nil;
|
||||||
|
|
||||||
|
nvim-lspconfig =
|
||||||
|
(withSrc prev.vimPlugins.nvim-lspconfig inputs.nvim-lspconfig);
|
||||||
|
cmp-nvim-lsp = (withSrc prev.vimPlugins.cmp-nvim-lsp inputs.cmp-nvim-lsp);
|
||||||
|
null-ls-nvim = (withSrc prev.vimPlugins.null-ls-nvim inputs.null-ls-nvim);
|
||||||
|
comment-nvim = (withSrc prev.vimPlugins.comment-nvim inputs.comment-nvim);
|
||||||
|
nvim-treesitter =
|
||||||
|
(withSrc prev.vimPlugins.nvim-treesitter inputs.nvim-treesitter);
|
||||||
|
telescope-nvim =
|
||||||
|
(withSrc prev.vimPlugins.telescope-nvim inputs.telescope-nvim);
|
||||||
|
telescope-project-nvim = (withSrc prev.vimPlugins.telescope-project-nvim
|
||||||
|
inputs.telescope-project-nvim);
|
||||||
|
toggleterm-nvim =
|
||||||
|
(withSrc prev.vimPlugins.toggleterm-nvim inputs.toggleterm-nvim);
|
||||||
|
bufferline-nvim =
|
||||||
|
(withSrc prev.vimPlugins.bufferline-nvim inputs.bufferline-nvim);
|
||||||
|
nvim-tree-lua = (withSrc prev.vimPlugins.nvim-tree-lua inputs.nvim-tree-lua);
|
||||||
|
|
||||||
|
# Packaging plugins with Nix
|
||||||
|
# comment-nvim = plugin "comment-nvim" comment-nvim-src;
|
||||||
|
# plenary-nvim = plugin "plenary-nvim" plenary-nvim-src;
|
||||||
|
|
||||||
|
}
|
@ -5,6 +5,7 @@
|
|||||||
passwordHash = lib.mkOption {
|
passwordHash = lib.mkOption {
|
||||||
type = lib.types.nullOr lib.types.str;
|
type = lib.types.nullOr lib.types.str;
|
||||||
description = "Password created with mkpasswd -m sha-512";
|
description = "Password created with mkpasswd -m sha-512";
|
||||||
|
default = null;
|
||||||
# Test it by running: mkpasswd -m sha-512 --salt "PZYiMGmJIIHAepTM"
|
# Test it by running: mkpasswd -m sha-512 --salt "PZYiMGmJIIHAepTM"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -4,7 +4,6 @@
|
|||||||
|
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
kubectl # Basic Kubernetes queries
|
kubectl # Basic Kubernetes queries
|
||||||
k9s # Terminal Kubernetes UI
|
|
||||||
kubernetes-helm # Helm CLI
|
kubernetes-helm # Helm CLI
|
||||||
fluxcd # Bootstrap clusters with Flux
|
fluxcd # Bootstrap clusters with Flux
|
||||||
kustomize # Kustomize CLI (for Flux)
|
kustomize # Kustomize CLI (for Flux)
|
||||||
@ -19,6 +18,123 @@
|
|||||||
ks = "k9s";
|
ks = "k9s";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# Terminal Kubernetes UI
|
||||||
|
programs.k9s = {
|
||||||
|
enable = true;
|
||||||
|
# settings = { k9s = { headless = true; }; };
|
||||||
|
skin = {
|
||||||
|
k9s = {
|
||||||
|
body = {
|
||||||
|
fgColor = config.theme.colors.base06;
|
||||||
|
bgColor = config.theme.colors.base00;
|
||||||
|
logoColor = config.theme.colors.base02; # *blue ?
|
||||||
|
};
|
||||||
|
# Search bar
|
||||||
|
prompt = {
|
||||||
|
fgColor = config.theme.colors.base06;
|
||||||
|
bgColor = config.theme.colors.base00;
|
||||||
|
suggestColor = config.theme.colors.base03;
|
||||||
|
};
|
||||||
|
# Header left side
|
||||||
|
info = {
|
||||||
|
fgColor = config.theme.colors.base04;
|
||||||
|
sectionColor = config.theme.colors.base05;
|
||||||
|
};
|
||||||
|
dialog = {
|
||||||
|
fgColor = config.theme.colors.base06;
|
||||||
|
bgColor = config.theme.colors.base00;
|
||||||
|
buttonFgColor = config.theme.colors.base06;
|
||||||
|
buttonBgColor = config.theme.colors.base0E;
|
||||||
|
buttonFocusFgColor = config.theme.colors.base07;
|
||||||
|
buttonFocusBgColor = config.theme.colors.base02; # *cyan
|
||||||
|
labelFgColor = config.theme.colors.base09;
|
||||||
|
fieldFgColor = config.theme.colors.base06;
|
||||||
|
};
|
||||||
|
frame = {
|
||||||
|
border = {
|
||||||
|
fgColor = config.theme.colors.base01;
|
||||||
|
focusColor = config.theme.colors.base06;
|
||||||
|
};
|
||||||
|
menu = {
|
||||||
|
fgColor = config.theme.colors.base06;
|
||||||
|
keyColor = config.theme.colors.base0E; # *magenta
|
||||||
|
numKeyColor = config.theme.colors.base0E; # *magenta
|
||||||
|
};
|
||||||
|
crumbs = {
|
||||||
|
fgColor = config.theme.colors.base06;
|
||||||
|
bgColor = config.theme.colors.base01;
|
||||||
|
activeColor = config.theme.colors.base03;
|
||||||
|
};
|
||||||
|
status = {
|
||||||
|
newColor = config.theme.colors.base04; # *cyan
|
||||||
|
modifyColor = config.theme.colors.base0D; # *blue
|
||||||
|
addColor = config.theme.colors.base0B; # *green
|
||||||
|
errorColor = config.theme.colors.base08; # *red
|
||||||
|
highlightColor = config.theme.colors.base09; # *orange
|
||||||
|
killColor = config.theme.colors.base03; # *comment
|
||||||
|
completedColor = config.theme.colors.base03; # *comment
|
||||||
|
};
|
||||||
|
title = {
|
||||||
|
fgColor = config.theme.colors.base06;
|
||||||
|
bgColor = config.theme.colors.base00;
|
||||||
|
highlightColor = config.theme.colors.base09; # *orange
|
||||||
|
counterColor = config.theme.colors.base0D; # *blue
|
||||||
|
filterColor = config.theme.colors.base0E; # *magenta
|
||||||
|
};
|
||||||
|
};
|
||||||
|
views = {
|
||||||
|
charts = {
|
||||||
|
bgColor = config.theme.colors.base00;
|
||||||
|
defaultDialColors =
|
||||||
|
[ config.theme.colors.base0D config.theme.colors.base08 ];
|
||||||
|
# - *blue
|
||||||
|
# - *red
|
||||||
|
defaultChartColors =
|
||||||
|
[ config.theme.colors.base0D config.theme.colors.base08 ];
|
||||||
|
# - *blue
|
||||||
|
# - *red
|
||||||
|
};
|
||||||
|
table = {
|
||||||
|
# List of resources
|
||||||
|
fgColor = config.theme.colors.base06;
|
||||||
|
bgColor = config.theme.colors.base00;
|
||||||
|
|
||||||
|
# Row selection
|
||||||
|
cursorFgColor = config.theme.colors.base07;
|
||||||
|
cursorBgColor = config.theme.colors.base01;
|
||||||
|
|
||||||
|
# Header row
|
||||||
|
header = {
|
||||||
|
fgColor = config.theme.colors.base0D;
|
||||||
|
bgColor = config.theme.colors.base00;
|
||||||
|
sorterColor = config.theme.colors.base0A; # *selection
|
||||||
|
};
|
||||||
|
};
|
||||||
|
xray = {
|
||||||
|
fgColor = config.theme.colors.base06;
|
||||||
|
bgColor = config.theme.colors.base00;
|
||||||
|
cursorColor = config.theme.colors.base06;
|
||||||
|
graphicColor = config.theme.colors.base0D;
|
||||||
|
showIcons = false;
|
||||||
|
};
|
||||||
|
yaml = {
|
||||||
|
keyColor = config.theme.colors.base0D;
|
||||||
|
colonColor = config.theme.colors.base04;
|
||||||
|
fgColor = config.theme.colors.base03;
|
||||||
|
};
|
||||||
|
logs = {
|
||||||
|
fgColor = config.theme.colors.base06;
|
||||||
|
bgColor = config.theme.colors.base00;
|
||||||
|
indicator = {
|
||||||
|
fgColor = config.theme.colors.base06;
|
||||||
|
bgColor = config.theme.colors.base00;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
services.nextcloud = {
|
services.nextcloud = {
|
||||||
enable = true;
|
enable = true;
|
||||||
package = pkgs.nextcloud24; # Required to specify
|
package = pkgs.nextcloud25; # Required to specify
|
||||||
https = true;
|
https = true;
|
||||||
hostName = "localhost";
|
hostName = "localhost";
|
||||||
maxUploadSize = "50G";
|
maxUploadSize = "50G";
|
||||||
|
@ -8,6 +8,10 @@
|
|||||||
config = {
|
config = {
|
||||||
|
|
||||||
services.grafana.enable = true;
|
services.grafana.enable = true;
|
||||||
|
|
||||||
|
# Required to fix error in latest nixpkgs
|
||||||
|
services.grafana.settings = { };
|
||||||
|
|
||||||
services.prometheus = {
|
services.prometheus = {
|
||||||
enable = true;
|
enable = true;
|
||||||
exporters.node.enable = true;
|
exporters.node.enable = true;
|
||||||
|
@ -50,6 +50,10 @@
|
|||||||
}];
|
}];
|
||||||
}];
|
}];
|
||||||
|
|
||||||
|
# Caddy and Transmission both try to set rmem_max for larger UDP packets.
|
||||||
|
# We will choose Transmission's recommendation (4 MB).
|
||||||
|
boot.kernel.sysctl."net.core.rmem_max" = 4194304;
|
||||||
|
|
||||||
# Allow inbound connections to reach namespace
|
# Allow inbound connections to reach namespace
|
||||||
systemd.services.transmission-web-netns = {
|
systemd.services.transmission-web-netns = {
|
||||||
description = "Forward to transmission in wireguard namespace";
|
description = "Forward to transmission in wireguard namespace";
|
||||||
|
@ -52,6 +52,7 @@ in {
|
|||||||
handle = [{
|
handle = [{
|
||||||
handler = "reverse_proxy";
|
handler = "reverse_proxy";
|
||||||
upstreams = [{ dial = "localhost:8222"; }];
|
upstreams = [{ dial = "localhost:8222"; }];
|
||||||
|
headers.request.add."X-Real-IP" = [ "{http.request.remote.host}" ];
|
||||||
}];
|
}];
|
||||||
}];
|
}];
|
||||||
|
|
||||||
|
@ -1,20 +1,20 @@
|
|||||||
diff --git a/cps/__init__.py b/cps/__init__.py
|
diff --git a/cps/__init__.py b/cps/__init__.py
|
||||||
index 0b912d23..ad5d1fa9 100644
|
index 1ba1f778..da0bc718 100644
|
||||||
--- a/cps/__init__.py
|
--- a/cps/__init__.py
|
||||||
+++ b/cps/__init__.py
|
+++ b/cps/__init__.py
|
||||||
@@ -83,7 +83,6 @@ app.config.update(
|
@@ -100,7 +100,6 @@ updater_thread = Updater()
|
||||||
lm = MyLoginManager()
|
def create_app():
|
||||||
lm.login_view = 'web.login'
|
lm.login_view = 'web.login'
|
||||||
lm.anonymous_user = ub.Anonymous
|
lm.anonymous_user = ub.Anonymous
|
||||||
- lm.session_protection = 'strong'
|
- lm.session_protection = 'strong'
|
||||||
|
|
||||||
if wtf_present:
|
if csrf:
|
||||||
csrf = CSRFProtect()
|
csrf.init_app(app)
|
||||||
diff --git a/cps/admin.py b/cps/admin.py
|
diff --git a/cps/admin.py b/cps/admin.py
|
||||||
index 1004ee78..e295066e 100644
|
index 09a553b4..5c646e46 100644
|
||||||
--- a/cps/admin.py
|
--- a/cps/admin.py
|
||||||
+++ b/cps/admin.py
|
+++ b/cps/admin.py
|
||||||
@@ -98,8 +98,6 @@ def before_request():
|
@@ -104,8 +104,6 @@ def before_request():
|
||||||
# make remember me function work
|
# make remember me function work
|
||||||
if current_user.is_authenticated:
|
if current_user.is_authenticated:
|
||||||
confirm_login()
|
confirm_login()
|
||||||
|
Reference in New Issue
Block a user