nix/home.nix

141 lines
4.1 KiB
Nix
Raw Normal View History

2024-06-13 15:38:40 +02:00
args @ { inputs, lib, config, pkgs, ... }:
let
importCfg = ({prefix, name}:
let
cfg_path = ./${prefix}/${name}.nix;
in (
if builtins.pathExists cfg_path then (
((import cfg_path) args)
) else (
{ enable = true; }
)
)
);
in {
home.stateVersion = "23.11";
home.username = "krizej";
home.homeDirectory = "/home/krizej";
services = lib.genAttrs (import ./services)
(cfg_name: importCfg { prefix = "services"; name = cfg_name; });
programs = lib.genAttrs (import ./programs)
(cfg_name: importCfg { prefix = "programs"; name = cfg_name; });
home.packages = with pkgs; [
xfce.thunar
xfce.tumbler # image previews in thunar
xfce.thunar-volman
xfce.thunar-archive-plugin
xfce.thunar-media-tags-plugin
xarchiver
fortune
vim-full
jetbrains.pycharm-professional
android-studio
android-tools
feh
element-desktop
lxappearance
pavucontrol
ezquake
discord
libreoffice-qt
wineWowPackages.stable
winetricks
# # It is sometimes useful to fine-tune packages, for example, by applying
# # overrides. You can do that directly here, just don't forget the
# # parentheses. Maybe you want to install Nerd Fonts with a limited number of
# # fonts?
# (pkgs.nerdfonts.override { fonts = [ "FantasqueSansMono" ]; })
# # You can also create simple shell scripts directly inside your
# # configuration. For example, this adds a command 'my-hello' to your
# # environment:
# (pkgs.writeShellScriptBin "my-hello" ''
# echo "Hello, ${config.home.username}!"
# '')
];
# 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 = {
EDITOR = "vim";
MANSECT = "2:3:3p:3type:1:1p:n:l:8:0:0p:5:4:9:6:7";
# xdg crap thx poz
XDG_DATA_HOME = "$HOME/.local/share";
XDG_CONFIG_HOME = "$HOME/.config";
XDG_STATE_HOME = "$HOME/.local/state";
XDG_CACHE_HOME = "$HOME/.cache";
ANDROID_USER_HOME = "$XDG_DATA_HOME/android";
ANDROID_HOME = "$XDG_DATA_HOME/android/sdk";
GRADLE_USER_HOME = "$XDG_DATA_HOME/gradle";
PYTHONSTARTUP = "$XDG_CONFIG_HOME/python/pythonrc";
HISTFILE = "$XDG_CACHE_HOME/bash/history";
CARGO_HOME = "$XDG_DATA_HOME/cargo";
_JAVA_OPTIONS = "-Djava.utils.prefs.userRoot=$XDG_CONFIG_HOME/java";
GNUPGHOME = "$XDG_DATA_HOME/cargo";
WINEPREFIX = "$XDG_DATA_HOME/wine";
RUSTUP_HOME = "$XDG_DATA_HOME/rustup";
NUGET_PACKAGES = "$XDG_CACHE_HOME/NuGetPackages";
FCEUX_HOME = "$XDG_CONFIG_HOME/fceux";
DOTNET_CLI_HOME = "$XDG_CONFIG_HOME/dotnet";
GTK2_RC_FILES = lib.mkForce "$XDG_CONFIG_HOME/gtk-2.0/gtkrc";
};
xdg.userDirs = let
home = config.home.homeDirectory;
in {
enable = true;
desktop = "${home}/desktop";
documents = "${home}/documents";
download = "${home}/downloads";
music = "${home}/music";
pictures = "${home}/pictures";
publicShare = "${home}/public";
templates = "${home}/templates";
videos = "${home}/videos";
};
# xorg crap (incl. themes etc)
xsession = {
enable = true;
# special case - i3 is not listed in ./programs/default.nix
windowManager.i3 = (import ./programs/i3.nix args);
};
# home.pointerCursor = {
# gtk.enable = true;
# x11.enable = true;
# name = "Windows-7-Aero-Cursors_Default";
# package = pkgs.win7-cursors;
# };
gtk = {
enable = true;
iconTheme = {
name = "oxylite";
package = pkgs.oxylite-icon-theme;
};
theme = {
name = "Adwaita-dark";
package = pkgs.gnome.gnome-themes-extra;
};
};
}