The .install
dir contains all the installation scripts that can setup environment variables, daily used apps and symlinks. The scripts are wrote in pwsh
since it is the modern shell language in windows, and is more verbose but clear for me.
init
: setup buckets and installgit
,chezmoi
,pwsh
,nu
,age
andfirefox-dev
env
: setupXDG
dir and the config path forbat
eza
,yazi
symlinks
: setup symbolic links- for apps that won't utilize
XDG
dir, and depends on the original config dir to work.
- for apps that won't utilize
languages
: install programming languagescoop
: install apps withscoop
npm
: installnpm
packages globallywinget
: install apps withwinget
[!note] XDG directory It will affect app storing location of config, data and cache, like neovim, lazygit... Unfortunately, vs code don't utilize these env variables by default now (2024-11-27). Hence, I've manually add those environment variables in the
settings.json
.It is still not clear that whether:
- it is a vs code issue
- it's because I install vs code with
scoop
.
In addition, batch
scripts streamline all the installation scripts. However, it requires setting up private ssh
key, which is currently stored in USB flash drive, since I couldn't think of a valid way to save the private key.
[!warning] UAC prompt There will be UAC prompt asking for admin privilege during some installation, mostly from
winget install
andscoop install neorocks-scoop/luarocks
. Since UAC prompt has to be interact with the GUI manually, which makes the scripts not so automatical.
- use cache feature in
gsudo
to reduce multiple UAC prompt into one.
Since I stored some api keys for AI chat bot in my dotfiles, I encrypted it with chezmoi
using age
encryption. However, chezmoi
needs to setup a age
private key first to encrypt and decrypt the secret files.
reference: Encryption - chezmoi The strategy:
- generate an age private key, which will be used to encrypt and decrypt secrets
a.
chezmoi cd ~
b.age-keygen | age --armor --passphrase > key.txt.age
- encrypt the private key with a passphrase, so that it can be push to remote repo a. I can memorize passphrase and decrypt the private key with it b. there is no need for me to store private key in the physical drive
- setup
chezmoi
script template to decrypt the private key if needed a. check if the key exist b.mkdir
for the key's parent dir c.chezmoi age decrypt --output {private-key} --passphrase {encrypted-private-key}
d. set private key permissionchmod 600 {private-key}
- configure
chezmoi.toml
to use the private key, andage
encryption a.[age.identity]
: private key path b.[age.recipient]
: public key of the private key c.encryption = "age"
- add my secret files with encryption
a.
chezmoi add --encrypt {file}