about summary refs log tree commit diff
path: root/modules/shell/zsh/default.nix
blob: 880b6c99540200dc84787487ac490ad895680272 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
{ pkgs, config, ... }:

{
  environment.etc.zshrc.text = ''
    unsetopt GLOBAL_RCS

    if [ -z "$__NIXOS_SET_ENVIRONMENT_DONE" ]; then
        . ${config.system.build.setEnvironment}
    fi
  '';

  environment.extraInit = ''
    export ZDOTDIR="/etc/xdg/nixos/per-user/$USER/zsh"
  '';

  systemd.tmpfiles.rules = [
    "d ${config.users.users.qyliss.home}/state/zsh 0700 qyliss qyliss"
  ];

  users.users.qyliss.shell = pkgs.zsh;

  users.users.qyliss.xdg.config.paths."zsh/.zshrc" =
    with pkgs; writeText "zshrc" (callPackage ./zshrc.nix {});

  environment.systemPackages = with pkgs; [ zsh nix-zsh-completions ];
}