From 31ff307bfd439b3df88385c5a52592f9b3a1be94 Mon Sep 17 00:00:00 2001 From: Martin Lasson Date: Wed, 29 Jan 2025 18:45:00 +0100 Subject: [PATCH] Fix symlinks which arent tied to store for dotfiles. This means we can change them without rebuilding. Additionally, this means that lazy lock works. --- nix/pkgs/home.nix | 69 ++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 57 insertions(+), 12 deletions(-) diff --git a/nix/pkgs/home.nix b/nix/pkgs/home.nix index 3262a1a..9f4cf1c 100644 --- a/nix/pkgs/home.nix +++ b/nix/pkgs/home.nix @@ -1,8 +1,63 @@ { pkgs, + config, neovim-flake, ... }: +let + dotfiles = [ + [ + ".zshrc" + "zsh/.zshrc" + ] + [ + ".config/nvim" + "nvim" + ] + [ + ".config/yazi" + "yazi" + ] + [ + ".config/starship.toml" + "starship/starship.toml" + ] + [ + ".tmux.conf" + "tmux/.tmux.conf" + ] + [ + ".config/tmux" + "tmux" + ] + [ + ".config/bat" + "bat" + ] + [ + ".config/ghostty" + "ghostty" + ] + [ + ".config/confutils" + "confutils" + ] + [ + ".config/wallpapers" + "wallpapers" + ] + ]; + + symlinkFiles = builtins.listToAttrs ( + map (file: { + name = builtins.elemAt file 0; + value = { + source = config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/dev/git/.dotfiles/${builtins.elemAt file 1}"; + }; + + }) dotfiles + ); +in { programs = { zsh = { @@ -52,17 +107,7 @@ tldr nerd-fonts.caskaydia-mono ]; - file = { - ".zshrc".source = ../../zsh/.zshrc; - ".config/nvim".source = ../../nvim; - ".config/yazi".source = ../../yazi; - ".config/starship.toml".source = ../../starship/starship.toml; - ".tmux.conf".source = ../../tmux/.tmux.conf; - ".config/tmux".source = ../../tmux; - ".config/bat".source = ../../bat; - ".config/ghostty".source = ../../ghostty; - ".config/confutils".source = ../../confutils; - ".config/wallpapers".source = ../../wallpapers; - }; + + file = symlinkFiles; }; }