mirror of
https://github.com/lightly-toasted/nix-config.git
synced 2025-10-04 15:45:39 +00:00
feat: refactor home-manager configuration for multi-host support
This commit is contained in:
parent
f20c875a48
commit
6d1fd47bea
47 changed files with 51 additions and 14 deletions
30
home/modules/cli/gemini.nix
Normal file
30
home/modules/cli/gemini.nix
Normal file
|
@ -0,0 +1,30 @@
|
|||
{ pkgs, config, ... }:
|
||||
|
||||
{
|
||||
sops.secrets.github_token = { };
|
||||
home.packages = with pkgs; [
|
||||
gemini-cli
|
||||
];
|
||||
home.file.".gemini/settings.json".text = ''
|
||||
{
|
||||
"selectedAuthType": "oauth-personal",
|
||||
"mcpServers": {
|
||||
"context7": {
|
||||
"httpUrl": "https://mcp.context7.com/mcp"
|
||||
},
|
||||
"github": {
|
||||
"command": "npx",
|
||||
"args": [
|
||||
"@modelcontextprotocol/server-github"
|
||||
],
|
||||
"timeout": 10000,
|
||||
"trust": false
|
||||
}
|
||||
},
|
||||
"preferredEditor": "neovim"
|
||||
}
|
||||
'';
|
||||
home.file.".gemini/.env".text = ''
|
||||
GITHUB_TOKEN=$(cat ${config.sops.secrets.github_token.path})
|
||||
'';
|
||||
}
|
10
home/modules/cli/git.nix
Normal file
10
home/modules/cli/git.nix
Normal file
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
programs.git = {
|
||||
enable = true;
|
||||
userName = "lightly-toasted";
|
||||
userEmail = "tooast@duck.com";
|
||||
extraConfig = {
|
||||
init.defaultBranch = "main";
|
||||
};
|
||||
};
|
||||
}
|
35
home/modules/cli/nixvim/default.nix
Normal file
35
home/modules/cli/nixvim/default.nix
Normal file
|
@ -0,0 +1,35 @@
|
|||
{
|
||||
programs.nixvim = {
|
||||
enable = true;
|
||||
defaultEditor = true;
|
||||
colorschemes.moonfly = {
|
||||
enable = true;
|
||||
};
|
||||
opts = {
|
||||
number = true;
|
||||
relativenumber = true;
|
||||
expandtab = true;
|
||||
shiftwidth = 2;
|
||||
tabstop = 2;
|
||||
softtabstop = 2;
|
||||
};
|
||||
};
|
||||
|
||||
imports = [
|
||||
./keymaps.nix
|
||||
./plugins/bufferline.nix
|
||||
./plugins/lualine.nix
|
||||
./plugins/cmp.nix
|
||||
./plugins/comment.nix
|
||||
./plugins/colorizer.nix
|
||||
./plugins/nvim-autopairs.nix
|
||||
./plugins/gitsigns.nix
|
||||
./plugins/telescope.nix
|
||||
./plugins/treesitter.nix
|
||||
./plugins/nvim-tree.nix
|
||||
./plugins/web-devicons.nix
|
||||
./plugins/wakatime.nix
|
||||
./plugins/which-key.nix
|
||||
./plugins/lsp.nix
|
||||
];
|
||||
}
|
87
home/modules/cli/nixvim/keymaps.nix
Normal file
87
home/modules/cli/nixvim/keymaps.nix
Normal file
|
@ -0,0 +1,87 @@
|
|||
{
|
||||
programs.nixvim = {
|
||||
globals.mapleader = " ";
|
||||
keymaps = [
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>w";
|
||||
action = "<cmd>w<CR>";
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>q";
|
||||
action = "<cmd>q<CR>";
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>e";
|
||||
action = "<cmd>NvimTreeToggle<CR>";
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>d";
|
||||
action = "<cmd>lua vim.diagnostic.open_float()<CR>";
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>?";
|
||||
action = "<cmd>WhichKey<CR>";
|
||||
options.desc = "Show WhichKey popup";
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<Tab>";
|
||||
action = "<cmd>bnext<CR>";
|
||||
options.desc = "Next buffer";
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<S-Tab>";
|
||||
action = "<cmd>bprevious<CR>";
|
||||
options.desc = "Prev buffer";
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>bd";
|
||||
action = "<cmd>bdelete<CR>";
|
||||
options.desc = "Delete buffer";
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>bb";
|
||||
action = "<cmd>Telescope buffers<CR>";
|
||||
options.desc = "Buffer list";
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>bp";
|
||||
action = "<cmd>BufferLinePick<CR>";
|
||||
options.desc = "Pick buffer";
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>bc";
|
||||
action = "<cmd>BufferLinePickClose<CR>";
|
||||
options.desc = "Pick buffer to close";
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>f";
|
||||
action = "<cmd>Telescope find_files<CR>";
|
||||
options.desc = "Telescope: Find Files";
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>g";
|
||||
action = "<cmd>Telescope live_grep<CR>";
|
||||
options.desc = "Telescope: Live Grep";
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>b";
|
||||
action = "<cmd>Telescope buffers<CR>";
|
||||
options.desc = "Telescope: List Buffers";
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
3
home/modules/cli/nixvim/plugins/bufferline.nix
Normal file
3
home/modules/cli/nixvim/plugins/bufferline.nix
Normal file
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
programs.nixvim.plugins.bufferline.enable = true;
|
||||
}
|
11
home/modules/cli/nixvim/plugins/cmp.nix
Normal file
11
home/modules/cli/nixvim/plugins/cmp.nix
Normal file
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
programs.nixvim.plugins.cmp = {
|
||||
enable = true;
|
||||
autoEnableSources = true;
|
||||
settings.sources = [
|
||||
{ name = "nvim_lsp"; }
|
||||
{ name = "path"; }
|
||||
{ name = "buffer"; }
|
||||
];
|
||||
};
|
||||
}
|
15
home/modules/cli/nixvim/plugins/colorizer.nix
Normal file
15
home/modules/cli/nixvim/plugins/colorizer.nix
Normal file
|
@ -0,0 +1,15 @@
|
|||
{
|
||||
programs.nixvim.plugins.colorizer = {
|
||||
enable = true;
|
||||
settings = {
|
||||
filetypes = [ "*" ];
|
||||
user_default_options = {
|
||||
css = true;
|
||||
tailwind = "both";
|
||||
tailwind_opts = {
|
||||
update_names = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
3
home/modules/cli/nixvim/plugins/comment.nix
Normal file
3
home/modules/cli/nixvim/plugins/comment.nix
Normal file
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
programs.nixvim.plugins.comment.enable = true;
|
||||
}
|
3
home/modules/cli/nixvim/plugins/gitsigns.nix
Normal file
3
home/modules/cli/nixvim/plugins/gitsigns.nix
Normal file
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
programs.nixvim.plugins.gitsigns.enable = true;
|
||||
}
|
12
home/modules/cli/nixvim/plugins/lsp.nix
Normal file
12
home/modules/cli/nixvim/plugins/lsp.nix
Normal file
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
programs.nixvim.plugins.lsp = {
|
||||
enable = true;
|
||||
servers = {
|
||||
lua_ls.enable = true;
|
||||
ts_ls.enable = true;
|
||||
pyright.enable = true;
|
||||
tailwindcss.enable = true;
|
||||
nil_ls.enable = true;
|
||||
};
|
||||
};
|
||||
}
|
11
home/modules/cli/nixvim/plugins/lualine.nix
Normal file
11
home/modules/cli/nixvim/plugins/lualine.nix
Normal file
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
programs.nixvim.plugins.lualine = {
|
||||
enable = true;
|
||||
settings = {
|
||||
options = {
|
||||
icons_enabled = true;
|
||||
theme = "moonfly";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
3
home/modules/cli/nixvim/plugins/nvim-autopairs.nix
Normal file
3
home/modules/cli/nixvim/plugins/nvim-autopairs.nix
Normal file
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
programs.nixvim.plugins.nvim-autopairs.enable = true;
|
||||
}
|
3
home/modules/cli/nixvim/plugins/nvim-tree.nix
Normal file
3
home/modules/cli/nixvim/plugins/nvim-tree.nix
Normal file
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
programs.nixvim.plugins.nvim-tree.enable = true;
|
||||
}
|
3
home/modules/cli/nixvim/plugins/telescope.nix
Normal file
3
home/modules/cli/nixvim/plugins/telescope.nix
Normal file
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
programs.nixvim.plugins.telescope.enable = true;
|
||||
}
|
9
home/modules/cli/nixvim/plugins/treesitter.nix
Normal file
9
home/modules/cli/nixvim/plugins/treesitter.nix
Normal file
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
programs.nixvim.plugins.treesitter = {
|
||||
enable = true;
|
||||
settings = {
|
||||
highlight.enable = true;
|
||||
indent.enable = true;
|
||||
};
|
||||
};
|
||||
}
|
6
home/modules/cli/nixvim/plugins/wakatime.nix
Normal file
6
home/modules/cli/nixvim/plugins/wakatime.nix
Normal file
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
programs.nixvim.plugins.wakatime = {
|
||||
enable = true;
|
||||
autoLoad = true;
|
||||
};
|
||||
}
|
3
home/modules/cli/nixvim/plugins/web-devicons.nix
Normal file
3
home/modules/cli/nixvim/plugins/web-devicons.nix
Normal file
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
programs.nixvim.plugins.web-devicons.enable = true;
|
||||
}
|
3
home/modules/cli/nixvim/plugins/which-key.nix
Normal file
3
home/modules/cli/nixvim/plugins/which-key.nix
Normal file
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
programs.nixvim.plugins.which-key.enable = true;
|
||||
}
|
10
home/modules/cli/sops.nix
Normal file
10
home/modules/cli/sops.nix
Normal file
|
@ -0,0 +1,10 @@
|
|||
{ rootPath, ... }:
|
||||
|
||||
{
|
||||
sops.defaultSopsFile = rootPath + /secrets/secrets.yaml;
|
||||
sops.defaultSopsFormat = "yaml";
|
||||
|
||||
sops.age.keyFile = "/home/toast/.config/sops/age/keys.txt";
|
||||
|
||||
sops.secrets."tailscale/authkey" = { };
|
||||
}
|
16
home/modules/cli/xdg.nix
Normal file
16
home/modules/cli/xdg.nix
Normal file
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
xdg = {
|
||||
enable = true;
|
||||
portal.enable = true;
|
||||
mimeApps = {
|
||||
enable = true;
|
||||
defaultApplications = {
|
||||
"x-scheme-handler/roblox-player" = "org.vinegarhq.Sober.desktop";
|
||||
"x-scheme-handler/roblox-studio" = "org.vinegarhq.Vinegar.studio.desktop";
|
||||
"x-scheme-handler/discord" = "vesktop.desktop";
|
||||
"x-scheme-handler/roblox-studio-auth" = "org.vinegarhq.Vinegar.studio.desktop";
|
||||
};
|
||||
};
|
||||
configFile."mimeapps.list".force = true;
|
||||
};
|
||||
}
|
3
home/modules/cli/yazi.nix
Normal file
3
home/modules/cli/yazi.nix
Normal file
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
programs.yazi.enable = true;
|
||||
}
|
14
home/modules/cli/zsh.nix
Normal file
14
home/modules/cli/zsh.nix
Normal file
|
@ -0,0 +1,14 @@
|
|||
{ pkgs, ... }: {
|
||||
|
||||
programs.zsh = {
|
||||
enable = true;
|
||||
enableCompletion = true;
|
||||
autosuggestion.enable = true;
|
||||
syntaxHighlighting.enable = true;
|
||||
|
||||
shellAliases = {
|
||||
update = "sudo nixos-rebuild switch --flake /home/toast/nix-config";
|
||||
gs = "git status";
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue