1
0
Fork 0
localhost/home-manager.nix

197 lines
5.0 KiB
Nix
Raw Permalink Normal View History

2019-07-18 17:29:22 +00:00
{ config, pkgs, ... }:
let
2021-01-13 14:11:48 +00:00
home-manager = builtins.fetchTarball {
2022-12-17 17:49:00 +00:00
url = "https://github.com/nix-community/home-manager/archive/release-22.11.tar.gz";
2019-07-18 17:29:22 +00:00
};
in {
imports = [ "${home-manager}/nixos" ];
2019-07-23 19:09:41 +00:00
home-manager.useUserPackages = true;
2019-07-30 19:16:19 +00:00
home-manager.users.root = {
2022-12-17 17:49:00 +00:00
home.stateVersion = "22.11";
2019-07-30 19:16:19 +00:00
programs = {
zsh = {
enable = true;
oh-my-zsh = {
enable = true;
theme = "gentoo";
plugins = [ "git" ];
};
};
};
home.file.".emacs.d/init.el".source = ./etc/emacs.el;
};
2019-07-18 20:01:07 +00:00
home-manager.users.user = {
2022-12-17 17:49:00 +00:00
home.stateVersion = "22.11";
services.dunst = {
enable = true;
settings = {
global = {
font = "Ubuntu Mono 12";
};
ignore = {
summary = "browserpass: Install native host app";
format = "";
};
};
};
2019-07-18 20:01:07 +00:00
programs = {
git = {
enable = true;
userName = "Mikhail Klementev";
userEmail = "blame@dumpstack.io";
signing = {
signByDefault = true;
key = "0x1525585D1B43C62A";
};
2022-05-11 14:12:06 +00:00
extraConfig = {
init = {
defaultBranch = "default";
};
};
2019-07-18 17:29:22 +00:00
};
2019-07-18 20:52:21 +00:00
2019-07-22 17:33:33 +00:00
tmux = {
enable = true;
baseIndex = 1;
historyLimit = 100500;
keyMode = "emacs";
extraConfig = ''
unbind C-Space
set -g prefix C-Space
bind C-Space send-prefix
set -g status off
'';
plugins = [ pkgs.tmuxPlugins.yank ];
};
2019-07-18 20:52:21 +00:00
zsh = {
enable = true;
oh-my-zsh = {
enable = true;
theme = "gentoo";
2022-12-17 17:50:33 +00:00
plugins = [ "git" "cp" "tmux" ];
2019-07-18 20:52:21 +00:00
};
sessionVariables = {
LC_ALL = "en_US.utf8";
LIBVIRT_DEFAULT_URI = "qemu:///system";
GOPATH = "\${HOME}";
2019-12-26 17:42:35 +00:00
PATH = "\${PATH}:\${HOME}/bin:\${HOME}/.local/bin";
2019-07-18 20:52:21 +00:00
2022-12-17 17:50:33 +00:00
# TODO: Autoconnect only to non-attached session
2019-07-18 20:52:21 +00:00
ZSH_TMUX_AUTOSTART = "true";
2022-12-17 17:50:33 +00:00
ZSH_TMUX_AUTOCONNECT = "false";
NIX_AUTO_RUN = "true";
2019-07-18 20:52:21 +00:00
};
shellAliases = {
mutt = "neomutt";
vim = "emacs -nw";
emacs = "emacs -nw";
clipimage = "xclip -selection clipboard -target image/png -out > out.png";
};
initExtra = ''
which apt >/dev/null 2>&1 && plugins=("\$\{(@)plugins:#tmux-my\}")
2022-05-11 14:22:04 +00:00
# git does not support shell aliases as subcommands, but also
# there is no way to change the current working directory from
# the subprocess. Emulating the required behavior with the wrapper
function git {
if [[ "$1" = "get" ]]; then
REPO=$(echo $2 | sed 's;http.*://;;')
REPO=$(echo $REPO | sed 's;\.git$;;')
${pkgs.git}/bin/git clone https://$REPO $GOPATH/src/$REPO
cd $GOPATH/src/$REPO
else
${pkgs.git}/bin/git $@
fi
}
2019-07-18 20:52:21 +00:00
'';
};
2019-07-21 15:34:06 +00:00
gpg = {
enable = true;
settings = {
throw-keyids = false;
};
};
2019-07-21 15:34:06 +00:00
};
2019-07-18 20:01:07 +00:00
home.file = {
".emacs.d/init.el".source = ./etc/emacs.el;
2019-07-18 20:52:21 +00:00
2019-07-21 15:34:18 +00:00
".mutt/mailcap".source = ./etc/mutt/mailcap;
".mutt/muttrc".source = ./etc/mutt/muttrc;
".mutt/signature".source = ./etc/mutt/signature;
".config/user-dirs.dirs".source = ./etc/user-dirs.dir;
".config/kitty/kitty.conf".source = ./etc/kitty.conf;
2023-02-13 09:11:44 +00:00
".config/rofi/config.rasi".source = ./etc/rofi.rasi;
2019-07-18 20:01:07 +00:00
};
2019-07-18 21:24:55 +00:00
home.keyboard = {
layout = "us,ru";
options = [ "ctrl:nocaps" "grp:rctrl_toggle" ];
};
2019-07-20 10:33:02 +00:00
xsession = {
enable = true;
2022-12-17 17:49:44 +00:00
windowManager.xmonad = {
enable = true;
config = pkgs.writeText "xmonad.hs" (builtins.readFile ./etc/xmonad.hs);
extraPackages = haskellPackages: [
haskellPackages.xmonad-contrib
];
};
2019-07-20 10:33:02 +00:00
initExtra = ''
2020-08-01 16:04:52 +00:00
touchpad=$(xinput | grep -o 'Synaptics.*id=[0-9]*' | cut -d '=' -f 2)
2019-07-20 10:33:02 +00:00
trackpoint=$(xinput | grep -o 'TrackPoint.*id=[0-9]*' | cut -d '=' -f 2)
xsetroot -solid '#000000'
xinput --disable $touchpad
xinput --set-prop $trackpoint 'Device Accel Constant Deceleration' 0.20
2020-01-06 15:25:31 +00:00
${pkgs.xorg.xhost}/bin/xhost local:
2019-07-21 15:13:42 +00:00
ln -fs /tmp/chromium .config/
ln -fs /tmp/chromium .cache/
2023-02-13 09:12:05 +00:00
ln -fs /tmp/chromium .config/google-chrome
ln -fs /tmp/chromium .cache/google-chrome
2020-11-20 18:44:01 +00:00
ln -fs ${pkgs.gtk3}/share/gsettings-schemas/gtk+3-*/glib-2.0 .local/share/
2022-05-11 14:22:47 +00:00
ln -fs .config/tmux/tmux.conf .tmux.conf
2019-07-24 19:13:54 +00:00
kitty --class=viewShiftW3 &
emacs &
chromium &
2019-07-20 10:33:02 +00:00
'';
};
2019-07-21 16:19:06 +00:00
gtk = {
enable = true;
theme.name = "Adwaita-dark";
font.name = "Ubuntu 12";
iconTheme = {
name = "Adwaita";
package = pkgs.gnome3.adwaita-icon-theme;
};
gtk2.extraConfig = ''
gtk-cursor-theme-name = capitaine-cursors;
'';
gtk3.extraConfig = { gtk-cursor-theme-name = "capitaine-cursors"; };
};
2019-07-18 19:51:19 +00:00
};
2019-07-18 17:29:22 +00:00
}