dot

NixOS dotfiles
git clone https://git.echoz.io/dot.git
Log | Files | Refs

default.nix (1287B)


      1 {
      2   lib,
      3   config,
      4 
      5   user,
      6   ...
      7 }:
      8 {
      9   home-manager.users.${user}.xdg.userDirs =
     10     let
     11       tilde = config.home-manager.users.${user}.home.homeDirectory;
     12     in
     13     {
     14       enable = true;
     15       createDirectories = true;
     16 
     17       # cli friendly names
     18       documents = "${tilde}/doc";
     19       download = "${tilde}/dls";
     20       music = "${tilde}/mus";
     21       pictures = "${tilde}/pic";
     22       videos = "${tilde}/vid";
     23       projects = "${tilde}/pro";
     24 
     25       # some non-standard ones that should be there
     26       extraConfig = {
     27         XDG_GIT_DIR = "${tilde}/git";
     28         XDG_ETC_DIR = "${tilde}/etc";
     29         XDG_TMP_DIR = "${tilde}/tmp";
     30         XDG_MNT_DIR = "${tilde}/mnt";
     31 
     32         # important git repos
     33         XDG_DOT_DIR = "${tilde}/dot";
     34         XDG_SEC_DIR = "${tilde}/sec";
     35         XDG_SRV_DIR = "${tilde}/srv";
     36       };
     37 
     38       # map useless dirs to tmp
     39       desktop = "${tilde}/tmp";
     40       publicShare = "${tilde}/tmp";
     41       templates = "${tilde}/tmp";
     42     };
     43 
     44   environment.persistence."/fix".users.${user}.directories =
     45     builtins.map
     46       (directory: {
     47         inherit directory;
     48         mode = "0700";
     49       })
     50       [
     51         "doc"
     52         "dot"
     53         "etc"
     54         "git"
     55         "mus"
     56         "pic"
     57         "sec"
     58         "srv"
     59         "vid"
     60         "pro"
     61       ];
     62 }