nix/home.nix

172 lines
5 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; }
)
)
);
2024-06-15 21:59:32 +02:00
in rec {
2024-06-13 15:38:40 +02:00
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; [
2024-06-13 15:38:40 +02:00
xfce.thunar
xfce.tumbler # image previews in thunar
xfce.thunar-volman
xfce.thunar-archive-plugin
xfce.thunar-media-tags-plugin
gvfs # some more stuff for thunar
2024-06-13 15:38:40 +02:00
xarchiver
fortune
vim-full
2024-06-15 21:59:32 +02:00
jetbrains.pycharm-community
# android-studio
# android-tools
2024-06-13 15:38:40 +02:00
feh
element-desktop
lxappearance
pavucontrol
ezquake
discord
libreoffice-qt
wineWowPackages.stable
2024-06-15 21:59:32 +02:00
jetbrains.clion
2024-06-13 15:38:40 +02:00
winetricks
2024-06-15 21:59:32 +02:00
pamixer
gimp
xorg.xkill
gamemode
gdb
trenchbroom
vkquake
ericw-tools
xdotool
yad
2024-06-13 15:38:40 +02:00
# # 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}!"
# '')
(pkgs.writeShellScriptBin "i3custom-center-mouse-on-focus" ''
eval $(xdotool getwindowfocus getwindowgeometry --shell)
MX=$(($X + $WIDTH / 2))
MY=$(($Y + $HEIGHT / 2))
xdotool mousemove $MX $MY
'')
(pkgs.writeShellScriptBin "i3custom-window-actions" ''
yad --splash --mouse --button float:0 --button kill:1 --title="window actions"
case $? in
0) i3custom-floating-toggle;;
1) i3-msg "kill";;
-1) ;;
esac
'')
(pkgs.writeShellScriptBin "i3custom-floating-toggle" ''
i3-msg "mark --add _; [con_mark=f] floating disable, border pixel 1, mark --add --toggle _; [con_mark=_] floating enable, border normal; mark --add --toggle f;"
'')
2024-06-13 15:38:40 +02:00
];
home.file = {
2024-06-15 21:59:32 +02:00
".config/i3/workspace2.json".source = files/workspace2.json;
2024-06-13 15:38:40 +02:00
# # 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
# '';
};
2024-06-15 21:59:32 +02:00
home.sessionVariables = let HOME = home.homeDirectory; in rec {
2024-06-13 15:38:40 +02:00
EDITOR = "vim";
MANSECT = "2:3:3p:3type:1:1p:n:l:8:0:0p:5:4:9:6:7";
# xdg crap thx poz
2024-06-15 21:59:32 +02:00
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}/gnupg";
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";
2024-06-13 15:38:40 +02:00
};
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);
};
2024-06-15 21:59:32 +02:00
home.pointerCursor = {
gtk.enable = true;
x11.enable = true;
name = "aero-drop";
package = pkgs.win7-cursors;
};
2024-06-13 15:38:40 +02:00
gtk = {
enable = true;
iconTheme = {
name = "oxylite";
package = pkgs.oxylite-icon-theme;
};
theme = {
name = "Adwaita-dark";
package = pkgs.gnome.gnome-themes-extra;
};
};
}