306 lines
8.2 KiB
Nix
306 lines
8.2 KiB
Nix
# This is your home-manager configuration file
|
|
# Use this to configure your home environment (it replaces ~/.config/nixpkgs/home.nix)
|
|
|
|
# The nixosConfig allows to access the toplevel system configuration from within home manager
|
|
# https://github.com/nix-community/home-manager/blob/586ac1fd58d2de10b926ce3d544b3179891e58cb/nixos/default.nix#L19
|
|
{ inputs, hostname, username, lib, mylib, config, nixosConfig, pkgs, ... }:
|
|
|
|
# This is a module
|
|
# Because no imports/options/config is defined explicitly, everything is treated as config
|
|
# { inputs, lib, ... }: { ... } gets turned into { inputs, lib, ... }: { config = { ... }; } implicitly
|
|
let
|
|
|
|
in rec {
|
|
|
|
# Every module is a nix expression, specifically a function { inputs, lib, ... }: { ... }
|
|
# Every module (/function) is called with the same arguments as this module (home.nix)
|
|
# Arguments with matching names are "plugged in" into the right slots,
|
|
# the case of different arity is handled by always providing ellipses (...) in module definitions
|
|
imports = [
|
|
# Import the host-specific user-config
|
|
./${hostname}
|
|
|
|
../modules
|
|
|
|
# inputs.nixvim.homeManagerModules.nixvim
|
|
];
|
|
|
|
modules = {
|
|
# Config my modules
|
|
emacs = {
|
|
enable = true;
|
|
pgtkNativeComp = false;
|
|
nativeComp = false;
|
|
nixpkgs = true;
|
|
|
|
doom.enable = true;
|
|
doom.autoSync = true;
|
|
doom.autoUpgrade = false; # Very volatile as the upgrade fails sometimes with bleeding edge emacs
|
|
};
|
|
|
|
firefox = {
|
|
enable = true;
|
|
wayland = true;
|
|
vaapi = true;
|
|
disableTabBar = true;
|
|
defaultBookmarks = true;
|
|
gnomeTheme = true; # I like it also with Plasma
|
|
};
|
|
|
|
fish.enable = true;
|
|
|
|
flatpak = {
|
|
enable = true;
|
|
autoUpdate = true;
|
|
autoPrune = true;
|
|
|
|
flatseal.enable = true;
|
|
discord.enable = true;
|
|
spotify.enable = true;
|
|
bottles.enable = true;
|
|
};
|
|
|
|
gnome = {
|
|
enable = false;
|
|
extensions = true;
|
|
|
|
theme = {
|
|
papirusIcons = true;
|
|
numixCursor = true;
|
|
};
|
|
|
|
settings = {
|
|
};
|
|
};
|
|
|
|
kitty.enable = true;
|
|
|
|
misc = {
|
|
enable = true;
|
|
|
|
keepass = {
|
|
enable = true;
|
|
autostart = true;
|
|
};
|
|
|
|
protonmail = {
|
|
enable = true;
|
|
autostart = true;
|
|
};
|
|
};
|
|
|
|
neovim = {
|
|
enable = true;
|
|
alias = true;
|
|
};
|
|
|
|
nextcloud = {
|
|
enable = true;
|
|
autostart = true;
|
|
};
|
|
|
|
ranger = {
|
|
enable = true;
|
|
preview = true;
|
|
};
|
|
};
|
|
|
|
# Temporary hack: https://github.com/nix-community/home-manager/issues/3342
|
|
# TODO: Remove when possible
|
|
manual.manpages.enable = false;
|
|
manual.html.enable = false;
|
|
|
|
# TODO: Gnome terminal config
|
|
# TODO: Store the external binaries for my derivations in GitHub LFS (Vital, NeuralDSP, other plugins etc.)
|
|
# TODO: Derivations for bottles like UPlay, NeuralDSP, LoL (don't know what is possible with bottles-cli though)
|
|
# TODO: When bottles derivations are there remove the bottles option from audio/gaming module and assert that bottles is enabled in flatpak module
|
|
|
|
# Chinese Input
|
|
i18n.inputMethod.enabled = "fcitx5";
|
|
i18n.inputMethod.fcitx5.addons = with pkgs; [
|
|
fcitx5-gtk
|
|
libsForQt5.fcitx5-qt
|
|
fcitx5-chinese-addons
|
|
fcitx5-configtool # TODO: Remove this and set config through HomeManager
|
|
];
|
|
|
|
# Make fonts installed through user packages available to applications
|
|
# NOTE: I don't think I need this anymore as all fonts are installed through the system config but let's keep this just in case
|
|
fonts.fontconfig.enable = false; # Also updates the font-cache
|
|
|
|
# Generate a list of installed user packages in ~/.local/share/current-user-packages
|
|
home.file.".local/share/current-user-packages".text = let
|
|
packages = builtins.map (p: "${p.name}") home.packages;
|
|
sortedUnique = builtins.sort builtins.lessThan (lib.unique packages);
|
|
formatted = builtins.concatStringsSep "\n" sortedUnique;
|
|
in
|
|
formatted;
|
|
|
|
home = {
|
|
username = username; # Inherited from flake.nix
|
|
homeDirectory = "/home/${home.username}";
|
|
enableNixpkgsReleaseCheck = true;
|
|
|
|
# TODO: There are many more home.* options
|
|
|
|
# Environment variables
|
|
sessionVariables = {
|
|
LANG = "en_US.UTF-8";
|
|
|
|
DOCKER_BUILDKIT = 1;
|
|
|
|
# Enable wayland
|
|
XDG_SESSION_TYPE = "wayland";
|
|
QT_QPA_PLATFORM = "wayland";
|
|
NIXOS_OZONE_WL = "1";
|
|
|
|
# Don't use system wine, use bottles
|
|
# WINEESYNC = 1;
|
|
# WINEFSYNC = 1;
|
|
# WINEPREFIX = "/home/christoph/.wine";
|
|
|
|
# NOTE: GTK_IM_MODULE, QT_IM_MODULE, XMODIFIERS are set by HomeManager fcitx5 module
|
|
};
|
|
|
|
# Do not change
|
|
stateVersion = "22.05";
|
|
};
|
|
|
|
# TODO: Check what packages are installed here and in modules and check if there is already a service/hm-module for it
|
|
# TODO: If so use this or adapt the config from there (example gnome.sushi is also added to dbus packages in services.sushi)
|
|
# Add stuff for your user as you see fit:
|
|
home.packages = with pkgs; [
|
|
# CLI Tools
|
|
# bat # cat with wings (enabled as program)
|
|
# exa # ls in cool (enabled as program)
|
|
# delta # diffier diff differ (enabled as program)
|
|
# fzf # fuzzy find (enabled as program in fish module)
|
|
procs # Better ps
|
|
tokei # Text file statistics in a project
|
|
rsync # cp on steroids
|
|
rclone # Rsync for cloud
|
|
poppler_utils # pdfunite
|
|
ffmpeg # Convert video (magic)
|
|
imagemagick # Convert image (magic)
|
|
httpie # Cool http client
|
|
(ripgrep.override { withPCRE2 = true; }) # fast as fuck
|
|
nvd # nix rebuild diff
|
|
# du-dust # Disk usage analyzer (for directories)
|
|
gdu # Alternative to du-dust (I like it better)
|
|
duf # Disk usage analyzer (for all disk overview)
|
|
fd # find alternative
|
|
sd # sed alternative
|
|
tealdeer # very fast tldr (very readable man)
|
|
gping # ping with graph
|
|
curlie # curl a'la httpie
|
|
dogdns # dns client
|
|
fclones # duplicate file finder
|
|
gum # nice shell scripts
|
|
lazygit # can always use another git client
|
|
graphviz
|
|
gnuplot
|
|
pandoc
|
|
|
|
# Xooooorg
|
|
xclip
|
|
xorg.xwininfo # See what apps run in XWayland
|
|
xdotool
|
|
|
|
# Hardware/Software info
|
|
neofetch # Easily see interesting package versions/kernel
|
|
pciutils
|
|
glxinfo
|
|
wayland-utils
|
|
aha
|
|
radeontop
|
|
|
|
# Web stuff
|
|
signal-desktop
|
|
protonvpn-cli
|
|
yt-dlp # download videos (from almost anywhere)
|
|
cyberdrop-dl # TODO: Make this somehow only available in the needed folder (but keep derivation here?)
|
|
filezilla
|
|
|
|
# Tools
|
|
calibre # Do I even read
|
|
virt-manager
|
|
gource # Visualize git commit log, completely useless
|
|
anki-bin # Use anki-bin as anki is some versions behind
|
|
inputs.nixos-conf-editor.packages."x86_64-linux".nixos-conf-editor
|
|
octave
|
|
|
|
# Office
|
|
jabref # manage bibilography
|
|
sioyek # Scientific pdf reader
|
|
xournalpp # Write with a pen
|
|
libreoffice-qt
|
|
hunspell # I cna't type
|
|
hunspellDicts.en_US
|
|
hunspellDicts.de_DE
|
|
|
|
# TODO: LaTeX module
|
|
texlab
|
|
|
|
# Media
|
|
wacomtablet
|
|
blender
|
|
godot
|
|
obs-studio
|
|
vlc
|
|
kdenlive
|
|
krita
|
|
inkscape
|
|
|
|
# KDE Applications
|
|
# TODO: Make a module out of this
|
|
libsForQt5.kate
|
|
libsForQt5.kwrited # Already included by default
|
|
libsForQt5.ark
|
|
libsForQt5.kdeconnect-kde
|
|
libsForQt5.kcalc
|
|
libsForQt5.ksystemlog
|
|
libsForQt5.kfind
|
|
libsForQt5.discover
|
|
libsForQt5.filelight # Drive file size stats
|
|
libsForQt5.kcolorpicker
|
|
libsForQt5.kgpg
|
|
libsForQt5.kparts # Partition manager
|
|
libsForQt5.kcharselect
|
|
libsForQt5.kompare # Can't be used as git merge tool, but more integrated than kdiff3
|
|
libsForQt5.skanlite
|
|
libsForQt5.kmail
|
|
libsForQt5.kalendar
|
|
okteta
|
|
kdiff3
|
|
kgraphviewer
|
|
kbibtex
|
|
|
|
# Use NixCommunity binary cache
|
|
cachix
|
|
];
|
|
|
|
# Packages with extra options managed by HomeManager natively
|
|
programs = {
|
|
home-manager.enable = true;
|
|
bat.enable = true;
|
|
exa.enable = true;
|
|
# mpv.enable = true; # Doesn't work, only blackscreen?
|
|
ssh.enable = true;
|
|
|
|
direnv = {
|
|
enable = true;
|
|
nix-direnv.enable = true;
|
|
};
|
|
|
|
git = {
|
|
enable = true;
|
|
delta.enable = true;
|
|
userEmail = "christoph.urlacher@protonmail.com";
|
|
userName = "ChUrl";
|
|
};
|
|
};
|
|
|
|
# Nicely reload system units when changing configs
|
|
systemd.user.startServices = "sd-switch";
|
|
}
|