diff options
author | Tim Keller <tjk@tjkeller.xyz> | 2025-08-30 12:31:28 -0500 |
---|---|---|
committer | Tim Keller <tjk@tjkeller.xyz> | 2025-08-30 12:31:28 -0500 |
commit | 9da942ba47d34210e86a1a709e802eda5c3b95db (patch) | |
tree | f7434c4b4c9b8e5271220c11f9b802815c3519c7 /home-manager/clone-repos.nix | |
parent | c3c3d6f1fd19a5da015c9a9d3ae5c54f2d177be0 (diff) | |
download | nixos-9da942ba47d34210e86a1a709e802eda5c3b95db.tar.xz nixos-9da942ba47d34210e86a1a709e802eda5c3b95db.zip |
refactor users activation. refactor home manager config to match nixos conf and move tjkeller archetypes to users/timmy. update many of the exising home manager configs to be nicer and better organized. profile archetypes now include homeconfigs which can be enabled per user, and are setup using a new mkProfileArchetype function.
Diffstat (limited to 'home-manager/clone-repos.nix')
-rw-r--r-- | home-manager/clone-repos.nix | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/home-manager/clone-repos.nix b/home-manager/clone-repos.nix new file mode 100644 index 0000000..8499760 --- /dev/null +++ b/home-manager/clone-repos.nix @@ -0,0 +1,47 @@ +{ config, lib, pkgs, ... }: let + cfg = config.home._repos; + # TODO MAKE OPTIONS + server = "https://git.tjkeller.xyz/"; + docs = config.xdg.userDirs.documents; + dotConfig = config.xdg.configHome; + bin = "$HOME/.local/bin"; + cloneMissing = repo: source: target: ''clonemissing "${repo}" "${source}" "${target}"''; +in { + options.home._repos = { + enable = lib.mkEnableOption "clone git repos"; + desktop = lib.mkEnableOption "clone repos that are for desktop use"; + }; + + config = lib.mkIf cfg.enable { + # TODO look into xdg.configFile.<name> + home.activation = { + cloneRepos = lib.hm.dag.entryAfter ["writeBoundary"] ('' + export PATH="${pkgs.git}/bin:$PATH" + ${builtins.readFile ./resources/activation-scripts/clone-repos.sh} + '' + lib.strings.concatStringsSep "\n" ([ + (cloneMissing "${server}dotconfig" "${docs}/config" dotConfig) + (cloneMissing "${server}nixos" "${docs}/nixos" "") + (cloneMissing "${server}nvim" "${dotConfig}/nvim" "") + (cloneMissing "${server}zsh" "${dotConfig}/zsh" "") + ] ++ lib.optionals cfg.desktop [ + (cloneMissing "${server}scripts" "${docs}/scripts" bin) + (cloneMissing "${server}userscripts" "${docs}/userscripts" "") + (cloneMissing "${server}awesome" "${dotConfig}/awesome" "") + ])); + linkZshProfile = lib.hm.dag.entryAfter ["writeBoundary"] '' + run ln -sf $VERBOSE_ARG ${dotConfig}/zsh/zprofile $HOME/.zprofile + ''; + + # TODO look into xdg.mimeApps.defaultApplications + #mimewiz = lib.mkIf cfg.desktop (lib.hm.dag.entryAfter ["writeBoundary"] '' + # export PATH="${pkgs.xdg-utils}/bin:$PATH" + # export PATH="${dotConfig}/misc:$PATH" + # run mimewiz -i # already verbose + #''); + }; + #home.file.Zprofile = { + # source = "${dotConfig}/zsh/zprofile"; + # target = ".zprofile"; + #}; + }; +} |