Why I threw out my dotfiles
Over the years I have collected a number of dotfiles that I have shared across both Linux and macOS machines (~/.zshrc
, ~/.config/git/config
, ~/.config/tmux/tmux.conf
, etc). I have tried several different ways to manage them, including bare git repos and utilities such as GNU Stow. These solutions work well enough, but I have since found what I would consider a much better solution for organizing user configuration: home-manager.
What is home-manager?
Before understanding home-manager, it is worth briefly discussing what nix is. nix is a package manager that originally spawned from a PhD thesis. Unlike other package managers, it uses symbolic links to keep track of the currently installed packages, keeping around the old ones in case you may want to rollback.
For example, I have used nix to install the package bind which includes dig
. You can see that it is available on multiple platforms. The absolute path of dig
can be found by running:
$ ls -lh $(which dig)
+Why I threw out my dotfiles
Over the years I have collected a number of dotfiles that I have shared across both Linux and macOS machines (~/.zshrc
, ~/.config/git/config
, ~/.config/tmux/tmux.conf
, etc). I have tried several different ways to manage them, including bare git repos and utilities such as GNU Stow. These solutions work well enough, but I have since found what I would consider a much better solution for organizing user configuration: home-manager.
What is home-manager?
Before understanding home-manager, it is worth briefly discussing what nix is. nix is a package manager that originally spawned from a PhD thesis. Unlike other package managers, it uses symbolic links to keep track of the currently installed packages, keeping around the old ones in case you may want to rollback.
For example, I have used nix to install the package bind which includes dig
. You can see that it is available on multiple platforms. The absolute path of dig
can be found by running:
$ ls -lh $(which dig)
lrwxr-xr-x 73 root 31 Dec 1969 /run/current-system/sw/bin/dig -> /nix/store/0r4qdyprljd3dki57jn6c6a8dh2rbg9g-bind-9.16.16-dnsutils/bin/dig
Notice that there is a hash included in the file path? This is a nix store path and is computed by the nix package manager. This nix pill does a good job explaining how this hash is computed. All of the nix pills are worth a read, if you are interested in learning more about nix itself. However, using home-manager does not require extensive knowledge of nix.
Part of the nix ecosystem includes nixpkgs. Many popular tools can be found already packaged in this repository. As you can see with these stats, there is a large number of existing packages that are being maintained by the community. Contributing a new package is easy, and anyone can do it!
home-manager leverages the nix package manager (and nixpkgs), as well the nix language so that you can declaratively define your system configuration. I store my nix-config in git so that I can keep track of my packages and configurations, and retain a clean and informative git commit history so that I can understand what changed and why.
Setting up home-manager
⚠️ If you run this on your main machine, make sure you backup your configuration files first. home-manager is pretty good about not overwriting existing configuration, but it is better to have a backup! Alternatively, you could test this out on a VM or cloud instance.
The first thing you should do is install nix:
curl -L https://nixos.org/nix/install | sh
It’s generally not a good idea to curl and execute files from the internet (without verifying integrity), so you might want to download the install script first and take a look before executing it!
Open up a new shell in your terminal and running nix
should work. If not, run . ~/.nix-profile/etc/profile.d/nix.sh
Now, install home-manager:
nix-channel --add https://github.com/nix-community/home-manager/archive/master.tar.gz home-manager
diff --git a/en/sitemap.xml b/en/sitemap.xml
index a7fe7b6f..06b240f2 100644
--- a/en/sitemap.xml
+++ b/en/sitemap.xml
@@ -1 +1 @@
-/tags/gitea/ 2024-01-06T11:33:47-05:00 /tags/gitea-actions/ 2024-01-06T11:33:47-05:00 /tags/github-actions/ 2024-01-06T11:33:47-05:00 /post/ 2024-01-06T11:33:47-05:00 /tags/self-hosted/ 2024-01-06T11:33:47-05:00 /blog/2023/12/10/setting-up-gitea-actions-with-tailscale/ 2024-01-06T11:33:47-05:00 /tags/ 2024-01-06T11:33:47-05:00 /tags/tailscale/ 2024-01-06T11:33:47-05:00 /tags/aks/ 2024-01-06T11:33:47-05:00 /tags/aws/ 2024-01-06T11:33:47-05:00 /tags/azure/ 2024-01-06T11:33:47-05:00 /tags/bastion/ 2024-01-06T11:33:47-05:00 /tags/cloud-sql-proxy/ 2024-01-06T11:33:47-05:00 /tags/database/ 2024-01-06T11:33:47-05:00 /tags/eks/ 2024-01-06T11:33:47-05:00 /tags/k8s/ 2024-01-06T11:33:47-05:00 /tags/kubectl-plugin-socks5-proxy/ 2024-01-06T11:33:47-05:00 /tags/proxy/ 2024-01-06T11:33:47-05:00 /tags/socat/ 2024-01-06T11:33:47-05:00 /tags/socks/ 2024-01-06T11:33:47-05:00 /blog/2023/05/22/using-aks-and-socks-to-connect-to-a-private-azure-db/ 2024-01-06T11:33:47-05:00 /tags/invidious/ 2024-01-06T11:33:47-05:00 /tags/privacy/ 2024-01-06T11:33:47-05:00 /blog/2022/12/10/watching-youtube-in-private/ 2024-01-06T11:33:47-05:00 /tags/yewtu.be/ 2024-01-06T11:33:47-05:00 /tags/youtube/ 2024-01-06T11:33:47-05:00 /tags/openwrt/ 2024-01-06T11:33:47-05:00 /tags/pfsense/ 2024-01-06T11:33:47-05:00 /tags/proxmox/ 2024-01-06T11:33:47-05:00 /tags/router/ 2024-01-06T11:33:47-05:00 /tags/router-on-a-stick/ 2024-01-06T11:33:47-05:00 /blog/2022/04/02/virtualizing-my-router-with-pfsense/ 2024-01-06T11:33:47-05:00 /tags/vlan/ 2024-01-06T11:33:47-05:00 /blog/2022/03/13/backing-up-gmail-with-synology/ 2024-01-06T11:33:47-05:00 /tags/backup/ 2024-01-06T11:33:47-05:00 /tags/gmail/ 2024-01-06T11:33:47-05:00 /tags/ransomware/ 2024-01-06T11:33:47-05:00 /tags/synology/ 2024-01-06T11:33:47-05:00 /tags/k3s/ 2024-01-06T11:33:47-05:00 /tags/lxc/ 2024-01-06T11:33:47-05:00 /blog/2021/11/14/running-k3s-in-lxc-on-proxmox/ 2024-01-06T11:33:47-05:00 /tags/containers/ 2024-01-06T11:33:47-05:00 /tags/docker/ 2024-01-06T11:33:47-05:00 /tags/podman/ 2024-01-06T11:33:47-05:00 /blog/2021/10/11/replacing-docker-with-podman-on-macos-and-linux/ 2024-01-06T11:33:47-05:00 /blog/2021/09/17/automatically-rotating-aws-access-keys/ 2024-01-06T11:33:47-05:00 /tags/aws-vault/ 2024-01-06T11:33:47-05:00 /tags/python/ 2024-01-06T11:33:47-05:00 /tags/security/ 2024-01-06T11:33:47-05:00 /tags/dotfiles/ 2024-01-01T23:33:36-05:00 /tags/home-manager/ 2024-01-01T23:33:36-05:00 /tags/nix/ 2024-01-01T23:33:36-05:00 /blog/2021/09/08/why-i-threw-out-my-dotfiles/ 2024-01-01T23:33:36-05:00 /blog/2021/09/06/what-to-do-with-a-homelab/ 2024-01-02T12:09:57-05:00 /blog/2020/03/16/appgate-sdp-on-arch-linux/ 2024-01-01T23:33:36-05:00 /tags/linux/ 2024-01-01T23:33:36-05:00 /tags/vpn/ 2024-01-01T23:33:36-05:00 /about/ 2024-01-06T11:23:59-05:00 /categories/ / 2024-01-02T18:45:54-05:00
\ No newline at end of file
+/tags/gitea/ 2024-01-06T11:33:47-05:00 /tags/gitea-actions/ 2024-01-06T11:33:47-05:00 /tags/github-actions/ 2024-01-06T11:33:47-05:00 /post/ 2024-01-06T11:33:47-05:00 /tags/self-hosted/ 2024-01-06T11:33:47-05:00 /blog/2023/12/10/setting-up-gitea-actions-with-tailscale/ 2024-01-06T11:33:47-05:00 /tags/ 2024-01-06T11:33:47-05:00 /tags/tailscale/ 2024-01-06T11:33:47-05:00 /tags/aks/ 2024-01-06T11:33:47-05:00 /tags/aws/ 2024-01-06T11:33:47-05:00 /tags/azure/ 2024-01-06T11:33:47-05:00 /tags/bastion/ 2024-01-06T11:33:47-05:00 /tags/cloud-sql-proxy/ 2024-01-06T11:33:47-05:00 /tags/database/ 2024-01-06T11:33:47-05:00 /tags/eks/ 2024-01-06T11:33:47-05:00 /tags/k8s/ 2024-01-06T11:33:47-05:00 /tags/kubectl-plugin-socks5-proxy/ 2024-01-06T11:33:47-05:00 /tags/proxy/ 2024-01-06T11:33:47-05:00 /tags/socat/ 2024-01-06T11:33:47-05:00 /tags/socks/ 2024-01-06T11:33:47-05:00 /blog/2023/05/22/using-aks-and-socks-to-connect-to-a-private-azure-db/ 2024-01-06T11:33:47-05:00 /tags/invidious/ 2024-01-06T11:33:47-05:00 /tags/privacy/ 2024-01-06T11:33:47-05:00 /blog/2022/12/10/watching-youtube-in-private/ 2024-01-06T11:33:47-05:00 /tags/yewtu.be/ 2024-01-06T11:33:47-05:00 /tags/youtube/ 2024-01-06T11:33:47-05:00 /tags/openwrt/ 2024-01-06T11:33:47-05:00 /tags/pfsense/ 2024-01-06T11:33:47-05:00 /tags/proxmox/ 2024-01-06T11:33:47-05:00 /tags/router/ 2024-01-06T11:33:47-05:00 /tags/router-on-a-stick/ 2024-01-06T11:33:47-05:00 /blog/2022/04/02/virtualizing-my-router-with-pfsense/ 2024-01-06T11:33:47-05:00 /tags/vlan/ 2024-01-06T11:33:47-05:00 /blog/2022/03/13/backing-up-gmail-with-synology/ 2024-01-06T11:33:47-05:00 /tags/backup/ 2024-01-06T11:33:47-05:00 /tags/gmail/ 2024-01-06T11:33:47-05:00 /tags/ransomware/ 2024-01-06T11:33:47-05:00 /tags/synology/ 2024-01-06T11:33:47-05:00 /tags/k3s/ 2024-01-06T11:33:47-05:00 /tags/lxc/ 2024-01-06T11:33:47-05:00 /blog/2021/11/14/running-k3s-in-lxc-on-proxmox/ 2024-01-06T11:33:47-05:00 /tags/containers/ 2024-01-06T11:33:47-05:00 /tags/docker/ 2024-01-06T11:33:47-05:00 /tags/podman/ 2024-01-06T11:33:47-05:00 /blog/2021/10/11/replacing-docker-with-podman-on-macos-and-linux/ 2024-01-06T11:33:47-05:00 /blog/2021/09/17/automatically-rotating-aws-access-keys/ 2024-01-06T11:33:47-05:00 /tags/aws-vault/ 2024-01-06T11:33:47-05:00 /tags/python/ 2024-01-06T11:33:47-05:00 /tags/security/ 2024-01-06T11:33:47-05:00 /tags/dotfiles/ 2024-01-06T11:33:47-05:00 /tags/home-manager/ 2024-01-06T11:33:47-05:00 /tags/nix/ 2024-01-06T11:33:47-05:00 /blog/2021/09/08/why-i-threw-out-my-dotfiles/ 2024-01-06T11:33:47-05:00 /blog/2021/09/06/what-to-do-with-a-homelab/ 2024-01-02T12:09:57-05:00 /blog/2020/03/16/appgate-sdp-on-arch-linux/ 2024-01-01T23:33:36-05:00 /tags/linux/ 2024-01-01T23:33:36-05:00 /tags/vpn/ 2024-01-01T23:33:36-05:00 /about/ 2024-01-06T11:23:59-05:00 /categories/ / 2024-01-02T18:45:54-05:00
\ No newline at end of file
diff --git a/index.html b/index.html
index 95f1af6c..af059b3c 100644
--- a/index.html
+++ b/index.html
@@ -14,4 +14,4 @@
/*! purgecss end ignore */.theme__toggle{align-items:center;background:none;border:none;color:var(--yellow1);cursor:pointer;display:flex;grid-area:theme-toggle;margin:0 1rem}.theme__toggle:hover{color:var(--yellow2)}.theme__toggle svg{height:28px;width:28px}nav#menu{align-items:center;display:flex;grid-area:nav;justify-content:flex-end}nav#menu .menu__item{color:var(--fg)}nav#menu .menu__item:hover{color:var(--fg3);cursor:pointer}nav#menu ul{list-style:none;margin:0;padding:0}nav#menu ul.menu--horizontal{align-items:center;display:none}nav#menu ul.menu--horizontal li{display:inline-block;margin:0 .75rem}@media (min-width:768px){nav#menu ul.menu--horizontal{display:flex}}nav#menu ul.menu--vertical{background:var(--fg0);bottom:0;margin:0;padding:3rem;position:fixed;right:0;top:0;transform:translate(100%);transition:transform .5s cubic-bezier(.9,0,.1,1);width:50%;z-index:10}nav#menu ul.menu--vertical .menu__item{color:var(--bg1)}nav#menu ul.menu--vertical .menu__item:hover{color:var(--bg4)}nav#menu .menu__burger{display:flex;height:24px;width:24px}nav#menu .menu__burger>*{position:absolute}nav#menu .menu__burger svg{height:inherit;width:inherit;z-index:20}nav#menu .menu__burger svg line{transition-duration:.5s;transition-property:stroke,opacity,transform;transition-timing-function:cubic-bezier(.9,0,.1,1)}nav#menu .menu__burger svg line:first-of-type{transform-origin:center 6px}nav#menu .menu__burger svg line:nth-of-type(2){transform-origin:center 12px}nav#menu .menu__burger svg line:nth-of-type(3){transform-origin:center 18px}nav#menu .menu__burger input{height:inherit;opacity:0;width:inherit;z-index:30}nav#menu .menu__burger input:checked~ul.menu--vertical{transform:none}nav#menu .menu__burger input:checked~svg{stroke:var(--bg1)}nav#menu .menu__burger input:checked~svg line:first-of-type{transform:translateY(6px) rotate(45deg)}nav#menu .menu__burger input:checked~svg line:nth-of-type(2){opacity:0;transform:scale(.2)}nav#menu .menu__burger input:checked~svg line:nth-of-type(3){transform:translateY(-6px) rotate(-45deg)}@media (min-width:768px){nav#menu .menu__burger{display:none}}.sidebar{font-family:Fira Code,Lucida Console,Monaco,monospace;font-family:var(--font-monospace);margin-left:auto;margin-right:auto;max-width:350px;padding-left:2.5rem}.sidebar hr{margin:1.5rem auto}.sidebar svg{fill:var(--fg)}.sidebar__heading{font-size:1.3rem}aside.toc a{color:var(--blue2);color:var(--primary-alt)}aside.toc a:hover{color:var(--blue1);color:var(--primary)}aside.toc ul{list-style:none;margin:0;padding:0}aside.toc ul ul{font-size:.9rem;margin-left:.5rem}aside.toc ul li{line-height:1.1}aside.toc ul li a{display:block;padding:.2rem 0}.jr-basics__image{background:var(--bg1);border:2px solid var(--bg2)}.jr-basics__summary{color:var(--fg3);font-family:Roboto Slab,Georgia,serif;font-family:var(--font-serif);margin:.75rem 0}.jr-basics__profile a:hover{color:var(--fg3)}.jr-basics__profile a:hover svg{fill:var(--fg3)}.tag-cloud{line-height:1.1;text-align:justify}.tag-cloud__tag:hover{color:var(--fg3)}.tag-cloud__tag--active{-webkit-text-decoration:underline;text-decoration:underline}.content-section,.post{border-bottom:2px dotted var(--bg1);padding:2rem 0}.post figure,.post img:not(figure img),.post video:not(figure video){box-sizing:border-box;margin:.5rem 0}.post-content__read-more,.post-header{font-family:Fira Code,Lucida Console,Monaco,monospace;font-family:var(--font-monospace)}.post-meta__author{font-weight:700}.post-content{margin:1.3rem 0}.post-content__read-more{margin-top:1.3rem}.post-content a,.post-content__read-more,.post-header a{color:var(--blue2);color:var(--primary-alt)}.post-content a:hover,.post-header a:hover{color:var(--blue1);color:var(--primary)}.post-tags{align-items:center;display:flex;flex-wrap:wrap;gap:.9rem;margin:1rem 0}.post-tag{font-size:.9rem;line-height:1}.post-tag:before{content:"#"}.post-heading__anchor{display:none}h1:hover .post-heading__anchor,h2:hover .post-heading__anchor,h3:hover .post-heading__anchor,h4:hover .post-heading__anchor,h5:hover .post-heading__anchor,h6:hover .post-heading__anchor{display:inline-block}.jr__item-meta{flex-direction:column}.jr-basics__image,.jr-basics__item,.jr-basics__profile-icon,.jr-basics__profile-item,.jr__item-meta{align-items:center;display:flex}.jr-awards__title,.jr-basics__name,.jr-certificates__name,.jr-education__area,.jr-projects__roles,.jr-publications__name,.jr-volunteer__position,.jr-work__position{font-size:1.125rem;font-weight:700}.jr-basics__item{flex-direction:column;text-align:center}.jr-basics__item hr{margin:1.5rem auto}.jr-basics__image{border-radius:50%;height:250px;justify-content:center;overflow:hidden;width:250px}.jr-basics__label,.jr-basics__name,.jr-basics__summary{margin-top:.75rem}.jr-basics__profile svg{height:24px;width:24px}.jr-basics__profile,.jr-basics__profile-item{display:flex}.jr-basics__profile-item{display:flex;padding:.2rem}.jr-basics__profile--col{flex-direction:column}.jr-basics__profile--row{flex-wrap:wrap;justify-content:space-evenly}.jr-basics__profile-icon{padding:0 .75rem}.jr__item-meta{align-items:start;flex-flow:column;font-family:Fira Code,Lucida Console,Monaco,monospace;font-family:var(--font-monospace)}@media (min-width:768px){.jr__item-meta{align-items:center;flex-flow:row wrap}.jr-work__location,.jr__date,.jr__date-range{flex-grow:1;text-align:right}.jr-awards__awarder,.jr-education__institution,.jr-publications__publisher,.jr-volunteer__organization{flex-basis:100%}}.social-share{align-items:center;border-top:2px dotted var(--bg1);display:flex;flex-wrap:wrap;gap:.9rem;margin:3rem 0;padding-top:3rem}.social-share svg{fill:var(--fg);height:24px;width:24px}.social-share svg.icon-tabler{fill:none;stroke:var(--fg)}.social-share__item{background:var(--bg1);display:flex;padding:.5rem}davegallant.ca>█
Welcome
This is a space where I share notes about problems and solutions I’ve been exploring. Please do not hesitate to reach out by email, social media, or by commenting on the posts below. Continuous improvement is what motivates me to keep learning.
In this post I’ll go through the process of setting up Gitea Actions and Tailscale, unlocking a simple and secure way to automate workflows.
I ran into a roadblock recently where I wanted to be able to conveniently connect to a managed postgres database within Azure that was not running on public subnets. And by conveniently, I mean that I’d rather not have to spin up an ephemeral virtual machine running in the same network and proxy the connection, and I’d like to use a local client (preferably with a GUI). After several web searches, it became evident that Azure does not readily provide much tooling to support this.
I recently stumbled upon yewtu.be and found it intriguing. It not only allows you to watch YouTube without being on YouTube, but it also allows you to create an account and subscribe to channels without a Google account. What sort of wizardry is going on under the hood? It turns out that it’s a hosted instance of invidious.
My aging router has been running OpenWrt for years and for the most part has been quite reliable. OpenWrt is an open-source project used on embedded devices to route network traffic. It supports many different configurations and there exists a large index of packages. Ever since I’ve connected some standalone wireless access points, I’ve had less of a need for an off-the-shelf all-in-one wireless router combo. I’ve also recently been experiencing instability with my router (likely the result of a combination of configuration tweaking and firmware updating). OpenWrt has served me well, but it is time to move on!
I’ve used gmail since the beta launched touting a whopping 1GB of storage. I thought this was a massive leap in email technology at the time. I was lucky enough to get an invite fairly quickly. Not suprisingly, I have many years of emails, attachments, and photos. I certainly do not want to lose the content of many of these emails. Despite the redundancy of the data that Google secures, I still feel better retaining a copy of this data on my own physical machines.
It has been a while since I’ve actively used Kubernetes and wanted to explore the evolution of tools such as Helm and Tekton. I decided to deploy K3s, since I’ve had success with deploying it on resource-contrained Raspberry Pis in the past. I thought that this time it’d be convenient to have K3s running in a LXC container on Proxmox. This would allow for easy snapshotting of the entire Kubernetes deployment. There are a number of reasons why you might want to replace docker, especially on macOS. The following feature bundled in Docker Desktop might have motivated you enough to consider replacing docker:
Rotating credentials is a security best practice. This morning, I read a question about automatically rotating AWS Access Keys without having to go through the hassle of navigating the AWS console. There are some existing solutions already, but I decided to write a script since it was incredibly simple. The script could be packed up as a systemd/launchd service to continually rotate access keys in the background.
-In the longer term, migrating my local workflows to aws-vault seems like a more secure solution. Over the years I have collected a number of dotfiles that I have shared across both Linux and macOS machines (~/.zshrc
, ~/.config/git/config
, ~/.config/tmux/tmux.conf
, etc). I have tried several different ways to manage them, including bare git repos and utilities such as GNU Stow. These solutions work well enough, but I have since found what I would consider a much better solution for organizing user configuration: home-manager.
A homelab can be an inexpensive way to host a multitude of internal/external services and learn a lot in the process.
\ No newline at end of file
+In the longer term, migrating my local workflows to aws-vault seems like a more secure solution.
Over the years I have collected a number of dotfiles that I have shared across both Linux and macOS machines (~/.zshrc
, ~/.config/git/config
, ~/.config/tmux/tmux.conf
, etc). I have tried several different ways to manage them, including bare git repos and utilities such as GNU Stow. These solutions work well enough, but I have since found what I would consider a much better solution for organizing user configuration: home-manager.
A homelab can be an inexpensive way to host a multitude of internal/external services and learn a lot in the process.