Skip to main content

Dotfiles management package

Project description

Welcome to machineconfig

Shortcuts

  • bit.ly/cfgroot is a shortcut to this repo.
  • glow https://bit.ly/cfgread OR curl bit.ly/cfgread -L | bat -l md --style="header" to get the readme file.

Machineconfig is a package for managing configuration files (aka dotfiles). The idea is to collect those critical, time-consuming-files-to-setup in one directory and reference them via symbolic links from their original locations. Thus, when a new machine is to be setup, all that is required is to clone the repo in that machine and create the symbolic links. Dotfiles include, but are not limited to:

  • ~/.gitconfig
  • ~/.ssh
  • ~/.aws
  • ~/.bash_profile
  • ~/.bashrc
  • ~/.config
  • $profile in Windows Powershell
  • etc

Additionally, files that contain data, sensitive information that should not be pushed to a repository are contained in a directory ~/dotfiles. The files therein are encrypted before backedup.

Windows Setup

With elevated PowerShell, run the following: (short curl bit.ly/cfgallwindows -L | iex)

You have to have winget first. If its not available in the your terminal, try those resources:

# apps  # short: `(iwr bit.ly/cfgappswindows).Content | iex`
Invoke-WebRequest https://raw.githubusercontent.com/thisismygitrepo/machineconfig/main/src/machineconfig/setup_windows/apps.ps1 | Invoke-Expression
# virtual enviornment  # short (iwr bit.ly/cfgvewindows).Content | iex OR `curl bit.ly/cfgvewindows -L | iex`
Invoke-WebRequest https://raw.githubusercontent.com/thisismygitrepo/machineconfig/main/src/machineconfig/setup_windows/ve.ps1 | Invoke-Expression
# symlinks # short `(iwr bit.ly/cfgsymlinkswindows).Content | iex` OR `curl bit.ly/cfgsymlinkswindows -L | iex`
. $HOME/code/machineconfig/src/machineconfig/setup_windows/symlinks.ps1
# devapps:
$HOME/code/machineconfig/src/machineconfig/setup_windows/devapps.ps1
# pwsh and wt settings: (iwr bit.ly/cfgwt).Content | iex
iwr https://raw.githubusercontent.com/thisismygitrepo/machineconfig/main/src/machineconfig/setup_windows/wt_and_pwsh.ps1 | iex
(iwr bit.ly/cfgappswindows).Content | iex
(iwr bit.ly/cfgvewindows).Content | iex
. $HOME/code/machineconfig/src/machineconfig/setup_windows/devapps.ps1
(iwr bit.ly/cfgwt).Content | iex
. $HOME/code/machineconfig/src/machineconfig/setup_windows/symlinks.ps1

& "$HOME\code\machineconfig\.venv\Scripts\activate.ps1"
python -m fire machineconfig.profile.create main2 --choice=all
deactivate
Setup SSH connection:
# CHANGE pubkey_string APPROPRIATELY
$pubkey_string=(Invoke-WebRequest 'https://github.com/thisismygitrepo.keys').Content
Invoke-WebRequest https://raw.githubusercontent.com/thisismygitrepo/machineconfig/main/src/machineconfig/setup_windows/openssh_all.ps1 | Invoke-Expression

short (iwr bit.ly/cfgsshwindows).Content | iex OR curl bit.ly/cfgsshwindows -L | iex

Install Croshell Terminal Directly,
Invoke-WebRequest https://raw.githubusercontent.com/thisismygitrepo/machineconfig/main/src/machineconfig/setup_windows/web_shortcuts/croshell.ps1 | Invoke-Expression

short: curl bit.ly/cfgcroshellwindows -L | iex OR (iwr bit.ly/cfgcroshellwindows).Content | iex

Linux Setup

With sudo access, run the following: (short curl bit.ly/cfgalllinux -L | bash)

export package_manager="nala"
export package_manager="nix"

# apps  # short: `curl bit.ly/cfgappslinux -L | bash`
curl https://raw.githubusercontent.com/thisismygitrepo/machineconfig/main/src/machineconfig/setup_linux/apps.sh | bash
# Optionally: curl https://raw.githubusercontent.com/thisismygitrepo/machineconfig/main/src/machineconfig/setup_linux/apps_dev.sh | bash

