home.nix (3402B) download
1{ config, pkgs, fetchgit, ... }:
2
3rec {
4 # Home Manager needs a bit of information about you and the paths it should
5 # manage.
6 home.username = "friedel"; # EDIT ME
7 home.homeDirectory = "/home/friedel"; # EDIT ME
8
9 # The home.packages option allows you to install Nix packages into your
10 # environment.
11 home.packages = [
12 (pkgs.callPackage pkgs/dmenu.nix { })
13 (pkgs.callPackage pkgs/dwm.nix { })
14 (pkgs.callPackage pkgs/pretty-svstat.nix { })
15 (pkgs.callPackage pkgs/slstatus.nix { })
16 (pkgs.callPackage pkgs/st.nix { })
17 (pkgs.callPackage pkgs/void-runit.nix { })
18 (pkgs.callPackage pkgs/weakbox.nix { })
19 (pkgs.callPackage pkgs/stw.nix { })
20 (pkgs.callPackage pkgs/tabbed.nix { })
21 (pkgs.callPackage pkgs/surf.nix { })
22 (pkgs.callPackage pkgs/textselect.nix { })
23
24 # use nix' nix, it is more up-to-date
25 pkgs.nix
26
27 pkgs.nixpkgs-fmt
28
29 (pkgs.nerdfonts.override { fonts = [ "CascadiaCode" "FiraCode" ]; })
30 ];
31
32 # Home Manager is pretty good at managing dotfiles. The primary way to manage
33 # plain files is through 'home.file'.
34 home.file = {
35 ".xservice".source = (import common/make-service.nix { }) rec {
36 name = "home-service";
37 services = pkgs.callPackage ./services.nix {};
38 supervise = sv: "/tmp/${name}/supervise.${sv}";
39 };
40
41 ".xinitrc".source = dotfiles/xinitrc;
42 ".Xresources".source = dotfiles/xresources;
43 "home-manager".source = ./.;
44 };
45
46 home.sessionVariables = {
47 EDITOR = "vim";
48 PLAN9 = "$HOME/plan9";
49 WEAKBOX = "$HOME/.glibc";
50 HOMEMANAGER = ./.;
51 };
52
53 nix = {
54 package = pkgs.nix;
55 # settings.experimental-features = [ "nix-command" "flakes" "impure-derivations" ];
56
57 extraOptions = "experimental-features = nix-command flakes impure-derivations";
58 };
59
60 # Let Home Manager install and manage itself.
61 programs.home-manager.enable = true;
62
63 programs.nix-index.enable = true;
64
65 programs.zsh = {
66 enable = true;
67 enableCompletion = true;
68 autosuggestion.enable = true;
69 syntaxHighlighting.enable = true;
70
71 shellAliases = {
72 ls = "eza";
73 clip = "xclip -selection clipboard";
74 neofetch = "fastfetch";
75 ccat = "bat --style=plain --paging=never --theme=OneHalfDark";
76 hm = "home-manager";
77 cuts = "cut -d ' ''"; # cut by space
78 };
79
80 history = {
81 size = 10000;
82 path = "${config.xdg.dataHome}/zsh/history";
83 };
84
85 initExtra = ''
86 source ${pkgs.grml-zsh-config}/etc/zsh/zshrc
87
88 vsv() {
89 if [ "$UID" -eq 0 ]; then
90 dir=/var/service
91 else
92 dir=$HOME/.xservice
93 fi
94 /usr/bin/vsv -d $dir $@
95 }
96
97 export PATH="$PATH:$HOME/.local/bin:$HOME/.cargo/bin:$PLAN9/bin"
98 export MANPATH="$MANPATH:$HOME/.local/share/man:$PLAN9/man"
99
100 if [[ -z $DISPLAY ]] && [[ $(tty) = /dev/tty1 ]]; then
101 startx
102 fi
103 '';
104 };
105
106 programs.vim = {
107 enable = true;
108 plugins = with pkgs.vimPlugins; [
109 vim-one
110 vim-airline
111 vim-airline-themes
112 auto-pairs
113 vim-auto-save
114 ale
115 ];
116 settings = {
117 background = "light";
118 number = true;
119 tabstop = 4;
120 shiftwidth = 4;
121 relativenumber = true;
122 };
123 extraConfig = builtins.readFile dotfiles/vimrc;
124 };
125
126 targets.genericLinux.enable = true;
127
128 home.stateVersion = "24.05"; # Please read the comment before changing.
129}