xdg os check
This commit is contained in:
@@ -4,187 +4,183 @@
|
||||
lib,
|
||||
inputs,
|
||||
...
|
||||
}: let
|
||||
cfg = config.blake.nvf;
|
||||
in {
|
||||
options.blake.nvf = {
|
||||
enable = lib.mkEnableOption;
|
||||
};
|
||||
}:
|
||||
{
|
||||
imports = [
|
||||
inputs.nvf.homeManagerModules.default
|
||||
];
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
imports = [inputs.nvf.homeManagerModules.default];
|
||||
programs.nvf = {
|
||||
enable = true;
|
||||
settings = {
|
||||
vim = {
|
||||
globals = {
|
||||
mapleader = " ";
|
||||
maplocalleader = " ";
|
||||
};
|
||||
|
||||
programs.nvf = {
|
||||
enable = true;
|
||||
settings = {
|
||||
vim = {
|
||||
globals = {
|
||||
mapleader = " ";
|
||||
maplocalleader = " ";
|
||||
};
|
||||
vimAlias = true;
|
||||
|
||||
vimAlias = true;
|
||||
lsp.enable = true;
|
||||
statusline.lualine.enable = true;
|
||||
telescope.enable = true;
|
||||
autocomplete.nvim-cmp.enable = true;
|
||||
autopairs.nvim-autopairs.enable = true;
|
||||
|
||||
lsp.enable = true;
|
||||
statusline.lualine.enable = true;
|
||||
telescope.enable = true;
|
||||
autocomplete.nvim-cmp.enable = true;
|
||||
autopairs.nvim-autopairs.enable = true;
|
||||
keymaps = [
|
||||
# visual line movement (insert mode)
|
||||
{
|
||||
key = "<Up>";
|
||||
mode = [ "i" ];
|
||||
action = "<C-o>gk";
|
||||
desc = "Visual Line Up (Insert)";
|
||||
}
|
||||
{
|
||||
key = "<Down>";
|
||||
mode = [ "i" ];
|
||||
action = "<C-o>gj";
|
||||
desc = "Visual Line Down (Insert)";
|
||||
}
|
||||
|
||||
keymaps = [
|
||||
# visual line movement (insert mode)
|
||||
{
|
||||
key = "<Up>";
|
||||
mode = ["i"];
|
||||
action = "<C-o>gk";
|
||||
desc = "Visual Line Up (Insert)";
|
||||
}
|
||||
{
|
||||
key = "<Down>";
|
||||
mode = ["i"];
|
||||
action = "<C-o>gj";
|
||||
desc = "Visual Line Down (Insert)";
|
||||
}
|
||||
# visual line movement (normal/visual)
|
||||
{
|
||||
key = "<Up>";
|
||||
mode = [
|
||||
"n"
|
||||
"v"
|
||||
];
|
||||
action = "g<Up>";
|
||||
desc = "Visual Line Up";
|
||||
}
|
||||
{
|
||||
key = "<Down>";
|
||||
mode = [
|
||||
"n"
|
||||
"v"
|
||||
];
|
||||
action = "g<Down>";
|
||||
desc = "Visual Line Down";
|
||||
}
|
||||
|
||||
# visual line movement (normal/visual)
|
||||
{
|
||||
key = "<Up>";
|
||||
mode = [
|
||||
"n"
|
||||
"v"
|
||||
];
|
||||
action = "g<Up>";
|
||||
desc = "Visual Line Up";
|
||||
}
|
||||
{
|
||||
key = "<Down>";
|
||||
mode = [
|
||||
"n"
|
||||
"v"
|
||||
];
|
||||
action = "g<Down>";
|
||||
desc = "Visual Line Down";
|
||||
}
|
||||
# lsp
|
||||
#{ key = "gd"; mode = [ "n" ]; action = "<cmd>lua vim.lsp.buf.definition()<CR>"; desc = "Go to definition"; }
|
||||
#{ key = "K"; mode = [ "n" ]; action = "<cmd>lua vim.lsp.buf.hover()<CR>"; desc = "Hover info"; }
|
||||
#{ key = "<leader>f"; mode = [ "n" ]; action = "<cmd>lua vim.lsp.buf.format({ async = true })<CR>"; desc = "Format buffer"; }
|
||||
|
||||
# lsp
|
||||
#{ key = "gd"; mode = [ "n" ]; action = "<cmd>lua vim.lsp.buf.definition()<CR>"; desc = "Go to definition"; }
|
||||
#{ key = "K"; mode = [ "n" ]; action = "<cmd>lua vim.lsp.buf.hover()<CR>"; desc = "Hover info"; }
|
||||
#{ key = "<leader>f"; mode = [ "n" ]; action = "<cmd>lua vim.lsp.buf.format({ async = true })<CR>"; desc = "Format buffer"; }
|
||||
{
|
||||
key = "gd";
|
||||
mode = [ "n" ];
|
||||
silent = true;
|
||||
action = "<cmd>lua vim.lsp.buf.definition()<CR>";
|
||||
desc = "Go to definition";
|
||||
}
|
||||
# Hover info
|
||||
{
|
||||
key = "K";
|
||||
mode = [ "n" ];
|
||||
silent = true;
|
||||
action = "<cmd>lua vim.lsp.buf.hover()<CR>";
|
||||
desc = "Hover info";
|
||||
}
|
||||
# Format buffer (Alejandra for Nix)
|
||||
{
|
||||
key = "<leader>F";
|
||||
mode = [ "n" ];
|
||||
silent = true;
|
||||
action = "<cmd>lua vim.lsp.buf.format({ async = true })<CR>";
|
||||
desc = "Format buffer";
|
||||
}
|
||||
# Code actions / quickfix
|
||||
{
|
||||
key = "<leader>a";
|
||||
mode = [ "n" ];
|
||||
silent = true;
|
||||
action = "<cmd>lua vim.lsp.buf.code_action()<CR>";
|
||||
desc = "Code action";
|
||||
}
|
||||
# Rename symbol
|
||||
{
|
||||
key = "<leader>r";
|
||||
mode = [ "n" ];
|
||||
silent = true;
|
||||
action = "<cmd>lua vim.lsp.buf.rename()<CR>";
|
||||
desc = "Rename symbol";
|
||||
}
|
||||
# Diagnostics
|
||||
{
|
||||
key = "<leader>e";
|
||||
mode = [ "n" ];
|
||||
silent = true;
|
||||
action = "<cmd>lua vim.diagnostic.open_float()<CR>";
|
||||
desc = "Show diagnostic";
|
||||
}
|
||||
{
|
||||
key = "[d";
|
||||
mode = [ "n" ];
|
||||
silent = true;
|
||||
action = "<cmd>lua vim.diagnostic.goto_prev()<CR>";
|
||||
desc = "Previous diagnostic";
|
||||
}
|
||||
{
|
||||
key = "]d";
|
||||
mode = [ "n" ];
|
||||
silent = true;
|
||||
action = "<cmd>lua vim.diagnostic.goto_next()<CR>";
|
||||
desc = "Next diagnostic";
|
||||
}
|
||||
];
|
||||
|
||||
{
|
||||
key = "gd";
|
||||
mode = ["n"];
|
||||
silent = true;
|
||||
action = "<cmd>lua vim.lsp.buf.definition()<CR>";
|
||||
desc = "Go to definition";
|
||||
}
|
||||
# Hover info
|
||||
{
|
||||
key = "K";
|
||||
mode = ["n"];
|
||||
silent = true;
|
||||
action = "<cmd>lua vim.lsp.buf.hover()<CR>";
|
||||
desc = "Hover info";
|
||||
}
|
||||
# Format buffer (Alejandra for Nix)
|
||||
{
|
||||
key = "<leader>F";
|
||||
mode = ["n"];
|
||||
silent = true;
|
||||
action = "<cmd>lua vim.lsp.buf.format({ async = true })<CR>";
|
||||
desc = "Format buffer";
|
||||
}
|
||||
# Code actions / quickfix
|
||||
{
|
||||
key = "<leader>a";
|
||||
mode = ["n"];
|
||||
silent = true;
|
||||
action = "<cmd>lua vim.lsp.buf.code_action()<CR>";
|
||||
desc = "Code action";
|
||||
}
|
||||
# Rename symbol
|
||||
{
|
||||
key = "<leader>r";
|
||||
mode = ["n"];
|
||||
silent = true;
|
||||
action = "<cmd>lua vim.lsp.buf.rename()<CR>";
|
||||
desc = "Rename symbol";
|
||||
}
|
||||
# Diagnostics
|
||||
{
|
||||
key = "<leader>e";
|
||||
mode = ["n"];
|
||||
silent = true;
|
||||
action = "<cmd>lua vim.diagnostic.open_float()<CR>";
|
||||
desc = "Show diagnostic";
|
||||
}
|
||||
{
|
||||
key = "[d";
|
||||
mode = ["n"];
|
||||
silent = true;
|
||||
action = "<cmd>lua vim.diagnostic.goto_prev()<CR>";
|
||||
desc = "Previous diagnostic";
|
||||
}
|
||||
{
|
||||
key = "]d";
|
||||
mode = ["n"];
|
||||
silent = true;
|
||||
action = "<cmd>lua vim.diagnostic.goto_next()<CR>";
|
||||
desc = "Next diagnostic";
|
||||
}
|
||||
];
|
||||
options = {
|
||||
clipboard = "unnamedplus";
|
||||
|
||||
options = {
|
||||
clipboard = "unnamedplus";
|
||||
# line numbers
|
||||
number = true;
|
||||
numberwidth = 2;
|
||||
relativenumber = true;
|
||||
|
||||
# line numbers
|
||||
number = true;
|
||||
numberwidth = 2;
|
||||
relativenumber = true;
|
||||
# tabs and indentation
|
||||
tabstop = 2;
|
||||
shiftwidth = 2;
|
||||
softtabstop = -1;
|
||||
expandtab = true;
|
||||
smarttab = true;
|
||||
autoindent = true;
|
||||
|
||||
# tabs and indentation
|
||||
tabstop = 2;
|
||||
shiftwidth = 2;
|
||||
softtabstop = -1;
|
||||
expandtab = true;
|
||||
smarttab = true;
|
||||
autoindent = true;
|
||||
# search
|
||||
ignorecase = true;
|
||||
smartcase = true;
|
||||
|
||||
# search
|
||||
ignorecase = true;
|
||||
smartcase = true;
|
||||
# files and backups
|
||||
backup = false;
|
||||
writebackup = false;
|
||||
undofile = true;
|
||||
swapfile = true;
|
||||
|
||||
# files and backups
|
||||
backup = false;
|
||||
writebackup = false;
|
||||
undofile = true;
|
||||
swapfile = true;
|
||||
# wrapping
|
||||
wrap = true;
|
||||
linebreak = true;
|
||||
breakindent = true;
|
||||
|
||||
# wrapping
|
||||
wrap = true;
|
||||
linebreak = true;
|
||||
breakindent = true;
|
||||
termguicolors = true;
|
||||
autoread = true;
|
||||
};
|
||||
|
||||
termguicolors = true;
|
||||
autoread = true;
|
||||
};
|
||||
languages = {
|
||||
enableTreesitter = true;
|
||||
|
||||
languages = {
|
||||
enableTreesitter = true;
|
||||
|
||||
nix = {
|
||||
nix = {
|
||||
enable = true;
|
||||
format = {
|
||||
enable = true;
|
||||
format = {
|
||||
enable = true;
|
||||
type = "alejandra";
|
||||
#type = "nixfmt";
|
||||
};
|
||||
type = "alejandra";
|
||||
#type = "nixfmt";
|
||||
};
|
||||
|
||||
markdown.enable = true;
|
||||
rust.enable = true;
|
||||
lua.enable = true;
|
||||
};
|
||||
|
||||
markdown.enable = true;
|
||||
rust.enable = true;
|
||||
lua.enable = true;
|
||||
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
}: {
|
||||
home.packages = with pkgs; [xdg-ninja];
|
||||
|
||||
xdg = {
|
||||
xdg = if pkgs.system == "x86_64-linux" then {} else {
|
||||
enable = true;
|
||||
configHome = "${config.home.homeDirectory}/.config";
|
||||
cacheHome = "${config.home.homeDirectory}/.cache";
|
||||
@@ -27,7 +27,7 @@
|
||||
};
|
||||
|
||||
# misc env variables to get things out of ~ (<3 xdg-ninja)
|
||||
home.sessionVariables = {
|
||||
home.sessionVariables = if pkgs.system == "x86_64-darwin" then {} else {
|
||||
GOPATH="$XDG_DATA_HOME/go";
|
||||
_JAVA_OPTIONS=''-Djava.util.prefs.userRoot="$XDG_CONFIG_HOME"/java'';
|
||||
};
|
||||
|
||||
@@ -7,11 +7,17 @@
|
||||
}: let
|
||||
|
||||
# general config
|
||||
linux_home = {
|
||||
home_linux = {
|
||||
username = "blake";
|
||||
homeDirectory = "/home/blake";
|
||||
};
|
||||
linux_imports = [
|
||||
home_darwin = {
|
||||
username = "bhelderman";
|
||||
homeDirectory = "/Users/bhelderman";
|
||||
};
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
inputs.sops-nix.homeManagerModules.sops
|
||||
./dots/neovim
|
||||
./dots/lf
|
||||
@@ -21,25 +27,9 @@
|
||||
./dots/git
|
||||
./dots/xdg
|
||||
];
|
||||
darwin_home = {
|
||||
username = "blake";
|
||||
homeDirectory = "/home/blake";
|
||||
};
|
||||
darwin_imports = [
|
||||
inputs.sops-nix.homeManagerModules.sops
|
||||
./dots/neovim
|
||||
./dots/lf
|
||||
./dots/zsh
|
||||
./dots/ssh
|
||||
./dots/gpg
|
||||
./dots/git
|
||||
];
|
||||
in
|
||||
{
|
||||
imports = if pkgs.system == "x86_64-darwin" then darwin_imports else linux_imports;
|
||||
|
||||
# general config
|
||||
home = (if pkgs.system == "x86_64-darwin" then darwin_home else linux_home) // {
|
||||
home = (if pkgs.system == "x86_64-darwin" then home_darwin else home_linux) // {
|
||||
# cross party general packages here : )
|
||||
stateVersion = "25.05";
|
||||
packages = with pkgs; [
|
||||
|
||||
Reference in New Issue
Block a user