/ modules / home / home.nix
home.nix
 1  {
 2    pkgs,
 3    lib,
 4    ...
 5  }:
 6  {
 7    imports = [
 8      ./packages.nix
 9    ];
10  
11    home = {
12      shell = {
13        enableZshIntegration = true;
14        enableBashIntegration = true;
15        enableShellIntegration = true;
16      };
17  
18      shellAliases = {
19        n = "nvim";
20        cat = "bat";
21        z = "zoxide";
22        man = "batman";
23        lg = "lazygit";
24        zlj = "zellij";
25        lsh = "lazyssh";
26        lj = "lazyjournal";
27        mkdir = "mkdir -p";
28        # mic = "tv microvisor";
29        # grep = "batgrep";
30        # TODO: add batpipe
31      }
32      // lib.optionalAttrs (pkgs.stdenv.isDarwin && pkgs.stdenv.isAarch64) {
33        zig = "~/.zvm/bin/zig";
34        stmcli = "/Applications/STMicroelectronics/STM32Cube/STM32CubeProgrammer/STM32CubeProgrammer.app/Contents/MacOs/bin/STM32_Programmer_CLI";
35      };
36  
37      file = {
38        "receipt.json" = {
39          enable = false;
40          source = ./receipt.json;
41        };
42      };
43  
44      sessionVariables = lib.mkIf (pkgs.stdenv.isLinux && pkgs.stdenv.isx86_64) {
45        XDG_BACKEND = "wayland";
46        XDG_RUNTIME_DIR = "/run/user/$(id -u)";
47  
48        # XDG_VTNR = "1";
49  
50        # TODO: move to xdg
51        # XDG_SESSION_CLASS = "user";
52        # XDG_CACHE_HOME = config.xdg.cacheHome;
53        # XDG_CONFIG_HOME = config.xdg.configHome;
54        # XDG_DATA_HOME = config.xdg.dataHome;
55        # XDG_STATE_HOME = config.xdg.stateHome;
56  
57        # XDG_DESKTOP_DIR = config.xdg.userDirs.desktop;
58        # XDG_DOCUMENTS_DIR = config.xdg.userDirs.documents;
59        # XDG_DOWNLOAD_DIR = config.xdg.userDirs.download;
60        # XDG_MUSIC_DIR = config.xdg.userDirs.music;
61        # XDG_PICTURES_DIR = config.xdg.userDirs.pictures;
62        # XDG_PUBLICSHARE_DIR = config.xdg.userDirs.publicShare;
63        # XDG_TEMPLATES_DIR = config.xdg.userDirs.templates;
64        # XDG_VIDEOS_DIR = config.xdg.userDirs.videos;
65  
66        # Additional XDG-related variables
67        # PARALLEL_HOME = "${config.xdg.configHome}/parallel";
68        # SCREENRC = "${config.xdg.configHome}/screen/screenrc";
69      };
70  
71      sessionPath =
72        lib.optionals pkgs.stdenv.isLinux [
73          # "/home/mfarabi/.zvm/bin"
74        ]
75        ++ lib.optionals pkgs.stdenv.isDarwin [
76          "/usr/local/bin"
77          "/etc/profiles/per-user/$USER/bin"
78          "/nix/var/nix/profiles/system/sw/bin"
79        ];
80    };
81  }