summaryrefslogtreecommitdiff
path: root/home/default.nix
blob: 0f5a1ac65a37b2377d1266ac0e14d1c1ce2d41d9 (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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
{
  lib,
  config,
  pkgs,
  inputs,
  system,
  ...
}: let
  inherit (lib) optionals;
in {
  imports = [
    ./apps
    ./browsers
    ./desktops
    ./gtk
    ./neovim
    ./ssh
    ./tmux
    ./zsh
    ./development.nix
    ./gaming.nix
    ./git.nix
    ./gpg.nix
    ./starship.nix
  ];

  home.username = config.user;
  home.homeDirectory = config.homePath;
  home.stateVersion = config.stateVersion;

  news.display = "silent";
  fonts.fontconfig.enable = true;

  home.packages =
    (with pkgs; [
      home-manager
      pfetch-rs
      yt-dlp
    ])
    ++ [
      inputs.talc.packages.${system}.talc
    ]
    ++ (with pkgs;
      optionals config.desktops.enable [
        # social
        discord
        element-desktop
        gajim
        thunderbird-latest
        # programs
        brightnessctl
        easyeffects
        filezilla
        gimp3
        imv
        mpv
        pavucontrol
        vlc
        zathura
        # media
        ffmpeg
        imagemagick
      ])
    # mirrored from system
    ++ config.extraPackages;

  xdg = {
    enable = true;
    cacheHome = "${config.homePath}/.cache";
    dataHome = "${config.homePath}/.local/share";
    stateHome = "${config.homePath}/.local/state";
    configHome = "${config.homePath}/.config";

    configFile = {
      "aacs/keydb.cfg" = {
        source = ../files/keys/bluray.cfg;
      };
    };

    dataFile = {
      fonts = {
        source = ../files/fonts;
        recursive = true;
      };
    };

    mimeApps = {
      enable = true;
      defaultApplications = {
        # web
        "text/html" = "firefox.desktop";
        "x-scheme-handler/http" = "firefox.desktop";
        "x-scheme-handler/https" = "firefox.desktop";
        "x-scheme-handler/about" = "firefox.desktop";
        "x-scheme-handler/unknown" = "firefox.desktop";

        # images
        "image/png" = "imv.desktop";
        "image/jpeg" = "imv.desktop";
        "image/webp" = "imv.desktop";
        "image/tga" = "imv.desktop";
        "image/bmp" = "imv.desktop";
        "image/gif" = "imv.desktop";

        # audio video
        "video/mp4" = "mpv.desktop";
        "video/x-msvideo" = "mpv.desktop";
        "video/mkv" = "mpv.desktop";
        "video/webm" = "mpv.desktop";
        "audio/mp3" = "mpv.desktop";
        "audio/wav" = "mpv.desktop";

        # other
        "application/pdf" = "org.pwmt.zathura.desktop";
        "x-scheme-handler/mspa" = "unofficial-homestuck-collection.desktop";
        "x-scheme-handler/discord" = "discord.desktop";
        "x-scheme-handler/roblox-player" = "org.vinegarhq.Sober.desktop";
      };
    };

    userDirs = {
      enable = true;
      createDirectories = false;

      desktop = "${config.homePath}/desktop";
      documents = "${config.homePath}/documents";
      download = "${config.homePath}/downloads";
      music = "${config.homePath}/music";
      pictures = "${config.homePath}/pictures";
      publicShare = "${config.homePath}";
      templates = "${config.homePath}";
      videos = "${config.homePath}/videos";
    };
  };

  # remove crap from home dir
  home.sessionVariables = {
    ANDROID_USER_HOME = "${config.xdg.dataHome}/android";
    BUNDLE_USER_CONFIG = "${config.xdg.configHome}/bundle";
    BUNDLE_USER_CACHE = "${config.xdg.cacheHome}/bundle";
    BUNDLE_USER_PLUGIN = "${config.xdg.dataHome}/bundle";
    CABAL_DIR = "${config.xdg.configHome}/cabal";
    CABAL_CONFIG = "${config.xdg.configHome}/cabal/config";
    CARGO_HOME = "${config.xdg.dataHome}/cargo";
    DOCKER_CONFIG = "${config.xdg.configHome}/docker";
    DOTNET_CLI_HOME = "${config.xdg.dataHome}/dotnet";
    EM_CACHE = "${config.xdg.cacheHome}/emscripten";
    FCEUX_HOME = "${config.xdg.configHome}/fceux";
    GRADLE_USER_HOME = "${config.xdg.dataHome}/gradle";
    HISTFILE = "${config.xdg.stateHome}/bash/history";
    JULIA_DEPOT_PATH = "${config.xdg.dataHome}/julia";
    LEIN_HOME = "${config.xdg.dataHome}/lein";
    MIN_HOME = "${config.xdg.dataHome}/mix";
    NODE_REPL_HISTORY = "${config.xdg.stateHome}/node_repl_history";
    NUGET_PACKAGES = "${config.xdg.cacheHome}/NuGetPackages";
    OPAMROOT = "${config.xdg.dataHome}/opam";
    PYTHON_HISTORY = "${config.xdg.stateHome}/python_history";
    RENPY_PATH_TO_SAVES = "${config.xdg.dataHome}/renpy";
    RUSTUP_HOME = "${config.xdg.dataHome}/rustup";
    SCREENDIR = "${config.xdg.dataHome}/screen";
    SQLITE_HISTORY = "${config.xdg.cacheHome}/sqlite_history";
    TEXMFVAR = "${config.xdg.cacheHome}/texlive/texmf-var";
    W3M_DIR = "${config.xdg.dataHome}/w3m";
    WINEPREFIX = "${config.xdg.dataHome}/wine";
    XCOMPOSECACHE = "${config.xdg.cacheHome}/X11/compose";
    _JAVA_OPTIONS = "-Djava.util.prefs.userRoot=${config.xdg.configHome}/java";
  };

  programs.home-manager.enable = true;
}