# virtual enviornment  # short `curl bit.ly/cfgvelinux -L | bash`
curl https://raw.githubusercontent.com/thisismygitrepo/machineconfig/main/src/machineconfig/setup_linux/ve.sh | bash

# repos  # short `curl bit.ly/cfgreposlinux -L | bash`
curl https://raw.githubusercontent.com/thisismygitrepo/machineconfig/main/src/machineconfig/setup_linux/repos.sh | bash
# symlinks and bash profile: # short `curl bit.ly/cfgsymlinkslinux -L | bash`
source ~/code/machineconfig/src/machineconfig/setup_linux/symlinks.sh  # requires sudo since it invloves chmod of dotfiles/.ssh, however sudo doesn't work with source. best to have sudo -s earlier.

# devapps
source <(sudo cat ~/code/machineconfig/src/machineconfig/setup_linux/devapps.sh)
Setup SSH connection:
pubkey_url='https://github.com/thisismygitrepo.keys'  # (CHANGE APPROPRIATELY)
export pubkey_string=$(curl --silent $pubkey_url)
curl https://raw.githubusercontent.com/thisismygitrepo/machineconfig/main/src/machineconfig/setup_linux/openssh_all.sh | sudo bash
# For WSL only, also run the following:
export port=2223
curl https://raw.githubusercontent.com/thisismygitrepo/machineconfig/main/src/machineconfig/setup_linux/openssh_wsl.sh | sudo bash
# don't forget to run `wsl_ssh_windows_port_forwarding -p 2223` from Windows using the designated port with

short curl bit.ly/cfgsshlinux -L | bash

Install Croshell Terminal Directly
curl https://raw.githubusercontent.com/thisismygitrepo/machineconfig/main/src/machineconfig/setup_linux/web_shortcuts/croshell.sh | sudo bash

short curl bit.ly/cfgcroshelllinux -L | bash

Repository management CLI

The DevOps CLI now exposes rich subcommands for working with git repositories. Run python -m machineconfig.scripts.python.devops repos --help to explore the hierarchy:

  • Top-level actions: push, pull, commit, all, and analyze.
    • These commands accept --recursive/-r and --no-sync to control nested repos and automatic uv sync.
  • Sync workflows live under sync:
    • record captures the current machine state into a repos.json.
    • capture clones repos from a specification without changing commits.
    • checkout aligns repositories to commits stored in the spec.
    • checkout-to-branch switches repositories to the tracked branch.
    • Each sync subcommand accepts --cloud/-c for fetching/saving specs from remote storage.

Example:

python -m machineconfig.scripts.python.devops repos sync record ~/code --cloud my_remote
python -m machineconfig.scripts.python.devops repos pull ~/code --recursive

Author

Alex Al-Saffar. email

Alex's github activity graph

Project details


Release history Release notifications | RSS feed

This version

5.18

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

machineconfig-5.18.tar.gz (421.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

machineconfig-5.18-py3-none-any.whl (570.9 kB view details)

Uploaded Python 3

File details

Details for the file machineconfig-5.18.tar.gz.

File metadata

  • Download URL: machineconfig-5.18.tar.gz
  • Upload date:
  • Size: 421.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.22

File hashes

Hashes for machineconfig-5.18.tar.gz
Algorithm Hash digest
SHA256 c667258b757dee7ebd8e8c0e66c5a573796fe80eae41f19d01d4e02e7b551d04
MD5 5b07ae078f7bb6d9e8ee0428fa5e5a7a
BLAKE2b-256 c9c6ecb96986df3c8a258ae382e40f645cf143349851c02b7245d6f4fad24a78

See more details on using hashes here.

File details

Details for the file machineconfig-5.18-py3-none-any.whl.

File metadata

File hashes

Hashes for machineconfig-5.18-py3-none-any.whl
Algorithm Hash digest
SHA256 ba1742a9f1b4cb0fc5f6f7cc00f5032ee07b4c4e9ccfe134c0f189bce8ef141b
MD5 304964e3687b48c41d7de2b447cdd164
BLAKE2b-256 a5e7ce96e5dc1ddd4da467fdfe630c08cc4b46b61350ac950ccb502658c2dd4d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page