char/flake

nixos flake

git clone https://git.t4t.associates/char/flake

Charlotte Somdotfiles.nix: set up abbr-dirbbd1227

main
866 B32 linesraw
1{ pkgs, user-pkgs, ... }:
2{
3  systemd.services.char-dotfiles = {
4    description = "Clone and stow charlotte's dotfiles";
5    wantedBy = [ "multi-user.target" ];
6    after = [ "network-online.target" ];
7    wants = [ "network-online.target" ];
8    serviceConfig = {
9      Type = "oneshot";
10      User = "charlotte";
11      RemainAfterExit = true;
12    };
13    path = with pkgs; [ git stow ];
14    script = ''
15      set -eu
16      cd ~
17
18      mkdir -p .config .local/libexec
19      ln -sf ${user-pkgs.abbr-dir}/bin/abbr-dir ~/.local/libexec/abbr-dir
20
21      if [ -d .dotfiles/.git ]; then
22        git -C .dotfiles pull --ff-only --recurse-submodules
23      else
24        git clone --recursive https://github.com/char/dotfiles.git .dotfiles
25      fi
26
27      for pkg in zsh jj git; do
28        [ -d ".dotfiles/$pkg" ] && stow -R -d .dotfiles -t ~ "$pkg"
29      done
30    '';
31  };
32}