this post was submitted on 13 Jan 2026
44 points (97.8% liked)

Linux

61501 readers
547 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 6 years ago
MODERATORS
 

I've been reading up on the concept of dotfile management, and I've come across tools such as GNU Stow, chezmoi, and yadm, but before I select a tool, I'd like to understand the workflow a little better.

I understand if the dotfiles are in some cloud provider such as GitHub, then after a fresh install one can do git clone etc, but let's say one's dotfiles are not stored in the cloud, then what's the workflow for getting those dotfiles onto the freshly installed OS? Do people do git clone from another machine on their local network, manually copy the dotfiles folder from the source, use an app like LocalSend, or something else?

EDIT: Clarifying that this is for a home environment, where I have two or three different laptops in service at any given time. One is my main daily driver and doesn't change much. The other two are kinda my sandboxes and I'm often distro hopping on them. This question is mostly for distro hopping on my sandboxes, which is like once or twice a month. Thanks!

you are viewing a single comment's thread
view the rest of the comments
[–] ashleythorne@lemmy.world 3 points 2 weeks ago* (last edited 2 weeks ago)

Then you only need the “secret zero” of an ssh key to get everything set up and syncable

I made a script just for this purpose, I run the script on a fresh system and it pulls my stow directory without me needing to manually mess with ssh keys or passwords.

On a flashdrive, I have a folder named "setup". In that folder, I have this script called "run" and a directory called "ssh". In that "ssh" folder (not to be confused with ~/.ssh), I put my private ssh keys and their pubs.

#!/bin/bash

# stop script immediately on error
set -e

# change working directory to directory containing this script
cd "$(dirname "$0")"

# check that ./ssh exists and exit if not
if [ ! -d ./ssh ]; then
    echo "./ssh not detected, exiting..."
    exit 1
fi

# create .ssh directory
[ ! -d $HOME/.ssh ] && mkdir $HOME/.ssh
chmod 700 $HOME/.ssh

# copy keys to ~/.ssh
cp -a ./.ssh/. $HOME/.ssh/

# ensure right permissions for .ssh contents
# note: 2>/dev/null suppresses errors if no .pub files exist, || true to avoid exiting on failure
chmod 600 $HOME/.ssh/*
chmod 644 $HOME/.ssh/*.pub 2>/dev/null || true

# start ssh agent
eval `ssh-agent -s`
trap "ssh-agent -k" EXIT

# add keys
ssh-add "$HOME/.ssh/privatesshkey"

# add known hosts
# note: removing them first then adding again to avoid duplicate entries
ssh-keygen -R codeberg.org 2>/dev/null || true
ssh-keygen -R github.com 2>/dev/null || true
ssh-keyscan -H codeberg.org >> $HOME/.ssh/known_hosts
ssh-keyscan -H github.com >> $HOME/.ssh/known_hosts

# clone repo
cd $HOME
if [ -d "$HOME/stow" ]; then
    TIMESTAMP=$(date +"%Y%m%d_%H%M%S")
    mv "$HOME/stow" "$HOME/stow.old.$TIMESTAMP"
fi
git clone ssh://git@gitprovider.domain/myusername/stow.git