335 lines
7.4 KiB
Nix
335 lines
7.4 KiB
Nix
{ config, pkgs, lib, ... }: with builtins;
|
||
let
|
||
mkSettings = s:
|
||
concatStringsSep
|
||
"\n"
|
||
(attrValues
|
||
(mapAttrs
|
||
(k: v:
|
||
if typeOf v == "bool" then
|
||
if v then "set ${k}" else "set no${k}"
|
||
else
|
||
"set ${k}=${toString v}")
|
||
s
|
||
)
|
||
);
|
||
boolToString = b: if b then "true" else "false";
|
||
toLuaTable = as:
|
||
"{" +
|
||
( concatStringsSep
|
||
", "
|
||
( filter
|
||
(attr: !isNull attr)
|
||
( attrValues
|
||
( mapAttrs
|
||
(k: v: if v then "${k}=true" else null)
|
||
as
|
||
)
|
||
)
|
||
)
|
||
) +
|
||
"}";
|
||
mkMapping = {
|
||
mode,
|
||
binding,
|
||
command,
|
||
nowait?false,
|
||
silent?false,
|
||
unique?false,
|
||
expr?false
|
||
}:
|
||
"vim.api.nvim_set_keymap(${toJSON mode}, ${toJSON binding}, ${toJSON command}, ${toLuaTable {inherit nowait silent unique expr;}})";
|
||
mkMappings =
|
||
m:
|
||
"lua << END-OF-KEYBINDS\n" +
|
||
(concatStringsSep "\n" (map mkMapping m)) +
|
||
"\nEND-OF-KEYBINDS";
|
||
mkRuntimes = rs:
|
||
if rs == [] then "" else
|
||
"set runtimepath+=" +
|
||
( concatStringsSep
|
||
","
|
||
(map (rt: "${rt}") rs)
|
||
);
|
||
mkVimHeader = h: "\"\"\"\"\"\"\"\" ${h} \"\"\"\"\"\"\"\"\"";
|
||
mkVimSection = section:
|
||
(concatStringsSep "\n\n\n"
|
||
(filter
|
||
(v: !isNull v)
|
||
(attrValues
|
||
(mapAttrs
|
||
(k: v: if "" == v then null else (mkVimHeader k) + "\n" + v)
|
||
section
|
||
)
|
||
)
|
||
)
|
||
);
|
||
mkVimSections = sections: concatStringsSep "\n\n\n" (map mkVimSection sections);
|
||
mkConfig = { settings?{}, mappings?[], runtimes?[], extra?"" }:
|
||
mkVimSections [
|
||
{"ADDITIONAL RUNTIME DIRS" = mkRuntimes runtimes;}
|
||
{"SETTINGS" = mkSettings settings;}
|
||
{"KEY BINGINGS" = mkMappings mappings;}
|
||
{"MANUAL SETTINGS" = extra;}
|
||
];
|
||
|
||
# Via https://gist.github.com/nat-418/d76586da7a5d113ab90578ed56069509
|
||
fromGitHub = ref: repo: pkgs.vimUtils.buildVimPluginFrom2Nix {
|
||
pname = "${lib.strings.sanitizeDerivationName repo}";
|
||
version = ref;
|
||
src = builtins.fetchGit {
|
||
url = "https://github.com/${repo}.git";
|
||
ref = ref;
|
||
};
|
||
};
|
||
in
|
||
{
|
||
# Home Manager needs a bit of information about you and the paths it should
|
||
# manage.
|
||
home.username = "hive";
|
||
home.homeDirectory = "/home/hive";
|
||
|
||
# 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.05"; # Please read the comment before changing.
|
||
|
||
# The home.packages option allows you to install Nix packages into your
|
||
# environment.
|
||
home.packages = with pkgs; [
|
||
bat
|
||
diceware
|
||
pwgen
|
||
srain
|
||
neovide
|
||
xdg-ninja
|
||
schildichat-desktop
|
||
dino
|
||
mangohud
|
||
termpdfpy
|
||
gimp
|
||
lollypop
|
||
skim
|
||
picard
|
||
syncthing
|
||
armcord
|
||
tdesktop
|
||
ripgrep
|
||
tmate
|
||
comic-mono
|
||
comfortaa
|
||
btop
|
||
firefox
|
||
apostrophe
|
||
warp
|
||
syncplay
|
||
mpv
|
||
wl-clipboard
|
||
adw-gtk3
|
||
] ++ ( with pkgs.gnome; [
|
||
gnome-boxes
|
||
gnome-tweaks
|
||
dconf-editor
|
||
] ++ ( with pkgs.gnomeExtensions; [
|
||
night-theme-switcher
|
||
rounded-window-corners
|
||
appindicator
|
||
]));
|
||
|
||
|
||
# Home Manager is pretty good at managing dotfiles. The primary way to manage
|
||
# plain files is through 'home.file'.
|
||
home.file = {
|
||
# # Building this configuration will create a copy of 'dotfiles/screenrc' in
|
||
# # the Nix store. Activating the configuration will then make '~/.screenrc' a
|
||
# # symlink to the Nix store copy.
|
||
# ".screenrc".source = dotfiles/screenrc;
|
||
|
||
# # You can also set the file content immediately.
|
||
# ".gradle/gradle.properties".text = ''
|
||
# org.gradle.console=verbose
|
||
# org.gradle.daemon.idletimeout=3600000
|
||
# '';
|
||
};
|
||
|
||
home.sessionVariables = {
|
||
# system configuration
|
||
VISUAL = "neovide --nofork";
|
||
NEOVIDE_MULTIGRID = 1;
|
||
|
||
# fish config
|
||
fish_greeting = "✨️ heya ${config.home.username}, welcome to $(hostnamectl --pretty) ~";
|
||
};
|
||
|
||
# configure programs
|
||
programs.home-manager.enable = true;
|
||
programs.git = {
|
||
enable = true;
|
||
lfs.enable = true;
|
||
delta = {
|
||
enable = true;
|
||
options = {
|
||
decorations = {
|
||
commit-decoration-style = "bold yellow box ul";
|
||
file-decoration-style = "none";
|
||
file-style = "bold yellow ul";
|
||
hunk-header-decoration-style = "cyan box ul";
|
||
};
|
||
features = "side-by-side line-numbers decorations";
|
||
};
|
||
};
|
||
signing = {
|
||
key = "DD901BA40FBBB127";
|
||
signByDefault = true;
|
||
};
|
||
userEmail = "theotheroracle@disroot.org";
|
||
userName = "Bit Borealis";
|
||
extraConfig = {
|
||
init.defaultBranch = "main";
|
||
};
|
||
};
|
||
programs.neovim = {
|
||
enable = true;
|
||
defaultEditor = true;
|
||
viAlias = true;
|
||
vimAlias = true;
|
||
vimdiffAlias = true;
|
||
withNodeJs = true;
|
||
|
||
plugins = with pkgs.vimPlugins; [
|
||
editorconfig-nvim
|
||
vim-airline
|
||
vim-airline-themes
|
||
lsp_signature-nvim
|
||
nvim-colorizer-lua
|
||
nnn-vim
|
||
nvim-surround
|
||
nvim-treesitter.withAllGrammars
|
||
(fromGitHub "HEAD" "hiphish/rainbow-delimiters.nvim")
|
||
nvim-lspconfig
|
||
];
|
||
extraConfig = mkConfig {
|
||
settings = {
|
||
number = true;
|
||
linebreak = true;
|
||
showbreak = "+>";
|
||
textwidth = 100;
|
||
showmatch = true;
|
||
|
||
hlsearch = true;
|
||
smartcase = true;
|
||
ignorecase = true;
|
||
|
||
autoindent = true;
|
||
smartindent = true;
|
||
smarttab = true;
|
||
tabstop = 3;
|
||
shiftwidth = 3;
|
||
|
||
display = "lastline";
|
||
formatoptions = "jt";
|
||
ruler = true;
|
||
cc = 101;
|
||
termguicolors = true;
|
||
};
|
||
};
|
||
coc = {
|
||
enable = true;
|
||
};
|
||
};
|
||
programs.fish = {
|
||
enable = true;
|
||
shellAbbrs = {
|
||
nxs = "nix search nixpkgs";
|
||
nxr = "nix run nixpkgs#";
|
||
nxsh = "nix shell nixpkgs#";
|
||
e = "edit";
|
||
nxb = "sudo nixos-rebuild switch";
|
||
nxu = "sudo nixos-rebuild boot --upgrade";
|
||
nxc = "sudo nix-collect-garbage -d";
|
||
};
|
||
shellAliases = {
|
||
aria = "aria2c -c -k1M -x10";
|
||
dw = "diceware -n 6 -d -";
|
||
ksh = "kitty +kitten ssh";
|
||
p = "ping -s 128 -O -c 100 -A -D 1.1.1.1";
|
||
pf = "sudo ping -f -c 100 -A 1.1.1.1";
|
||
};
|
||
functions = {
|
||
edit = ''
|
||
if test $XDG_SESSION_TYPE != tty
|
||
neovide $argv #should be fixed later to use VISUAL somehow, reference funced
|
||
else
|
||
$EDITOR $argv
|
||
end
|
||
'';
|
||
fish_prompt = ''
|
||
set -l last_status $status
|
||
prompt_login
|
||
echo -n ' : '
|
||
set_color $fish_color_cwd
|
||
echo -n (prompt_pwd)
|
||
set_color normal
|
||
fish_vcs_prompt '|%s'
|
||
echo " ඞ"
|
||
if not test $last_status -eq 0
|
||
set_color $fish_color_error
|
||
end
|
||
echo -n "> "
|
||
set_color normal
|
||
'';
|
||
};
|
||
interactiveShellInit = ''
|
||
fish_add_path ~/.local/bin
|
||
fish_add_path ~/.local/bin/scripts
|
||
fish_add_path ~/.local/share/cargo/bin
|
||
fish_add_path /var/lib/flatpak/exports/bin
|
||
fish_vi_key_bindings
|
||
'';
|
||
};
|
||
programs.password-store = {
|
||
enable = true;
|
||
package = pkgs.pass.withExtensions (exts: [ exts.pass-otp ]);
|
||
settings = {
|
||
PASSWORD_STORE_DIR = "${config.xdg.dataHome}/pass";
|
||
PASSWORD_STORE_CLIP_TIME = "60";
|
||
};
|
||
};
|
||
programs.kitty = {
|
||
enable = true;
|
||
shellIntegration.enableFishIntegration = true;
|
||
theme = "Catppuccin-Mocha";
|
||
settings = {
|
||
tab_bar_style = "powerline";
|
||
tab_powerline_style = "round";
|
||
hide_window_decorations = true;
|
||
tab_bar_edge = "top";
|
||
remember_window_size = false;
|
||
initial_window_widthc = 216;
|
||
initial_window_heightc = 168;
|
||
allow_remote_control = true;
|
||
shell = "fish";
|
||
editor = "nvim";
|
||
font_family = "Comic Mono";
|
||
font_size = 13;
|
||
};
|
||
};
|
||
programs.browserpass.enable = true;
|
||
programs.gpg.enable = true;
|
||
|
||
services.etesync-dav = {
|
||
enable = true;
|
||
};
|
||
|
||
# themeing
|
||
qt = {
|
||
enable = true;
|
||
platformTheme = "gnome";
|
||
style.name = "adwaita";
|
||
};
|
||
}
|