fix alignment and add basic nvim config
This commit is contained in:
parent
3a71fb8ce2
commit
2bc79f165e
3 changed files with 293 additions and 164 deletions
18
flake.lock
generated
18
flake.lock
generated
|
|
@ -155,17 +155,17 @@
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1708976249,
|
"lastModified": 1708984720,
|
||||||
"narHash": "sha256-bA0rrmxj5K1W/EWgzpk1NUvEIyAk1hqsmxcRCmmXFuw=",
|
"narHash": "sha256-gJctErLbXx4QZBBbGp78PxtOOzsDaQ+yw1ylNQBuSUY=",
|
||||||
"owner": "NixOS",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "d8e0944e6d2ce0f326040e654c07a410e2617d47",
|
"rev": "13aff9b34cc32e59d35c62ac9356e4a41198a538",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "NixOS",
|
"owner": "nixos",
|
||||||
|
"ref": "nixos-unstable",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "d8e0944e6d2ce0f326040e654c07a410e2617d47",
|
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -181,11 +181,11 @@
|
||||||
"pre-commit-hooks": "pre-commit-hooks"
|
"pre-commit-hooks": "pre-commit-hooks"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1709054170,
|
"lastModified": 1709109026,
|
||||||
"narHash": "sha256-er3hOsSa6nOiOYHpCUukLZcbaORSdifxpzAmMBLT1HM=",
|
"narHash": "sha256-gW1UIlzNnk9F6M04GAqF9sctGAz0CZrGlIPy7IDqAQI=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "nixvim",
|
"repo": "nixvim",
|
||||||
"rev": "81f20bd2f5f53883d4fb386752196ea0a3ddd053",
|
"rev": "bb9d56087dda932274e25702ce32b725295d926d",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
|
||||||
|
|
@ -2,9 +2,9 @@
|
||||||
description = "Nixos config flake";
|
description = "Nixos config flake";
|
||||||
|
|
||||||
inputs = {
|
inputs = {
|
||||||
# nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||||
|
|
||||||
nixpkgs.url = "github:NixOS/nixpkgs/d8e0944e6d2ce0f326040e654c07a410e2617d47";
|
# nixpkgs.url = "github:NixOS/nixpkgs/d8e0944e6d2ce0f326040e654c07a410e2617d47";
|
||||||
|
|
||||||
home-manager = {
|
home-manager = {
|
||||||
url = "github:nix-community/home-manager";
|
url = "github:nix-community/home-manager";
|
||||||
|
|
|
||||||
|
|
@ -1,102 +1,104 @@
|
||||||
{ config, pkgs, inputs, ... }:
|
{ config, pkgs, inputs, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
imports =
|
imports =
|
||||||
[
|
[
|
||||||
inputs.nixvim.homeManagerModules.nixvim
|
inputs.nixvim.homeManagerModules.nixvim
|
||||||
];
|
];
|
||||||
# Home Manager needs a bit of information about you and the paths it should
|
# Home Manager needs a bit of information about you and the paths it should
|
||||||
# manage.
|
# manage.
|
||||||
home.username = "noa";
|
home.username = "noa";
|
||||||
home.homeDirectory = "/home/noa";
|
home.homeDirectory = "/home/noa";
|
||||||
|
|
||||||
# This value determines the Home Manager release that your configuration is
|
# This value determines the Home Manager release that your configuration is
|
||||||
# compatible with. This helps avoid breakage when a new Home Manager release
|
# compatible with. This helps avoid breakage when a new Home Manager release
|
||||||
# introduces backwards incompatible changes.
|
# introduces backwards incompatible changes.
|
||||||
#
|
#
|
||||||
# You should not change this value, even if you update Home Manager. If you do
|
# 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
|
# want to update the value, then make sure to first check the Home Manager
|
||||||
# release notes.
|
# release notes.
|
||||||
home.stateVersion = "23.11"; # Please read the comment before changing.
|
home.stateVersion = "23.11"; # Please read the comment before changing.
|
||||||
|
|
||||||
nixpkgs.config.allowUnfree = true;
|
nixpkgs.config.allowUnfree = true;
|
||||||
|
|
||||||
# The home.packages option allows you to install Nix packages into your
|
# The home.packages option allows you to install Nix packages into your
|
||||||
# environment.
|
# environment.
|
||||||
home.packages = [
|
home.packages = with pkgs; [
|
||||||
pkgs.file
|
file
|
||||||
pkgs.unzip
|
unzip
|
||||||
pkgs.zip
|
zip
|
||||||
|
|
||||||
pkgs.dig
|
dig
|
||||||
pkgs.mtr
|
mtr
|
||||||
|
|
||||||
pkgs.firefox
|
firefox
|
||||||
(pkgs.writeShellScriptBin "spotify" ''
|
(writeShellScriptBin "spotify" ''
|
||||||
exec ${pkgs.spotify}/bin/spotify --enable-features=UseOzonePlatform --ozone-platform=wayland
|
exec ${pkgs.spotify}/bin/spotify --enable-features=UseOzonePlatform --ozone-platform=wayland
|
||||||
'')
|
'')
|
||||||
|
|
||||||
pkgs.hyprland
|
hyprland
|
||||||
pkgs.dunst
|
dunst
|
||||||
pkgs.waybar
|
waybar
|
||||||
|
wl-clipboard
|
||||||
|
|
||||||
(pkgs.writeShellScriptBin "discord" ''
|
(writeShellScriptBin "discord" ''
|
||||||
exec ${pkgs.discord}/bin/discord --enable-features=UseOzonePlatform --ozone-platform=wayland
|
exec ${pkgs.discord}/bin/discord --enable-features=UseOzonePlatform --ozone-platform=wayland
|
||||||
'')
|
'')
|
||||||
pkgs.kitty
|
kitty
|
||||||
pkgs.wofi
|
wofi
|
||||||
pkgs.pipewire
|
pipewire
|
||||||
pkgs.lsd
|
lsd
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
# Home Manager is pretty good at managing dotfiles. The primary way to manage
|
# Home Manager is pretty good at managing dotfiles. The primary way to manage
|
||||||
# plain files is through 'home.file'.
|
# plain files is through 'home.file'.
|
||||||
home.file = {
|
home.file = {
|
||||||
# # Building this configuration will create a copy of 'dotfiles/screenrc' in
|
# # Building this configuration will create a copy of 'dotfiles/screenrc' in
|
||||||
# # the Nix store. Activating the configuration will then make '~/.screenrc' a
|
# # the Nix store. Activating the configuration will then make '~/.screenrc' a
|
||||||
# # symlink to the Nix store copy.
|
# # symlink to the Nix store copy.
|
||||||
# ".screenrc".source = dotfiles/screenrc;
|
# ".screenrc".source = dotfiles/screenrc;
|
||||||
|
|
||||||
# # You can also set the file content immediately.
|
# # You can also set the file content immediately.
|
||||||
# ".gradle/gradle.properties".text = ''
|
# ".gradle/gradle.properties".text = ''
|
||||||
# org.gradle.console=verbose
|
# org.gradle.console=verbose
|
||||||
# org.gradle.daemon.idletimeout=3600000
|
# org.gradle.daemon.idletimeout=3600000
|
||||||
# '';
|
# '';
|
||||||
};
|
};
|
||||||
|
|
||||||
# Home Manager can also manage your environment variables through
|
# Home Manager can also manage your environment variables through
|
||||||
# 'home.sessionVariables'. If you don't want to manage your shell through Home
|
# 'home.sessionVariables'. If you don't want to manage your shell through Home
|
||||||
# Manager then you have to manually source 'hm-session-vars.sh' located at
|
# Manager then you have to manually source 'hm-session-vars.sh' located at
|
||||||
# either
|
# either
|
||||||
#
|
#
|
||||||
# ~/.nix-profile/etc/profile.d/hm-session-vars.sh
|
# ~/.nix-profile/etc/profile.d/hm-session-vars.sh
|
||||||
#
|
#
|
||||||
# or
|
# or
|
||||||
#
|
#
|
||||||
# ~/.local/state/nix/profiles/profile/etc/profile.d/hm-session-vars.sh
|
# ~/.local/state/nix/profiles/profile/etc/profile.d/hm-session-vars.sh
|
||||||
#
|
#
|
||||||
# or
|
# or
|
||||||
#
|
#
|
||||||
# /etc/profiles/per-user/noa/etc/profile.d/hm-session-vars.sh
|
# /etc/profiles/per-user/noa/etc/profile.d/hm-session-vars.sh
|
||||||
#
|
#
|
||||||
home.sessionVariables = {
|
home.sessionVariables = {
|
||||||
EDITOR = "nvim";
|
EDITOR = "nvim";
|
||||||
TERM = "kitty";
|
TERM = "kitty";
|
||||||
};
|
};
|
||||||
|
|
||||||
xdg.userDirs.enable = true;
|
xdg.userDirs.enable = true;
|
||||||
xdg.userDirs.createDirectories = true;
|
xdg.userDirs.createDirectories = true;
|
||||||
|
|
||||||
# Let Home Manager install and manage itself.
|
# Let Home Manager install and manage itself.
|
||||||
programs.home-manager.enable = true;
|
programs.home-manager.enable = true;
|
||||||
|
|
||||||
# TODO move to seperate file
|
# TODO move to seperate file
|
||||||
programs.zsh = {
|
programs.zsh = {
|
||||||
enable=true;
|
enable=true;
|
||||||
shellAliases = {
|
shellAliases = {
|
||||||
ll = "lsd -l";
|
ll = "lsd -l";
|
||||||
update = "sudo nixos-rebuild switch --flake /etc/nixos#default";
|
lt = "lsd -l --tree";
|
||||||
|
update = "sudo nixos-rebuild switch --flake $HOME/nixos#default";
|
||||||
};
|
};
|
||||||
history = {
|
history = {
|
||||||
path = "${config.xdg.dataHome}/zsh/history";
|
path = "${config.xdg.dataHome}/zsh/history";
|
||||||
|
|
@ -107,7 +109,7 @@
|
||||||
plugins = [ "git" ];
|
plugins = [ "git" ];
|
||||||
theme = "frisk";
|
theme = "frisk";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
programs.kitty = {
|
programs.kitty = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
@ -185,8 +187,8 @@
|
||||||
style = ../../styles/waybar.css;
|
style = ../../styles/waybar.css;
|
||||||
};
|
};
|
||||||
|
|
||||||
# TODO extend and move to seperate file
|
# TODO extend and move to seperate file
|
||||||
programs.git = {
|
programs.git = {
|
||||||
enable = true;
|
enable = true;
|
||||||
userName = "Noa Aarts";
|
userName = "Noa Aarts";
|
||||||
userEmail = "itepastra@gmail.com";
|
userEmail = "itepastra@gmail.com";
|
||||||
|
|
@ -194,84 +196,211 @@
|
||||||
init = { defaultBranch = "main"; };
|
init = { defaultBranch = "main"; };
|
||||||
safe.directory = "/etc/nixos";
|
safe.directory = "/etc/nixos";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
# TODO move to seperate file
|
# TODO move to seperate file
|
||||||
# TODO create neovim config
|
programs.nixvim = {
|
||||||
programs.nixvim = {
|
enable = true;
|
||||||
enable = true;
|
vimAlias = true;
|
||||||
vimAlias = true;
|
globals = {
|
||||||
|
mapleader = " ";
|
||||||
|
maplocalleader = " ";
|
||||||
|
};
|
||||||
|
|
||||||
# Configure neovim options...
|
colorschemes.catppuccin.enable = true;
|
||||||
options = {
|
|
||||||
relativenumber = true;
|
|
||||||
incsearch = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
# ...mappings...
|
# Configure neovim options...
|
||||||
keymaps = [
|
options = {
|
||||||
{
|
tabstop = 4;
|
||||||
mode = "n";
|
shiftwidth = 4;
|
||||||
key = "<C-s>";
|
relativenumber = true;
|
||||||
action = ":w<CR>";
|
incsearch = true;
|
||||||
}
|
hlsearch = true;
|
||||||
{
|
number = true;
|
||||||
mode = "n";
|
mouse = "a";
|
||||||
key = "<esc>";
|
showmode = false;
|
||||||
action = ":noh<CR>";
|
breakindent = true;
|
||||||
options.silent = true;
|
undofile = true;
|
||||||
}
|
ignorecase = true;
|
||||||
{
|
smartcase = true;
|
||||||
mode = "v";
|
signcolumn = "yes";
|
||||||
key = ">";
|
updatetime = 250;
|
||||||
action = ">gv";
|
timeoutlen = 300;
|
||||||
}
|
splitright = true;
|
||||||
{
|
splitbelow = true;
|
||||||
mode = "v";
|
list = true;
|
||||||
key = "<";
|
listchars = {
|
||||||
action = "<gv";
|
tab = "> ";
|
||||||
}
|
trail = ".";
|
||||||
];
|
nbsp = "_";
|
||||||
|
};
|
||||||
|
inccommand = "nosplit";
|
||||||
|
cursorline = true;
|
||||||
|
scrolloff = 8;
|
||||||
|
};
|
||||||
|
|
||||||
plugins = {
|
# ...mappings...
|
||||||
telescope.enable = true;
|
keymaps = [
|
||||||
|
{
|
||||||
|
mode = "n";
|
||||||
|
key = "<Esc>";
|
||||||
|
action = "<cmd>nohlsearch<CR>";
|
||||||
|
options.desc = "Remove search highlights";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
mode = "t";
|
||||||
|
key = "<Esc><Esc>";
|
||||||
|
action = "<C-\\><C-n>";
|
||||||
|
options.desc = "Exit terminal mode";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
mode = "n";
|
||||||
|
key = "<C-h>";
|
||||||
|
action = "<C-w><C-h>";
|
||||||
|
options.desc = "Move focus to the left window";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
mode = "n";
|
||||||
|
key = "<C-l>";
|
||||||
|
action = "<C-w><C-l>";
|
||||||
|
options.desc = "Move focus to the right window";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
mode = "n";
|
||||||
|
key = "<C-j>";
|
||||||
|
action = "<C-w><C-j>";
|
||||||
|
options.desc = "Move focus to the lower window";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
mode = "n";
|
||||||
|
key = "<C-k>";
|
||||||
|
action = "<C-w><C-k>";
|
||||||
|
options.desc = "Move focus to the upper window";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
mode = "n";
|
||||||
|
key = "<leader>pv";
|
||||||
|
lua = true;
|
||||||
|
action = "vim.cmd.Ex";
|
||||||
|
options.desc = "Open the integrated file explorer";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
lsp = {
|
plugins = {
|
||||||
keymaps = {
|
fugitive.enable = true;
|
||||||
silent = true;
|
comment-nvim.enable = true;
|
||||||
diagnostic = {
|
nvim-colorizer.enable = true;
|
||||||
"<leader>k" = "goto_prev";
|
telescope = {
|
||||||
"<leader>j" = "goto_next";
|
enable = true;
|
||||||
};
|
keymaps = {
|
||||||
|
"<leader>sh" = {
|
||||||
|
action = "help_tags";
|
||||||
|
desc = "[S]earch [H]elp";
|
||||||
|
};
|
||||||
|
"<leader>sk" = {
|
||||||
|
action = "keymaps";
|
||||||
|
desc = "[S]earch [K]eymaps";
|
||||||
|
};
|
||||||
|
"<leader>sf" = {
|
||||||
|
action = "find_files";
|
||||||
|
desc = "[S]earch [F]iles";
|
||||||
|
};
|
||||||
|
"<leader>ss" = {
|
||||||
|
action = "builtin";
|
||||||
|
desc = "[S]earch [S]elect Telescope";
|
||||||
|
};
|
||||||
|
"<leader>sw" = {
|
||||||
|
action = "grep_string";
|
||||||
|
desc = "[S]earch current [W]ord";
|
||||||
|
};
|
||||||
|
"<leader>sg" = {
|
||||||
|
action = "live_grep";
|
||||||
|
desc = "[S]earch by [G]rep";
|
||||||
|
};
|
||||||
|
"<leader>sd" = {
|
||||||
|
action = "diagnostics";
|
||||||
|
desc = "[S]earch [D]iagnostics";
|
||||||
|
};
|
||||||
|
"<leader>sr" = {
|
||||||
|
action = "resume";
|
||||||
|
desc = "[S]earch [R]esume";
|
||||||
|
};
|
||||||
|
"<leader>s." = {
|
||||||
|
action = "oldfiles";
|
||||||
|
desc = "[S]earch recent files (\".\" for repeat)";
|
||||||
|
};
|
||||||
|
"<leader><leader>" = {
|
||||||
|
action = "buffers";
|
||||||
|
desc = "[ ] Find existing buffers";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
treesitter = {
|
||||||
|
enable = true;
|
||||||
|
indent = true;
|
||||||
|
};
|
||||||
|
lsp = {
|
||||||
|
enable = true;
|
||||||
|
enabledServers = [
|
||||||
|
"lua_ls"
|
||||||
|
];
|
||||||
|
keymaps = {
|
||||||
|
silent = true;
|
||||||
|
diagnostic = {
|
||||||
|
"[d" = {
|
||||||
|
action = "goto_prev";
|
||||||
|
desc = "Go to previous [D]iagnostic message";
|
||||||
|
};
|
||||||
|
"]d" = {
|
||||||
|
action = "goto_next";
|
||||||
|
desc = "Go to next [D]iagnostic message";
|
||||||
|
};
|
||||||
|
"<leader>e" = {
|
||||||
|
action = "open_float";
|
||||||
|
desc = "Show diagnostic [E]rror messages";
|
||||||
|
};
|
||||||
|
"<leader>q" = {
|
||||||
|
action = "setloclist";
|
||||||
|
desc = "Open diagnostic [Q]uickfix list";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
gitsigns = {
|
||||||
|
enable = true;
|
||||||
|
signs = {
|
||||||
|
add = { text = "+"; };
|
||||||
|
change = { text = "~"; };
|
||||||
|
delete = { text = "_"; };
|
||||||
|
topdelete = { text = "T"; };
|
||||||
|
changedelete = { text = "~"; };
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
match.ExtraWhitespace = "\\s\\+$";
|
||||||
|
autoCmd = [
|
||||||
|
{
|
||||||
|
event = "FileType";
|
||||||
|
pattern = "nix";
|
||||||
|
command = "setlocal tabstop=2 shiftwidth=2";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
event = "LspAttach";
|
||||||
|
callback = ''
|
||||||
|
function (event)
|
||||||
|
local map = function(keys, func, desc)
|
||||||
|
vim.keymap.set("n", keys, func, { buffer = event.buf, desc = "LSP: " .. desc })
|
||||||
|
end
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
];
|
||||||
|
extraPlugins = with pkgs.vimPlugins; [
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
lspBuf = {
|
# TODO move to seperate file
|
||||||
gd = "definition";
|
wayland.windowManager.hyprland = {
|
||||||
K = "hover";
|
enable = true;
|
||||||
};
|
|
||||||
};
|
|
||||||
servers = {
|
|
||||||
bashls.enable = true;
|
|
||||||
clangd.enable = true;
|
|
||||||
nil_ls.enable = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
# ... and even highlights and autocommands !
|
|
||||||
highlight.ExtraWhitespace.bg = "red";
|
|
||||||
match.ExtraWhitespace = "\\s\\+$";
|
|
||||||
autoCmd = [
|
|
||||||
{
|
|
||||||
event = "FileType";
|
|
||||||
pattern = "nix";
|
|
||||||
command = "setlocal tabstop=2 shiftwidth=2";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
# TODO move to seperate file
|
|
||||||
wayland.windowManager.hyprland = {
|
|
||||||
enable = true;
|
|
||||||
settings = {
|
settings = {
|
||||||
monitor = [
|
monitor = [
|
||||||
"DP-3,2560x1440@144,1920x0,1"
|
"DP-3,2560x1440@144,1920x0,1"
|
||||||
|
|
@ -362,6 +491,6 @@
|
||||||
"$mod,mouse:273,resizewindow"
|
"$mod,mouse:273,resizewindow"
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue