Skip to content

Commit

Permalink
feat(home/base/tui/editors): replace rsync by config.lib.file.mkOutOf…
Browse files Browse the repository at this point in the history
…StoreSymlink
  • Loading branch information
ryan4yin committed Nov 22, 2024
1 parent 961d24c commit 595f76e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 28 deletions.
21 changes: 0 additions & 21 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -317,36 +317,15 @@ k3s-prod:
k3s-test:
colmena apply --on '@k3s-test-*' --verbose --show-trace

############################################################################
#
# Neovim related commands
#
############################################################################

[group('neovim')]
nvim-test:
rm -rf $"($env.HOME)/.config/nvim"
rsync -avz --copy-links --chmod=D2755,F744 home/base/tui/editors/neovim/nvim/ $"($env.HOME)/.config/nvim/"

[group('neovim')]
nvim-clean:
rm -rf $"($env.HOME)/.config/nvim"

# =================================================
# Emacs related commands
# =================================================

[group('emacs')]
emacs-test:
rm -rf $"($env.HOME)/.config/doom"
rsync -avz --copy-links --chmod=D2755,F744 home/base/tui/editors/emacs/doom/ $"($env.HOME)/.config/doom/"
doom clean
doom sync

[group('emacs')]
emacs-clean:
rm -rf $"($env.HOME)/.config/doom/"

[group('emacs')]
emacs-purge:
doom purge
Expand Down
7 changes: 3 additions & 4 deletions home/base/tui/editors/emacs/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ with lib; let
myEmacsPackagesFor = emacs: ((pkgs.emacsPackagesFor emacs).emacsWithPackages (epkgs: [
epkgs.vterm
]));
# to make this symlink work, we need to git clone this repo to your home directory.
configPath = "${config.home.homeDirectory}/nix-config/home/base/tui/editors/emacs/doom";
in {
options.modules.editors.emacs = {
enable = mkEnableOption "Emacs Editor";
Expand Down Expand Up @@ -65,10 +67,7 @@ in {
home.shellAliases = shellAliases;
programs.nushell.shellAliases = shellAliases;

xdg.configFile."doom" = {
source = ./doom;
force = true;
};
xdg.configFile."doom".source = config.lib.file.mkOutOfStoreSymlink configPath;

home.activation.installDoomEmacs = lib.hm.dag.entryAfter ["writeBoundary"] ''
${pkgs.rsync}/bin/rsync -avz --chmod=D2755,F744 ${doomemacs}/ ${config.xdg.configHome}/emacs/
Expand Down
7 changes: 4 additions & 3 deletions home/base/tui/editors/neovim/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@ let
v = "nvim";
vdiff = "nvim -d";
};
# the path to nvim directory
# to make this symlink work, we need to git clone this repo to your home directory.
configPath = "${config.home.homeDirectory}/nix-config/home/base/tui/editors/neovim/nvim";
in {
home.activation.installAstroNvim = lib.hm.dag.entryAfter ["writeBoundary"] ''
${pkgs.rsync}/bin/rsync -avz --chmod=D2755,F744 ${./nvim}/ ${config.xdg.configHome}/nvim/
'';
xdg.configFile."nvim".source = config.lib.file.mkOutOfStoreSymlink configPath;

home.shellAliases = shellAliases;
programs.nushell.shellAliases = shellAliases;
Expand Down

0 comments on commit 595f76e

Please sign in to comment.