nixos-config/configs/home-manager/foo-dogsquared/modules/dotfiles.nix

49 lines
1.3 KiB
Nix
Raw Normal View History

{ config, lib, pkgs, ... }:
let
userCfg = config.users.foo-dogsquared;
cfg = userCfg.dotfiles;
projectsDir = config.xdg.userDirs.extraConfig.XDG_PROJECTS_DIR;
dotfiles = "${projectsDir}/dotfiles";
dotfiles' = config.lib.file.mkOutOfStoreSymlink config.home.mutableFile."${dotfiles}".path;
getDotfiles = path: "${dotfiles'}/${path}";
in
{
2023-12-15 05:27:12 +00:00
options.users.foo-dogsquared.dotfiles.enable =
lib.mkEnableOption "custom outside dotfiles for other programs";
config = lib.mkIf cfg.enable (lib.mkMerge [
{
home.mutableFile.${dotfiles} = {
url = "https://github.com/foo-dogsquared/dotfiles.git";
type = "git";
};
home.sessionPath = [
"${config.home.mutableFile.${dotfiles}.path}/bin"
];
}
(lib.mkIf (userCfg.programs.doom-emacs.enable) {
xdg.configFile.doom.source = getDotfiles "emacs";
})
(lib.mkIf (userCfg.setups.development.enable) {
xdg.configFile = {
kitty.source = getDotfiles "emacs";
wezterm.source = getDotfiles "wezterm";
};
})
(lib.mkIf (userCfg.programs.browsers.misc.enable) {
xdg.configFile.nyxt.source = getDotfiles "nyxt";
})
(lib.mkIf (!userCfg.programs.nixvim.enable) {
xdg.configFile.nvim.source = getDotfiles "nvim";
})
]);
}