Mainly I structure my modules follow their paths starting from
$HOME
. To activate the module, symlink the corresponding folder to
$HOME
.
This task is done by GNU Stow.
stow <module>
Not every module here can be stowed though.
Some distros I’m using for my personal machine:
I use Guix as my package manager, together with
the official package manager (i.e. Fedora’s dnf
)
-
Stow
guix
first. -
To make packages update effective:
guix home reconfigure ~/.config/guix/home-configuration.scm
-
To describe generations:
guix home describe
-
Mainly used for installing the shell (Fish), text editor (Emacs) and packages which I cannot simply install with Nix.
cd macports
./install_ports.sh
-
Use the
nix-installer
from Determinate Systems to install Nix on Mac.
curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install
-
Install home-manager:
# with an unstable channel
nix-channel --add https://github.com/nix-community/home-manager/archive/master.tar.gz home-manager
# with a stable channel
nix-channel --add https://github.com/nix-community/home-manager/archive/release-24.05.tar.gz home-manager
nix-channel --update
nix-shell '<home-manager>' -A install
-
Shell are not managed with
home-manager
though, for stability reason. -
Add nixpkgs channels:
nix-channel --add https://channels.nixos.org/nixpkgs-24.05-darwin nixpkgs
nix-channel --add https://nixos.org/channels/nixpkgs-unstable nixpkgs-unstable
nix-channel --update
-
When you need to make change to the packages, edit
~/.config/home-manager/home.nix
and:
home-manager switch
-
stow
is used when changes are made often: e.g.fish
,vim
. -
Otherwise, some modules are managed and symlinked with
home-manager
. Check what modules are managed withhome-manager
inhome-manager/home.nix
:
home.file = {
...
}
-
List generations:
home-manager generations
-
Perform the rollback:
/nix/store/...-home-manager-generation/activate
-
My default shell is fish.
-
Pros:
-
I hate Bash arcane syntax. It’s fast to write a small script in Bash but horrible to grow into a larger script. Even Google Shell style guide recommends not to write a script more than 100 lines long.
-
Seamless interops with shell commands. It makes writing script interactively on a shell fun. One-liner manner is achievable. With a general purpose language, e.g. Python, I have to wrap shell command with
os.system
orsubprocess
.
-
-
Cons:
-
It does not follow POSIX shell standards. So if I want to run a common Bash or Zsh script, better use
bash script.sh
.
-
-
-
To change default shell for a user:
chsh -s $(which fish)
I decided to switch (and possibly contribute) to doom-emacs instead of writing my vanilla Emacs configurations.
Install:
git clone --depth 1 https://github.com/doomemacs/doomemacs ~/.emacs.d
~/.emacs.d/bin/doom install
Then stow emacs.
I want to contribute and learn best practice from community, at least until I’m confident enough to maintain my own configurations.
My Doom Emacs’ configuration lives in emacs/.doom.d
.
A lot of tools are installed with Python pip
. I use
pyenv to manage my Python environments.
-
To configure
pyenv
with Fish shell:
set -Ux PYENV_ROOT $HOME/.pyenv
fish_add_path $PYENV_ROOT/bin
pyenv init - | source
-
To install and use a Python version globally:
pyenv install 3.10
pyenv global <version>
I use rbenv to manage my Ruby environments.
-
To configure
rbenv
with Fish shell:
fish_add_path $HOME/.rbenv/shims
status --is-interactive; and rbenv init - fish | source
-
To install and use a Ruby version globally:
rbenv install 3.2.2
rbenv global <version>
Below is an awesome list of themes done in style. All are eye-care themes.
-
I follow recommendations from Betterfox
-
Note that editing
about:config
won’t take effect if you haveuser.js
inside your profiles.user.js
will reset all of your changes when start a new browser. -
Mac:
ln -s $PWD/firefox/user.js "$HOME/Library/Application Support/Firefox/Profiles/"
-
Linux:
ln -s $PWD/firefox/user.js (readlink -f (ls -d $HOME/.mozilla/firefox/*.default | head -n 1))/
-
Go to Options > Filter Lists > Annoyances and turn on all of them. Optionally, you can turn on Cloud Storage sync (refer).
-
Some additional personal filters list:
accounts.google.com/gsi/iframe