nixos-config/configs/home-manager/foo-dogsquared/modules/dotfiles.nix
Gabriel Arazas e4e133dc9f
Some checks failed
Build devcontainers / build-devcontainers (push) Has been cancelled
Cache outputs / build-custom-packages (push) Has been cancelled
Check flake outputs / check-outputs (push) Has been cancelled
Publish every Git push to master to FlakeHub / flakehub-publish (push) Has been cancelled
Build personalized bootstrap ISO / build-iso (x86_64-linux) (push) Has been cancelled
Build project site / build (push) Has been cancelled
Build project site / deploy (push) Has been cancelled
Update Firefox addons / update-firefox-addons (push) Has been cancelled
users/foo-dogsquared/dotfiles: update packages for Neovim "distribution"
2025-01-24 18:44:14 +08:00

60 lines
1.7 KiB
Nix

{ config, lib, pkgs, ... }:
let
userCfg = config.users.foo-dogsquared;
cfg = userCfg.dotfiles;
projectsDir = config.xdg.userDirs.extraConfig.XDG_PROJECTS_DIR;
dotfiles = "${projectsDir}/packages/dotfiles";
dotfiles' = config.lib.file.mkOutOfStoreSymlink config.home.mutableFile."${dotfiles}".path;
getDotfiles = path: "${dotfiles'}/${path}";
in
{
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 "kitty";
wezterm.source = getDotfiles "wezterm";
};
})
(lib.mkIf (userCfg.programs.browsers.misc.enable) {
xdg.configFile.nyxt.source = getDotfiles "nyxt";
})
# Comes with a heavy assumption that the Neovim configuration found in this
# home-manager environment will not write to the XDG config directory.
(lib.mkIf (!config.programs.nixvim.enable) {
xdg.configFile.nvim.source = getDotfiles "nvim";
programs.neovim.extraPackages = with pkgs; [
luarocks
shfmt
];
})
(lib.mkIf userCfg.programs.nushell.enable {
home.file."${config.xdg.dataHome}/nushell/vendor/autoload".source = getDotfiles "nu/autoload";
})
]);
}