summaryrefslogtreecommitdiff
path: root/users/seth/default.nix
blob: c71dab9d4f5c20a838f4aa2aac7da8399e32cf8a (plain)
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
{ config, lib, ... }:
let
  cfg = config.seth;
in
{
  options.seth = {
    shellAliases.enable = lib.mkEnableOption "shell aliases" // {
      default = config.seth.enable;
      defaultText = lib.literalExpression "config.seth.enable";
    };

    shellVariables.enable = lib.mkEnableOption "shell variables" // {
      default = config.seth.enable;
      defaultText = lib.literalExpression "config.seth.enable";
    };
  };

  imports = [
    ./base
    ./desktop
    ./programs
    ./services
    ./tweaks
  ];

  config = lib.mkMerge [
    (lib.mkIf cfg.shellAliases.enable {
      home.shellAliases = {
        diff = "diff --color=auto";
        g = "git";
        gs = "g status";
      };
    })

    (lib.mkIf cfg.shellVariables.enable {
      home.sessionVariables = {
        EDITOR = "nvim";
        VISUAL = config.home.sessionVariables.EDITOR;
        CARGO_HOME = "${config.xdg.dataHome}/cargo";
        LESSHISTFILE = "${config.xdg.stateHome}/less/history";
      };
    })
  ];
}