personal/dotfiles

home.nix in framework
Repositories | Summary | Log | Files | README.md | LICENSE

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