nixos-configs/home-manager/default.nix

249 lines
5.4 KiB
Nix
Raw Normal View History

2024-10-26 18:33:47 +00:00
{
lib,
config,
inputs,
2024-11-11 19:43:36 +00:00
self,
2024-10-26 18:33:47 +00:00
...
}: {
2023-10-08 14:57:57 +00:00
imports = [
2024-10-26 18:24:13 +00:00
./neovim
./firefox
./tidal.nix
./gnome.nix
2024-10-27 11:23:20 +00:00
./syncthing.nix
./vscode.nix
2024-11-11 20:57:58 +00:00
./sops.nix
inputs.nix-index-database.hmModules.nix-index
2023-10-08 14:57:57 +00:00
];
2024-06-09 20:00:47 +00:00
xsession.enable = true;
xdg = {
userDirs.enable = true;
mimeApps = {
enable = true;
2024-10-26 18:33:47 +00:00
defaultApplications = let
applications = {
telegram = {
mimeApp = "org.telegram.desktop.desktop";
mimeTypes = ["x-scheme-handler/tg"];
};
2024-10-26 18:33:47 +00:00
librewolf = {
mimeApp = "librewolf.desktop";
mimeTypes = [
"x-scheme-handler/http"
"text/html"
"application/xhtml+xml"
"x-scheme-handler/https"
"application/pdf"
];
};
gnomeTextEditor = {
mimeApp = "org.gnome.TextEditor.desktop";
mimeTypes = ["text/plain"];
};
loupe = {
mimeApp = "org.gnome.Loupe.desktop";
mimeTypes = [
"image/jpeg"
"image/png"
"image/gif"
"image/webp"
"image/tiff"
"image/x-tga"
"image/vnd-ms.dds"
"image/x-dds"
"image/bmp"
"image/vnd.microsoft.icon"
"image/vnd.radiance"
"image/x-exr"
"image/x-portable-bitmap"
"image/x-portable-graymap"
"image/x-portable-pixmap"
"image/x-portable-anymap"
"image/x-qoi"
"image/svg+xml"
"image/svg+xml-compressed"
"image/avif"
"image/heic"
"image/jxl"
];
};
};
mimeTypesForApp = {
mimeApp,
mimeTypes,
}:
map
(
mimeType: {"${mimeType}" = mimeApp;}
)
mimeTypes;
in
lib.zipAttrs (lib.flatten (map mimeTypesForApp (builtins.attrValues applications)));
};
};
2024-06-09 20:00:47 +00:00
2023-10-08 14:57:57 +00:00
home = {
username = "pim";
homeDirectory = "/home/pim";
stateVersion = "23.05";
};
programs = {
home-manager.enable = true;
chromium.enable = true;
2024-06-09 20:00:47 +00:00
bat.enable = true;
fzf = {
enable = true;
enableZshIntegration = true;
};
alacritty = {
enable = true;
2024-06-11 17:59:58 +00:00
settings.shell = {
program = lib.getExe config.programs.tmux.package;
2024-10-26 18:33:47 +00:00
args = ["attach"];
2024-06-11 17:59:58 +00:00
};
};
2024-06-09 20:00:47 +00:00
direnv = {
enable = true;
enableBashIntegration = true;
nix-direnv.enable = true;
};
atuin = {
2024-06-09 20:00:47 +00:00
enable = true;
2024-10-26 18:33:47 +00:00
flags = ["--disable-up-arrow"];
enableFishIntegration = true;
settings = {
auto_sync = true;
sync_frequency = "5m";
sync_address = "https://atuin.kun.is";
};
2024-06-09 20:00:47 +00:00
};
fish = {
2024-06-09 20:00:47 +00:00
enable = true;
interactiveShellInit = ''
set -U fish_greeting
'';
shellAbbrs = {
htop = "btop";
gp = "git push";
gco = "git checkout";
gd = "git diff";
gc = "git commit";
gca = "git commit --amend";
gpl = "git pull";
gb = "git branch";
ga = "git add";
gl = "git log";
gs = "git status";
tf = "tofu";
};
};
2024-06-11 17:59:58 +00:00
starship = {
enable = true;
enableFishIntegration = true;
enableTransience = true;
settings.nix_shell.heuristic = true;
};
nix-index = {
enable = true;
enableFishIntegration = true;
2024-06-11 17:59:58 +00:00
};
tmux = {
enable = true;
shell = lib.getExe config.programs.fish.package;
2024-06-11 17:59:58 +00:00
shortcut = "a";
clock24 = true;
newSession = true;
mouse = true;
escapeTime = 10;
terminal = "screen-256color";
extraConfig = ''
unbind _
bind _ split-window -h
unbind -
bind - split-window -v
unbind h
bind h select-pane -L
unbind j
bind j select-pane -D
unbind k
bind k select-pane -U
unbind l
bind l select-pane -R
2024-06-11 17:59:58 +00:00
'';
2024-06-09 20:00:47 +00:00
};
ssh = {
enable = true;
extraConfig = "User root";
2024-10-26 18:33:47 +00:00
matchBlocks.github = lib.hm.dag.entryBefore ["*"] {
hostname = "github.com";
user = "pizzapim";
identitiesOnly = true;
2024-06-09 20:00:47 +00:00
};
};
git = {
enable = true;
userName = "Pim Kunis";
userEmail = "pim@kunis.nl";
2024-06-09 20:00:47 +00:00
extraConfig = {
push.autoSetupRemote = true;
commit.verbose = true;
pull.rebase = true;
init.defaultBranch = "master";
2024-06-09 20:00:47 +00:00
};
};
# Currently, it is not possible to have Home Manager manage Liberwolf extensions.
# There is a draft PR which addresses this:
# https://github.com/nix-community/home-manager/pull/3339
# The extensions I currently use are:
# - ublock-origin (already installed by librewolf)
# - cookie-autodelete
# - clearurls
# - istilldontcareaboutcookies
# - keepassxc-browser
# - redirector
# - violentmonkey
# - boring-rss
# - kagi-search
# - refined-github
librewolf = {
enable = true;
2024-06-09 20:00:47 +00:00
settings = {
"identity.fxaccounts.enabled" = true;
"privacy.clearOnShutdown.history" = false;
"privacy.clearOnShutdown.downloads" = false;
"browser.translations.automaticallyPopup" = false;
"browser.aboutConfig.showWarning" = false;
"privacy.clearOnShutdown.cookies" = false;
};
};
2023-10-08 14:57:57 +00:00
};
}