system/nix/home.nix

207 lines
4.7 KiB
Nix
Raw Normal View History

2022-04-05 10:03:33 +03:00
{ config, pkgs, ... }:
let
secrets = import ./secrets.nix;
in
{
nixpkgs.overlays = [
(self: super: {
haskellPackages = super.haskellPackages.override {
overrides = hself: hsuper: {
xmonad = hsuper.xmonad_0_17_0;
xmonad-contrib = hsuper.xmonad-contrib_0_17_0;
xmonad-extras = hsuper.xmonad-extras_0_17_0;
};
};
})
];
targets.genericLinux.enable = true;
2022-04-05 10:03:33 +03:00
# Home Manager needs a bit of information about you and the
# paths it should manage.
2022-04-05 11:26:26 +03:00
home.username = secrets.home.name;
home.homeDirectory = secrets.home.dir;
2022-04-05 10:03:33 +03:00
home.keyboard = {
model = "pc105";
layout = "us,ru";
variant = "dvorak,";
options = ["grp:win_space_toggle"];
};
2022-04-05 10:03:33 +03:00
# This value determines the Home Manager release that your
# configuration is compatible with. This helps avoid breakage
# when a new Home Manager release introduces backwards
# incompatible changes.
#
# You can update Home Manager without changing this value. See
# the Home Manager release notes for a list of state version
# changes in each release.
home.stateVersion = "21.11";
home.packages = with pkgs; [
# system ui
dmenu # menu for x window system
flameshot # powerful yet simple to use screenshot software
2022-04-05 17:47:31 +03:00
# tools
xh # friendly and fast tool for sending HTTP requests
fd # a simple, fast and user-friendly alternative to find
bat # a cat clone with syntax highlighting and git integration
# haskell
stylish-haskell # formatter
# database
postgresql_12 # 🤷 I need only psql
# browser
librewolf # a fork of firefox, focused on privacy, security and freedom
2022-04-05 17:18:23 +03:00
];
2022-04-05 17:47:31 +03:00
home.sessionVariables = {
EDITOR = "nvim";
};
xsession = {
enable = true;
windowManager.xmonad = {
enable = true;
enableContribAndExtras = true;
};
};
services.trayer = {
enable = true;
settings = {
SetDockType = true;
SetPartialStrut = true;
expand = true;
transparent = true;
alpha = 0;
edge = "top";
align = "right";
width = 4;
height = 20;
tint = "0xff222222";
};
};
2022-04-08 13:51:41 +03:00
services.screen-locker = {
enable = true;
2022-04-14 16:55:53 +03:00
lockCmd = "/bin/bash ~/scripts/lock.sh";
2022-04-08 13:51:41 +03:00
inactiveInterval = 5;
};
2022-04-05 10:03:33 +03:00
# Let Home Manager install and manage itself.
programs.home-manager.enable = true;
2022-04-05 10:42:47 +03:00
2022-04-05 17:18:23 +03:00
# enable z shell
2022-04-05 16:40:07 +03:00
programs.zsh = {
enable = true;
enableAutosuggestions = true;
defaultKeymap = "viins";
dotDir = ".config/zsh";
history = {
path = "${config.xdg.dataHome}/zsh/zsh_history";
expireDuplicatesFirst = true;
ignorePatterns = [
"rm *"
"kill *"
];
};
2022-04-05 16:40:07 +03:00
oh-my-zsh = {
enable = true;
theme = "robbyrussell";
};
initExtraFirst = ''
# nix
if [ -e $HOME/.nix-profile/etc/profile.d/nix.sh ]; then
source $HOME/.nix-profile/etc/profile.d/nix.sh;
fi
source $HOME/.nix-profile/etc/profile.d/hm-session-vars.sh
export NIX_PATH=$HOME/.nix-defexpr/channels''${NIX_PATH:+:$NIX_PATH}
# ghcup
if [ -f "$HOME/.ghcup/env" ]; then
source "$HOME/.ghcup/env"
fi
'';
2022-04-05 16:40:07 +03:00
};
2022-04-05 17:18:23 +03:00
# enable git VCS
2022-04-05 11:26:26 +03:00
programs.git = {
enable = true;
userName = secrets.git.name;
userEmail = secrets.git.email;
extraConfig = {
init.defaultBranch = "main";
pull.rebase = true;
};
aliases = {
co = "checkout";
st = "status -sb";
2022-04-07 14:26:29 +03:00
d = "diff";
dc = "diff --cached";
aa = "add .";
ai = "add -i";
c = "commit";
cm = "commit -m";
ca = "commit --amend";
cam = "commit --amend -m";
can = "commit --amend --no-edit";
p = "push";
pf = "push --force-with-lease";
rb = "rebase";
rbi = "rebase -i";
};
2022-04-05 11:26:26 +03:00
};
2022-04-05 17:18:23 +03:00
# replacement for 'ls' written in rust
2022-04-05 10:42:47 +03:00
programs.exa = {
enable = true;
2022-04-05 16:40:07 +03:00
enableAliases = true;
};
2022-04-05 17:18:23 +03:00
# a fast cd command that learns your habbits
programs.zoxide = {
enable = true;
enableZshIntegration = true;
};
2022-04-14 16:55:53 +03:00
home.file = {
"scripts" = {
source = ../scripts;
recursive = true;
};
2022-04-14 16:55:53 +03:00
"pictures/wallpapers" = {
source = ../wallpapers;
recursive = true;
};
};
2022-04-14 16:55:53 +03:00
xdg = {
enable = true;
configFile = {
# add config for alacritty terminal
"alacritty/alacritty.yml".source = ../programs/alacritty/alacritty.yml;
# add config for xmonad window manager
# "xmonad/xmonad.hs".source = ../programs/xmonad/xmonad.hs;
# "xmobar/xmobar.hs".source = ../programs/xmonad/xmobar.hs;
"stylish-haskell/config.yaml".source = ../programs/stylish-haskell/config.yml;
};
};
2022-04-05 10:03:33 +03:00
}