Compare commits
4 Commits
a5ae2a4d93
...
551e27f6e4
Author | SHA1 | Date | |
---|---|---|---|
551e27f6e4 | |||
5cd56ddcf3 | |||
b8c758615b | |||
2599d9ddfa |
232
flake.lock
232
flake.lock
@ -1,5 +1,42 @@
|
||||
{
|
||||
"nodes": {
|
||||
"flake-compat": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1650374568,
|
||||
"narHash": "sha256-Z+s0J8/r907g149rllvwhb4pKi8Wam5ij0st8PwAh+E=",
|
||||
"owner": "edolstra",
|
||||
"repo": "flake-compat",
|
||||
"rev": "b4a34015c698c7793d592d66adbab377907a2be8",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "edolstra",
|
||||
"repo": "flake-compat",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-parts": {
|
||||
"inputs": {
|
||||
"nixpkgs-lib": [
|
||||
"nixvim",
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1754487366,
|
||||
"narHash": "sha256-pHYj8gUBapuUzKV/kN/tR3Zvqc7o6gdFB9XKXIp1SQ8=",
|
||||
"owner": "hercules-ci",
|
||||
"repo": "flake-parts",
|
||||
"rev": "af66ad14b28a127c5c0f3bbb298218fc63528a18",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "hercules-ci",
|
||||
"repo": "flake-parts",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-utils": {
|
||||
"inputs": {
|
||||
"systems": "systems"
|
||||
@ -18,13 +55,98 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-utils-plus": {
|
||||
"inputs": {
|
||||
"flake-utils": "flake-utils_2"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1715533576,
|
||||
"narHash": "sha256-fT4ppWeCJ0uR300EH3i7kmgRZnAVxrH+XtK09jQWihk=",
|
||||
"owner": "gytis-ivaskevicius",
|
||||
"repo": "flake-utils-plus",
|
||||
"rev": "3542fe9126dc492e53ddd252bb0260fe035f2c0f",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "gytis-ivaskevicius",
|
||||
"repo": "flake-utils-plus",
|
||||
"rev": "3542fe9126dc492e53ddd252bb0260fe035f2c0f",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-utils_2": {
|
||||
"inputs": {
|
||||
"systems": "systems_3"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1694529238,
|
||||
"narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "ff7b65b44d01cf9ba6a71320833626af21126384",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"home-manager": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1755491080,
|
||||
"narHash": "sha256-ib1Xi13NEalrFqQAHceRsb+6aIPANFuQq80SS/bY10M=",
|
||||
"owner": "nix-community",
|
||||
"repo": "home-manager",
|
||||
"rev": "f8af2cbe386f9b96dd9efa57ab15a09377f38f4d",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-community",
|
||||
"repo": "home-manager",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"ixx": {
|
||||
"inputs": {
|
||||
"flake-utils": [
|
||||
"nixvim",
|
||||
"nuschtosSearch",
|
||||
"flake-utils"
|
||||
],
|
||||
"nixpkgs": [
|
||||
"nixvim",
|
||||
"nuschtosSearch",
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1748294338,
|
||||
"narHash": "sha256-FVO01jdmUNArzBS7NmaktLdGA5qA3lUMJ4B7a05Iynw=",
|
||||
"owner": "NuschtOS",
|
||||
"repo": "ixx",
|
||||
"rev": "cc5f390f7caf265461d4aab37e98d2292ebbdb85",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NuschtOS",
|
||||
"ref": "v0.0.8",
|
||||
"repo": "ixx",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1751984180,
|
||||
"narHash": "sha256-LwWRsENAZJKUdD3SpLluwDmdXY9F45ZEgCb0X+xgOL0=",
|
||||
"lastModified": 1755186698,
|
||||
"narHash": "sha256-wNO3+Ks2jZJ4nTHMuks+cxAiVBGNuEBXsT29Bz6HASo=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "9807714d6944a957c2e036f84b0ff8caf9930bc0",
|
||||
"rev": "fbcf476f790d8a217c3eab4e12033dc4a0f6d23c",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@ -34,10 +156,80 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"nixvim": {
|
||||
"inputs": {
|
||||
"flake-parts": "flake-parts",
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
],
|
||||
"nuschtosSearch": "nuschtosSearch",
|
||||
"systems": "systems_2"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1755095763,
|
||||
"narHash": "sha256-cFwtMaONA4uKYk/rBrmFvIAQieZxZytoprzIblTn1HA=",
|
||||
"owner": "nix-community",
|
||||
"repo": "nixvim",
|
||||
"rev": "ecc7880e00a2a735074243d8a664a931d73beace",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-community",
|
||||
"repo": "nixvim",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nuschtosSearch": {
|
||||
"inputs": {
|
||||
"flake-utils": "flake-utils",
|
||||
"nixpkgs": "nixpkgs"
|
||||
"ixx": "ixx",
|
||||
"nixpkgs": [
|
||||
"nixvim",
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1754301638,
|
||||
"narHash": "sha256-aRgzcPDd2axHFOuMlPLuzmDptUM2JU8mUL3jfgbBeyc=",
|
||||
"owner": "NuschtOS",
|
||||
"repo": "search",
|
||||
"rev": "a60091045273484c040a91f5c229ba298f8ecc27",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NuschtOS",
|
||||
"repo": "search",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"home-manager": "home-manager",
|
||||
"nixpkgs": "nixpkgs",
|
||||
"nixvim": "nixvim",
|
||||
"snowfall-lib": "snowfall-lib"
|
||||
}
|
||||
},
|
||||
"snowfall-lib": {
|
||||
"inputs": {
|
||||
"flake-compat": "flake-compat",
|
||||
"flake-utils-plus": "flake-utils-plus",
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1736130495,
|
||||
"narHash": "sha256-4i9nAJEZFv7vZMmrE0YG55I3Ggrtfo5/T07JEpEZ/RM=",
|
||||
"owner": "snowfallorg",
|
||||
"repo": "lib",
|
||||
"rev": "02d941739f98a09e81f3d2d9b3ab08918958beac",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "snowfallorg",
|
||||
"repo": "lib",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"systems": {
|
||||
@ -54,6 +246,36 @@
|
||||
"repo": "default",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"systems_2": {
|
||||
"locked": {
|
||||
"lastModified": 1681028828,
|
||||
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"systems_3": {
|
||||
"locked": {
|
||||
"lastModified": 1681028828,
|
||||
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"type": "github"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
|
49
flake.nix
49
flake.nix
@ -1,28 +1,35 @@
|
||||
{
|
||||
description = "Yadunand's Configuration";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||
flake-utils.url = "github:numtide/flake-utils";
|
||||
snowfall-lib = {
|
||||
url = "github:snowfallorg/lib";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
home-manager = {
|
||||
url = "github:nix-community/home-manager";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
nixvim = {
|
||||
url = "github:nix-community/nixvim";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
outputs =
|
||||
{
|
||||
self,
|
||||
nixpkgs,
|
||||
flake-utils,
|
||||
}:
|
||||
{
|
||||
lib = {
|
||||
users = import ./users.nix;
|
||||
inputs:
|
||||
inputs.snowfall-lib.mkFlake {
|
||||
inherit inputs;
|
||||
src = ./.;
|
||||
snowfall = {
|
||||
namespace = "snowfall";
|
||||
};
|
||||
}
|
||||
// flake-utils.lib.eachDefaultSystem (
|
||||
system:
|
||||
let
|
||||
pkgs = import nixpkgs { inherit system; };
|
||||
in
|
||||
{
|
||||
devShells.default = pkgs.mkShell {
|
||||
buildInputs = [ pkgs.nixd ];
|
||||
};
|
||||
}
|
||||
);
|
||||
channels-config = {
|
||||
allowUnfree = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
57
homes/aarch64-darwin/yadunut@yadunut-mbp/default.nix
Normal file
57
homes/aarch64-darwin/yadunut@yadunut-mbp/default.nix
Normal file
@ -0,0 +1,57 @@
|
||||
{
|
||||
lib,
|
||||
pkgs,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
{
|
||||
# This value determines the Home Manager release that your configuration is
|
||||
# compatible with. This helps avoid breakage when a new Home Manager release
|
||||
# introduces backwards incompatible changes.
|
||||
#
|
||||
# You should not change this value, even if you update Home Manager. If you do
|
||||
# want to update the value, then make sure to first check the Home Manager
|
||||
# release notes.
|
||||
home.stateVersion = "23.11"; # Please read the comment before changing.
|
||||
|
||||
home.packages = [
|
||||
# pkgs.dive
|
||||
pkgs.entr
|
||||
pkgs.jq
|
||||
pkgs.just
|
||||
pkgs.rsync
|
||||
pkgs.claude-code
|
||||
pkgs.devenv
|
||||
pkgs.dive
|
||||
];
|
||||
|
||||
home.sessionVariables = {
|
||||
JAVA_HOME = "/Library/Java/JavaVirtualMachines/zulu-17.jdk/Contents/Home";
|
||||
ANDROID_HOME = "$HOME/Library/Android/sdk";
|
||||
};
|
||||
|
||||
home.sessionPath = [
|
||||
"$ANDROID_HOME/emulator"
|
||||
"$ANDROID_HOME/platform-tools"
|
||||
"/opt/homebrew/bin"
|
||||
];
|
||||
|
||||
zsh.enable = true;
|
||||
neovim.enable = true;
|
||||
git = {
|
||||
enable = true;
|
||||
gpgProgram = "/Applications/1Password.app/Contents/MacOS/op-ssh-sign";
|
||||
signingKey = "~/.ssh/yadunut_ed25519.pub";
|
||||
};
|
||||
|
||||
# Let Home Manager install and manage itself.
|
||||
programs.home-manager.enable = true;
|
||||
|
||||
targets.darwin = {
|
||||
defaults."com.apple.dock".autohide = true;
|
||||
defaults."com.apple.finder".AppleShowAllFiles = true;
|
||||
defaults.NSGlobalDomain.AppleShowAllExtensions = true;
|
||||
defaults.NSGlobalDomain.KeyRepeat = 2;
|
||||
defaults.NSGlobalDomain.ApplePressAndHoldEnabled = false;
|
||||
};
|
||||
}
|
114
modules/home/git/default.nix
Normal file
114
modules/home/git/default.nix
Normal file
@ -0,0 +1,114 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
cfg = config.git;
|
||||
inherit (lib) mkEnableOption mkIf mkOption;
|
||||
types = lib.types;
|
||||
name = "Yadunand Prem";
|
||||
email = "yadunand@yadunut.com";
|
||||
in
|
||||
{
|
||||
options.git = {
|
||||
enable = mkEnableOption "Git";
|
||||
gpgProgram = mkOption {
|
||||
default = null;
|
||||
type = types.nullOr types.str;
|
||||
};
|
||||
signingKey = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
default = null;
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
|
||||
home.packages = with pkgs; [
|
||||
git
|
||||
lazygit
|
||||
jujutsu
|
||||
delta
|
||||
];
|
||||
|
||||
programs.zsh.shellAliases = {
|
||||
lg = "lazygit";
|
||||
};
|
||||
programs.git = {
|
||||
ignores = [
|
||||
".DS_Store"
|
||||
".direnv/"
|
||||
".envrc"
|
||||
"**/.claude/settings.local.json"
|
||||
];
|
||||
enable = true;
|
||||
userEmail = email;
|
||||
userName = name;
|
||||
delta.enable = true;
|
||||
lfs.enable = true;
|
||||
|
||||
extraConfig = lib.mkMerge [
|
||||
{
|
||||
init.defaultBranch = "main";
|
||||
|
||||
pull.rebase = true;
|
||||
pull.autostash = true;
|
||||
|
||||
rebase.autostash = true;
|
||||
rebase.autosquash = true;
|
||||
|
||||
push.autoSetupRemote = true;
|
||||
|
||||
commit.gpgsign = true;
|
||||
commit.verbose = true;
|
||||
|
||||
# merge.conflictstyle = "zdiff2";
|
||||
diff.colorMoved = true;
|
||||
diff.algorithm = "histogram";
|
||||
feature.experimental = true;
|
||||
branch.sort = "committerdate";
|
||||
diff.mnemonicPrefix = true;
|
||||
fetch.all = true;
|
||||
column.ui = "auto";
|
||||
tags.sort = "version:refname";
|
||||
push.followTags = true;
|
||||
|
||||
rerere.enabled = true;
|
||||
rerere.autoupdate = true;
|
||||
|
||||
rebase.updateRefs = true;
|
||||
|
||||
credential.helper = [
|
||||
"${pkgs.git-credential-oauth}/bin/git-credential-oauth"
|
||||
];
|
||||
gpg.format = "ssh";
|
||||
credential = {
|
||||
"https://git.yadunut.dev" = {
|
||||
oauthClientId = "a4792ccc-144e-407e-86c9-5e7d8d9c3269";
|
||||
oauthScopes = "read:repository write:repository";
|
||||
oauthAuthURL = "/login/oauth/authorize";
|
||||
oauthTokenURL = "/login/oauth/access_token";
|
||||
};
|
||||
};
|
||||
}
|
||||
(mkIf (cfg.gpgProgram != null) { gpg.ssh.program = cfg.gpgProgram; })
|
||||
(mkIf (cfg.signingKey != null) { user.signingkey = cfg.signingKey; })
|
||||
];
|
||||
};
|
||||
|
||||
programs.jujutsu = {
|
||||
enable = true;
|
||||
settings = {
|
||||
user = {
|
||||
name = name;
|
||||
email = email;
|
||||
};
|
||||
ui.default-command = "log";
|
||||
};
|
||||
};
|
||||
programs.gh.enable = true;
|
||||
};
|
||||
|
||||
}
|
484
modules/home/neovim/default.nix
Normal file
484
modules/home/neovim/default.nix
Normal file
@ -0,0 +1,484 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
inputs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
cfg = config.neovim;
|
||||
inherit (lib) mkEnableOption mkIf mkOption;
|
||||
in
|
||||
{
|
||||
options.neovim = {
|
||||
enable = mkEnableOption "Neovim";
|
||||
nix.enable = mkOption {
|
||||
default = true;
|
||||
description = "Enable nix related vim packages";
|
||||
type = lib.types.bool;
|
||||
};
|
||||
performance.enable = mkOption {
|
||||
default = false;
|
||||
description = "Enable performance options";
|
||||
type = lib.types.bool;
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
imports = [ inputs.nixvim.homeModules.nixvim ];
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home.sessionVariables = {
|
||||
EDITOR = "nvim";
|
||||
VISUAL = "nvim";
|
||||
};
|
||||
|
||||
home.packages = [
|
||||
pkgs.vscode-langservers-extracted # for neovim
|
||||
pkgs.deno # for neovim
|
||||
pkgs.rust-analyzer # for neovim
|
||||
]
|
||||
++ (
|
||||
if cfg.nix.enable then
|
||||
with pkgs;
|
||||
[
|
||||
nixd
|
||||
nixfmt-rfc-style
|
||||
]
|
||||
|
||||
else
|
||||
[ ]
|
||||
);
|
||||
programs.nixvim = {
|
||||
enable = true;
|
||||
|
||||
performance = mkIf cfg.performance.enable {
|
||||
combinePlugins.enable = true;
|
||||
byteCompileLua = {
|
||||
enable = true;
|
||||
nvimRuntime = true;
|
||||
plugins = true;
|
||||
};
|
||||
};
|
||||
|
||||
defaultEditor = true;
|
||||
colorschemes.gruvbox.enable = true;
|
||||
plugins = {
|
||||
flash.enable = true;
|
||||
oil.enable = true;
|
||||
neogit.enable = true;
|
||||
image = {
|
||||
enable = true;
|
||||
settings = {
|
||||
backend = "kitty";
|
||||
};
|
||||
};
|
||||
lsp = {
|
||||
enable = true;
|
||||
servers = {
|
||||
# gleam.enable = true;
|
||||
ts_ls.enable = true; # TS/JS
|
||||
biome.enable = true; # TS/JS
|
||||
pyright.enable = true; # Python
|
||||
ruff.enable = true; # python
|
||||
nixd = mkIf cfg.nix.enable {
|
||||
enable = true;
|
||||
extraOptions.settings.nixd = {
|
||||
formatting.command = "nixfmt";
|
||||
};
|
||||
};
|
||||
cssls.enable = true;
|
||||
jsonls.enable = true;
|
||||
html.enable = true;
|
||||
tinymist.enable = true;
|
||||
texlab = {
|
||||
enable = true;
|
||||
settings = {
|
||||
texlab.build = {
|
||||
executable = "tectonic";
|
||||
args = [
|
||||
"-X"
|
||||
"compile"
|
||||
"%f"
|
||||
"--synctex"
|
||||
"--keep-logs"
|
||||
"--keep-intermediates"
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
keymaps.lspBuf = {
|
||||
gd = {
|
||||
action = "definition";
|
||||
desc = "Goto Definition";
|
||||
};
|
||||
gr = {
|
||||
action = "references";
|
||||
desc = "Goto References";
|
||||
};
|
||||
gD = {
|
||||
action = "declaration";
|
||||
desc = "Goto Declaration";
|
||||
};
|
||||
gI = {
|
||||
action = "implementation";
|
||||
desc = "Goto Implementation";
|
||||
};
|
||||
gT = {
|
||||
action = "type_definition";
|
||||
desc = "Type Definition";
|
||||
};
|
||||
K = {
|
||||
action = "hover";
|
||||
desc = "Hover";
|
||||
};
|
||||
"<leader>rn" = {
|
||||
action = "rename";
|
||||
desc = "Rename";
|
||||
};
|
||||
};
|
||||
keymaps.extra = [
|
||||
{
|
||||
action.__raw = "vim.lsp.buf.code_action";
|
||||
key = "<leader>la";
|
||||
}
|
||||
{
|
||||
action.__raw = "function() vim.lsp.buf.format { async = true } end";
|
||||
key = "<leader>lf";
|
||||
}
|
||||
];
|
||||
keymaps.diagnostic = {
|
||||
"<leader>cd" = {
|
||||
action = "open_float";
|
||||
desc = "Line Diagnostics";
|
||||
};
|
||||
"[d" = {
|
||||
action = "goto_next";
|
||||
desc = "Next Diagnostic";
|
||||
};
|
||||
"]d" = {
|
||||
action = "goto_prev";
|
||||
desc = "Previous Diagnostic";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
trouble.enable = true;
|
||||
cmp = {
|
||||
enable = true;
|
||||
autoEnableSources = true;
|
||||
settings = {
|
||||
sources = [
|
||||
{ name = "nvim_lsp"; }
|
||||
{ name = "nvim_lua"; }
|
||||
# {name = "emoji";}
|
||||
{
|
||||
name = "buffer";
|
||||
option.get_bufnrs.__raw = "vim.api.nvim_list_bufs";
|
||||
keywordLength = 3;
|
||||
}
|
||||
{
|
||||
name = "path";
|
||||
keywordLength = 3;
|
||||
}
|
||||
{
|
||||
name = "luasnip";
|
||||
keywordLength = 3;
|
||||
}
|
||||
];
|
||||
window = {
|
||||
# completion = { border = "solid"; };
|
||||
# documentation = { border = "solid"; };
|
||||
};
|
||||
mapping = {
|
||||
"<C-n>" = "cmp.mapping.select_next_item()";
|
||||
"<C-p>" = "cmp.mapping.select_prev_item()";
|
||||
"<C-e>" = "cmp.mapping.abort()";
|
||||
"<C-b>" = "cmp.mapping.scroll_docs(-4)";
|
||||
"<C-f>" = "cmp.mapping.scroll_docs(4)";
|
||||
"<C-Space>" = "cmp.mapping.complete()";
|
||||
"<CR>" = "cmp.mapping.confirm({ select = true })";
|
||||
"<S-CR>" = "cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Replace, select = true })";
|
||||
};
|
||||
};
|
||||
};
|
||||
cmp-nvim-lsp.enable = true;
|
||||
cmp-nvim-lua.enable = true;
|
||||
cmp-buffer.enable = true;
|
||||
cmp-path.enable = true;
|
||||
cmp_luasnip.enable = true;
|
||||
cmp-cmdline.enable = true;
|
||||
nvim-tree = {
|
||||
enable = true;
|
||||
settings = {
|
||||
view.side = "right";
|
||||
update_focused_file.enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
friendly-snippets.enable = true;
|
||||
|
||||
luasnip = {
|
||||
enable = true;
|
||||
settings = {
|
||||
enable_autosnippets = true;
|
||||
store_selection_keys = "<Tab>";
|
||||
};
|
||||
fromVscode = [
|
||||
{
|
||||
lazyLoad = true;
|
||||
paths = "${pkgs.vimPlugins.friendly-snippets}";
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
bufferline.enable = true;
|
||||
|
||||
treesitter = {
|
||||
enable = true;
|
||||
folding = true;
|
||||
grammarPackages = with pkgs.vimPlugins.nvim-treesitter.builtGrammars; [
|
||||
bash
|
||||
json
|
||||
lua
|
||||
make
|
||||
markdown
|
||||
nix
|
||||
regex
|
||||
toml
|
||||
vim
|
||||
vimdoc
|
||||
xml
|
||||
yaml
|
||||
javascript
|
||||
go
|
||||
typescript
|
||||
];
|
||||
settings = {
|
||||
highlight.enable = true;
|
||||
indent.enable = true;
|
||||
};
|
||||
};
|
||||
treesitter-context.enable = true;
|
||||
treesitter-textobjects = {
|
||||
enable = true;
|
||||
move = {
|
||||
enable = true;
|
||||
gotoNextStart = {
|
||||
"]m" = {
|
||||
query = "@function.outer";
|
||||
};
|
||||
"]]" = {
|
||||
query = "@class.outer";
|
||||
desc = "Next class start";
|
||||
};
|
||||
"]o" = {
|
||||
query = "@loop.*";
|
||||
};
|
||||
"]s" = {
|
||||
query = "@scope";
|
||||
queryGroup = "locals";
|
||||
desc = "Next scope";
|
||||
};
|
||||
"]z" = {
|
||||
query = "@fold";
|
||||
queryGroup = "folds";
|
||||
desc = "Next fold";
|
||||
};
|
||||
};
|
||||
gotoNextEnd = {
|
||||
"]M" = {
|
||||
query = "@function.outer";
|
||||
};
|
||||
"][" = {
|
||||
query = "@class.outer";
|
||||
};
|
||||
};
|
||||
gotoPreviousStart = {
|
||||
"[m" = {
|
||||
query = "@function.outer";
|
||||
};
|
||||
"[[" = {
|
||||
query = "@class.outer";
|
||||
};
|
||||
};
|
||||
gotoPreviousEnd = {
|
||||
"[M" = {
|
||||
query = "@function.outer";
|
||||
};
|
||||
"[]" = {
|
||||
query = "@class.outer";
|
||||
};
|
||||
};
|
||||
gotoNext = {
|
||||
"]d" = {
|
||||
query = "@conditional.outer";
|
||||
};
|
||||
};
|
||||
gotoPrevious = {
|
||||
"[d" = {
|
||||
query = "@conditional.outer";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
ts-autotag.enable = true;
|
||||
|
||||
which-key.enable = true;
|
||||
telescope = {
|
||||
enable = true;
|
||||
extensions.fzf-native.enable = true;
|
||||
settings = {
|
||||
defaults = {
|
||||
mappings = {
|
||||
i = {
|
||||
"<C-t>".__raw = "require('trouble.sources.telescope').open";
|
||||
};
|
||||
n = {
|
||||
"<C-t>".__raw = "require('trouble.sources.telescope').open";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
project-nvim = {
|
||||
enable = true;
|
||||
enableTelescope = true;
|
||||
};
|
||||
web-devicons.enable = true;
|
||||
|
||||
lean = {
|
||||
enable = false;
|
||||
};
|
||||
};
|
||||
|
||||
opts = {
|
||||
number = true;
|
||||
relativenumber = true;
|
||||
signcolumn = "yes";
|
||||
updatetime = 250;
|
||||
undofile = true;
|
||||
ignorecase = true;
|
||||
smartcase = true;
|
||||
swapfile = false;
|
||||
foldlevel = 9;
|
||||
smartindent = true;
|
||||
tabstop = 2;
|
||||
shiftwidth = 2;
|
||||
softtabstop = 0;
|
||||
expandtab = true;
|
||||
smarttab = true;
|
||||
scrolloff = 5;
|
||||
termguicolors = true;
|
||||
foldmethod = lib.mkForce "expr";
|
||||
foldexpr = lib.mkForce "v:lua.vim.treesitter.foldexpr()";
|
||||
};
|
||||
|
||||
globals = {
|
||||
mapleader = " ";
|
||||
maplocalleader = " ";
|
||||
};
|
||||
keymaps = [
|
||||
{
|
||||
action = ":";
|
||||
key = ";";
|
||||
mode = [ "n" ];
|
||||
}
|
||||
# { action = "gj"; key = "j"; mode = [ "n" ]; }
|
||||
# { action = "gk"; key = "k"; mode = [ "n" ]; }
|
||||
{
|
||||
action = "<Esc>";
|
||||
key = "jk";
|
||||
mode = [ "i" ];
|
||||
}
|
||||
|
||||
{
|
||||
action = "<cmd>Telescope find_files<CR>";
|
||||
key = "<leader><leader>";
|
||||
options.desc = "Find Files";
|
||||
}
|
||||
{
|
||||
action.__raw = "function() require('telescope.builtin').lsp_document_symbols({symbols='method'}) end";
|
||||
key = "<leader>fm";
|
||||
options.desc = "Find Methods";
|
||||
}
|
||||
{
|
||||
action = "<cmd>Telescope live_grep<CR>";
|
||||
key = "<leader>fg";
|
||||
options.desc = "Grep";
|
||||
}
|
||||
{
|
||||
action = "<cmd>Telescope buffers<CR>";
|
||||
key = "<leader>fb";
|
||||
options.desc = "Find Buffers";
|
||||
}
|
||||
{
|
||||
action = "<cmd>Telescope buffers<CR>";
|
||||
key = "<leader>fb";
|
||||
options.desc = "Find Buffers";
|
||||
}
|
||||
{
|
||||
action = "<cmd>Telescope projects<CR>";
|
||||
key = "<leader>pp";
|
||||
options.desc = "Switch Projects";
|
||||
}
|
||||
|
||||
{
|
||||
action = "<cmd>Trouble diagnostics toggle<CR>";
|
||||
key = "<leader>tr";
|
||||
}
|
||||
{
|
||||
action = "<cmd>Neogit<CR>";
|
||||
key = "<leader>gg";
|
||||
options.desc = "Open Git";
|
||||
}
|
||||
{
|
||||
action = "<cmd>NvimTreeToggle<CR>";
|
||||
key = "<leader>tt";
|
||||
options.desc = "Tree View";
|
||||
}
|
||||
|
||||
{
|
||||
action.__raw = "function() require('flash').jump() end";
|
||||
key = "s";
|
||||
mode = [
|
||||
"n"
|
||||
"x"
|
||||
"o"
|
||||
];
|
||||
options.desc = "Flash";
|
||||
}
|
||||
{
|
||||
action.__raw = "function() require('flash').treesitter() end";
|
||||
key = "S";
|
||||
mode = [
|
||||
"n"
|
||||
"x"
|
||||
"o"
|
||||
];
|
||||
options.desc = "Flash Treesitter";
|
||||
}
|
||||
{
|
||||
action.__raw = "function() require('flash').remote() end";
|
||||
key = "r";
|
||||
mode = [ "o" ];
|
||||
options.desc = "Remote Flash";
|
||||
}
|
||||
{
|
||||
action.__raw = "function() require('flash').treesitter_search() end";
|
||||
key = "R";
|
||||
mode = [ "o" ];
|
||||
options.desc = "Treesitter Search";
|
||||
}
|
||||
{
|
||||
action.__raw = "function() require('flash').toggle() end";
|
||||
key = "<c-s>";
|
||||
mode = [ "c" ];
|
||||
options.desc = "Toggle Flash";
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
90
modules/home/zsh/default.nix
Normal file
90
modules/home/zsh/default.nix
Normal file
@ -0,0 +1,90 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
inputs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
cfg = config.zsh;
|
||||
inherit (lib) mkEnableOption mkIf mkOption;
|
||||
in
|
||||
{
|
||||
options.zsh = {
|
||||
enable = mkEnableOption "Zsh";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
|
||||
home.packages = with pkgs; [
|
||||
zsh-completions
|
||||
fd
|
||||
htop
|
||||
ripgrep
|
||||
wget
|
||||
delta
|
||||
];
|
||||
|
||||
programs.bat = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
programs.dircolors = {
|
||||
enable = true;
|
||||
enableZshIntegration = true;
|
||||
};
|
||||
|
||||
programs.direnv = {
|
||||
enable = true;
|
||||
enableZshIntegration = true;
|
||||
nix-direnv.enable = true;
|
||||
config = {
|
||||
hide_env_diff = true;
|
||||
};
|
||||
};
|
||||
programs.zsh = {
|
||||
enable = true;
|
||||
enableCompletion = true;
|
||||
syntaxHighlighting.enable = true;
|
||||
autosuggestion.enable = true;
|
||||
autocd = true;
|
||||
history = {
|
||||
size = 1000000;
|
||||
extended = true;
|
||||
append = true;
|
||||
expireDuplicatesFirst = true;
|
||||
ignoreDups = true;
|
||||
ignoreAllDups = true;
|
||||
ignoreSpace = true;
|
||||
};
|
||||
historySubstringSearch.enable = true;
|
||||
shellAliases = {
|
||||
cat = "bat --theme=\"$(defaults read -globalDomain AppleInterfaceStyle &> /dev/null && echo 'gruvbox-dark' || echo 'gruvbox-light')\"";
|
||||
diff = "delta";
|
||||
};
|
||||
};
|
||||
programs.fzf.enable = true;
|
||||
programs.fzf.enableZshIntegration = true;
|
||||
|
||||
programs.zoxide.enable = true;
|
||||
programs.zoxide.enableZshIntegration = true;
|
||||
|
||||
programs.eza = {
|
||||
enable = true;
|
||||
enableZshIntegration = true;
|
||||
extraOptions = [ "--group-directories-first" ];
|
||||
};
|
||||
|
||||
programs.starship = {
|
||||
enable = true;
|
||||
enableZshIntegration = true;
|
||||
settings = {
|
||||
nodejs.disabled = true;
|
||||
package.disabled = true;
|
||||
aws.disabled = true;
|
||||
python.disabled = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
}
|
16
users.nix
16
users.nix
@ -1,16 +0,0 @@
|
||||
{
|
||||
users.users.yadunut = {
|
||||
isNormalUser = true;
|
||||
extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user.
|
||||
openssh.authorizedKeys.keys = [
|
||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJXOpmWsAnl2RtOuJJMRUx+iJTwf2RWJ1iS3FqXJFzFG"
|
||||
];
|
||||
hashedPassword = "$y$j9T$9ATrmrhedhb.mAZ4//PiN/$OStCOaJHt3kPA63imTG3zLMWCSLoWCUph5O6jl5mcZ.";
|
||||
};
|
||||
security.sudo.wheelNeedsPassword = false;
|
||||
|
||||
users.users.root.openssh.authorizedKeys.keys = [
|
||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJXOpmWsAnl2RtOuJJMRUx+iJTwf2RWJ1iS3FqXJFzFG"
|
||||
];
|
||||
users.users.root.hashedPassword = "$6$xa/mFg4OxIbb8XiQ$S2RVyCKcLaKHymFs48u8vj1dv.mQdxt.BQoucJsr8wfcHayXwKfD0C2NIOYY5AEPR9zgnMvFp8d8STKe6wMGR/";
|
||||
}
|
Loading…
Reference in New Issue
Block a user