migrating-to-an-ssd.html 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266
  1. <!DOCTYPE html><head><meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" /><meta name="keywords" content="GNU, Emacs, Libre Software, Hurd, Guile, Guix" /><meta name="description" content="GNUcode.me is a website focusing on libre software projects, especially the GNU project." /><link type="application/atom+xml" rel="alternate" title="GNUcode.me -- Feed" href="/feed.xml" /><a rel="me" href="https://fosstodon.org/@thegnuguy"></a><link type="text/css" href="css/footer.min.css" rel="stylesheet"></link><link type="text/css" href="css/header.min.css" rel="stylesheet"></link><link type="text/css" href="css/main.min.css" rel="stylesheet"></link><title>Migrating to an SSD — GNUcode.me</title></head><body><header><nav><ul><li><a href="index.html">GNUcode.me</a></li><li><a href="services.html">Services</a></li><li><a href="about.html">About</a></li><li><a href="business-ideas.html">Business-ideas</a></li></ul></nav></header><h1>Migrating to an SSD</h1><main><section class="basic-section-padding"><article><h3>by Joshua Branson — June 29, 2021</h3><div><h1>Table of Contents</h1><ol><li><p><a href="#orgf6d0c49">Time to upgrade your computer</a></p><ol><li><p><a href="#org0396ea4">Introduction</a></p></li><li><p><a href="#org3c88524">Installing packages for the user profile: joshua</a></p></li><li><p><a href="#org227238d">Setting up Sway's config files</a></p></li><li><p><a href="#org1bb21a0">Refreshing my fonts</a></p></li><li><p><a href="#org135c8b8">Reconfiguring my system to use my services</a></p></li><li><p><a href="#org66d6e9e">Setting up jmacs</a></p></li><li><p><a href="#orgeb8ae8c">Setting up my hosts file</a></p></li><li><p><a href="#orgd6b36d5">re-installing firefox via flatpak</a></p></li><li><p><a href="#org6c5528f">Setting up application specific settings</a></p><ol><li><a href="#orgf4086d5">Setting up isync.</a></li><li><a href="#org9fa06cd">Setting up termite settings</a></li><li><a href="#orgb693454">re-setting up tootle</a></li><li><a href="#orgea6efa5">re-setting up linphone</a></li><li><a href="#orga2a283e">re-setting up my wifi connections</a></li><li><a href="#org94e1897">setting up my git username</a></li></ol></li><li><p><a href="#orga2d1f7d">copying <code>~./authinfo</code></a></p></li><li><p><a href="#org94b5f0b">Conclusion</a></p></li></ol></li></ol><p>&lt;a id=&quot;orgf6d0c49&quot;&gt;&lt;/a&gt;</p><h1>TODO Time to upgrade your computer</h1><p>tl;dr Re-installing my OS to my liking sure takes a while. It
  2. took me 9 hours (and counting). Can you beat that time? Let's
  3. be real. Of course you can! :)</p><p>The strategy described below is perhaps a bit silly. This
  4. strategy is how you would recreate your OS settings from your
  5. config files. It may be easier to occasionally re-create your
  6. entire disk image and save to a file or usb stick. The below
  7. example taken from the guix manual, shows you how to boot your
  8. GNU Guix system image from a virtual machine.</p><pre><code>image=$(guix system image --image-type=qcow2 \
  9. gnu/system/examples/lightweight-desktop.tmpl)
  10. cp $image /tmp/my-image.qcow2
  11. chmod +w /tmp/my-image.qcow2
  12. qemu-system-x86_64 -enable-kvm -hda /tmp/my-image.qcow2 -m 1000 \
  13. -bios $(guix build ovmf)/share/firmware/ovmf_x64.bin</code></pre><p>It is probably possible to modify the commands below to create a
  14. boot-able usb stick that has your exact OS with all your
  15. settings, users, and packages. With that usb stick, you should
  16. somehow be able to boot it and copy it onto your new computer.</p><p>&lt;a id=&quot;org0396ea4&quot;&gt;&lt;/a&gt;</p><h2>Introduction</h2><p>I read a blog post entitled <a href="https://ambrevar.xyz/reproducible-computing-environments/index.html">what if you lost your computer right
  17. now?</a> from a guix developer some time ago. It describes a fun
  18. thought experiment, namely how difficult would it be to copy your
  19. settings from your previous computer to your new one? How long
  20. would this process take you? Well today I updated my <a href="https://osboot.org/index.html">os-boot</a>-ed
  21. Thinkpad T400 laptop from an HDD to an SSD. Here are the
  22. settings that I had to manually copy over to the SSD.</p><p>I first tried to set up disc encryption via guix's installer.
  23. The install went ok, but booting it up did <em>not</em> work. Grub
  24. would not decrypt the drive. That's when I realized that the
  25. keyboard layout that I typed in the original password was dvorak,
  26. but osboot was using a qwerty layout. So then I re-installed GNU
  27. Guix and specified an encrypted password for /dev/sda3 to be only
  28. numbers. Grub still did not decrypt the partition…Please note
  29. that I am using os-boot, which means that I am using not using
  30. the grub that is installed via Guix. Instead osboot already
  31. includes a grub that is flashed to my rom image. So perhaps that
  32. image is a bit dated.</p><p>Anyway, then I installed Guix System without any encryption. Now
  33. I could boot into the system. Oh, and I installed Guix System
  34. using this mostly barebones config. In my experience, if you try
  35. to install Guix System with a desktop environment, at some point
  36. your internet will flake out, fail to download some dependency,
  37. and you will have to start over. So install bare bones first.
  38. :)</p><pre><code>;; This is an operating system configuration generated
  39. ;; by the graphical installer.
  40. (use-modules (gnu))
  41. (use-service-modules desktop networking ssh xorg)
  42. (operating-system
  43. (locale &quot;en_US.utf8&quot;)
  44. (timezone &quot;America/Indiana/Indianapolis&quot;)
  45. (keyboard-layout (keyboard-layout &quot;us&quot; &quot;dvorak&quot;))
  46. (host-name &quot;dobby&quot;)
  47. (users (cons* (user-account
  48. (name &quot;joshua&quot;)
  49. (comment &quot;Joshua Branson&quot;)
  50. (group &quot;users&quot;)
  51. (home-directory &quot;/home/joshua&quot;)
  52. (supplementary-groups
  53. '(&quot;wheel&quot; &quot;netdev&quot; &quot;audio&quot; &quot;video&quot;)))
  54. %base-user-accounts))
  55. (packages
  56. (append
  57. (list (specification-&gt;package &quot;nss-certs&quot;))
  58. %base-packages))
  59. (services
  60. (append
  61. (list (service network-manager-service-type)
  62. (service wpa-supplicant-service-type))
  63. %base-services))
  64. (bootloader
  65. (bootloader-configuration
  66. (bootloader grub-bootloader)
  67. (target &quot;/dev/sda&quot;)
  68. (keyboard-layout keyboard-layout)))
  69. (swap-devices
  70. (list (uuid &quot;d021373e-2399-49ea-bc92-6134f2b2c94f&quot;)))
  71. (file-systems
  72. (cons* (file-system
  73. (mount-point &quot;/&quot;)
  74. (device
  75. (uuid &quot;4bf80701-e54e-44eb-817f-b2f52f5af80e&quot;
  76. 'ext4))
  77. (type &quot;ext4&quot;))
  78. %base-file-systems)))</code></pre><p>&lt;a id=&quot;org3c88524&quot;&gt;&lt;/a&gt;</p><h2>Installing packages for the user profile: joshua</h2><p>Now that I could boot my configuration (into a tty console), I
  79. started to go about installing my previous packages for the user
  80. &quot;joshua&quot;, which is me! Obviously. :D</p><pre><code>joshua@dobby $ git clone https://notabug.org/jbranso/prog
  81. $ boring output blah blah blah
  82. $ done
  83. joshua@dobby $
  84. joshua@dobby $ cd prog;
  85. joshua@dobby $ mkdir -p gnu/guix;
  86. joshua@dobby $ cd gnu/guix;
  87. joshua@dobby $ git clone https://notabug.org/jbranso/guix-config
  88. $ boring output blah blah blah
  89. $ done
  90. joshua@dobby $
  91. joshua@dobby $ guix package -m manifest.scm
  92. joshua@dobby $ error: jmacs package not found</code></pre><p>#+RESULTS</p><pre><code>Error: package jmacs cannot be found</code></pre><p>Whoops…I forgot. jmacs is my custom emacs package. Don't get
  93. too excited. It pretty much only works for me, and if you try to
  94. use it, you will curse my name. Create specific files for
  95. reasons that only make sense to me. Trust me, you'd have to add
  96. in my custom channel, fail to install my jmacs, etc. You have
  97. been warned.</p><p>So this is a minor annoyance. As far as I know, GNU Guix does
  98. not let you specify your channel in <code>config.scm</code>. Instead you
  99. specify your custom channels in <code>~/.config/guix/channels.scm</code>.
  100. Perhaps this is a strategic choice. As in, please push your code
  101. upstream that way you do NOT need to have a private repo of code.</p><p>Anyway, for now, I will delete my jmacs package in the manifest
  102. file. Take 2:</p><pre><code>nano manifest.scm # delete my jmacs line
  103. guix package -m manifest.scm</code></pre><p>For some reason the above command <code>guix package -m manifest.scm</code>,
  104. failed the first time I tried it. I guess my manifest file is
  105. sort of big:</p><pre><code>ls manifest.scm</code></pre><p>Anyway, take 3:</p><pre><code>guix package -m manifest.scm</code></pre><p>This time it worked! Sweetness! I now have the previous file in
  106. my profile.</p><p>&lt;a id=&quot;org227238d&quot;&gt;&lt;/a&gt;</p><h2>Setting up Sway's config files</h2><p>Now I need to copy my sway configuration into <code>~/.config/sway</code>.</p><pre><code>mkdir ~/.config/sway
  107. cp ./config ~/.config/sway/
  108. cp ./status.sh ~/.config/sway/</code></pre><p>&lt;a id=&quot;org1bb21a0&quot;&gt;&lt;/a&gt;</p><h2>Refreshing my fonts</h2><p>Due to a long standing <a href="http://issues.guix.gnu.org/18640">bug</a> in GNU Guix, fontconfig's cache is
  109. not refreshed automatically. The below command makes my newly
  110. installed fonts available, which are needed for my sway status
  111. bar.</p><pre><code>fc-cache -fv</code></pre><p>&lt;a id=&quot;org135c8b8&quot;&gt;&lt;/a&gt;</p><h2>Reconfiguring my system to use my services</h2><p>Originally I installed GNU Guix from a bare-bones.scm file. Now,
  112. I can reconfigure my system to set up my services, including a
  113. locally running dovecot server, nginx, and mcron, etc. Here is
  114. my current <a href="https://notabug.org/jbranso/guix-config/src/master/sway.scm">sway.scm</a> config file.</p><pre><code>sudo guix system reconfigure sway.scm</code></pre><p>#+RESULTS</p><pre><code>Error: no code for module secret</code></pre><p>Whoops. That's right. I've got some bit of code in my config
  115. that I did not share with the world…That means that my current
  116. config will not work…A few deletions to my config later…</p><pre><code>sudo guix system reconfigure sway.scm</code></pre><p>#+RESULTS</p><pre><code>Error filesystem uuid &quot;0542cf20-9f62-49cf-992f-54a75186f2b2&quot; not found.</code></pre><p>Whoops. I can't use the uuid from the HHD. I need to get the
  117. UUID from the SSD.</p><p>In order to avoid having this minor
  118. annoyance in the future, I could label my partitions. When
  119. doing the manual install I could do something like:</p><pre><code>sudo fdisk /dev/sda;
  120. # create a new partition table either msdos or gpt
  121. # gpt is probably what you want for newer hardware
  122. g
  123. # add a new partition
  124. # it's just much easier to set it up to use two partitions
  125. # 1 for the EFI partition and 2 for the / (root) filesystem.
  126. n
  127. n
  128. # write to the disk save and exit
  129. w
  130. parted /dev/sda set 1 esp on
  131. mkfs.fat -F32 -L my-EFI /dev/sda1
  132. mkfs.ext4 -L my-root /dev/sda2
  133. mount LABEL=my-root /mnt
  134. mkdir -p /mnt/boot/efi
  135. mount LABEL=my-EFI /mnt/boot/efi</code></pre><p>Then I could use this bit to configure my partitions.</p><pre><code>(filesystems
  136. (list
  137. (file-system
  138. (mount-point &quot;/boot/efi&quot;)
  139. (type &quot;vfat&quot;)
  140. (device (file-system-label &quot;my-EFI&quot;)))
  141. (file-system
  142. (mount-point &quot;/&quot;)
  143. (type &quot;ext4&quot;)
  144. (device (file-system-label &quot;my-root&quot;)))))</code></pre><p>A quick copy from my local <code>/etc/config.scm</code> later:</p><pre><code>sudo guix system reconfigure sway.scm</code></pre><p>This surprisingly was really uneventful. Most of the services
  145. did not run immediately. For instance dovecot did not run,
  146. because I do not have the <code>~/.mbsyncrc</code> file, which means that I
  147. don't have any mail to serve. Surprisingly nginx did run! Even
  148. though some of the spots where I told it to serve html files do
  149. not exist yet on the filesystem. But I can actually view my
  150. locally running website (local.gnucode.me) via opening up icecat
  151. and viewing <a href="http://local.propernaming.org">http://local.propernaming.org</a>. Which is really
  152. weird. Because it should be showing my local propernaming.org
  153. site, but instead it is showing my gnucode.me site. Weird.
  154. Apparently I need to tweak my nginx service.</p><p>&lt;a id=&quot;org66d6e9e&quot;&gt;&lt;/a&gt;</p><h2>Setting up jmacs</h2><p>I first need to download my emacs config.</p><pre><code>git clone https://notabug.org/jbranso/emacs.d ~/.config/emacs
  155. rm -r ~/.emacs.d</code></pre><p>Now I can guix pull and install jmacs.</p><pre><code>guix pull
  156. guix package -i jmacs
  157. -sha256 hash mismatch for /gnu/store/8i2n33a06lfbpxr3jmxj6mhdvsp5fnvl-aggressive-fill-paragraph-20180910.816.el:
  158. expected hash: 12fi9r1wfzv8iqyzrnh82lq6793i9gxq52hk54acxskax29kmn30
  159. actual hash: 1q1xpz3rfsm7402d5k32lkr2vfvimwxf19p1xf3jslqdw8c0k06a</code></pre><p>Hmmm, emacs-aggressive-fill-paragraph is not building…I don't
  160. think that I actually use aggressive fill paragraph much…So I
  161. think that I will NOT use that.</p><p>While it is nice to set up <a href="https://notabug.org/jbranso/guix-packages/src/master/gnu/packages/jmacs.scm">jmacs</a> via my <a href="https://notabug.org/jbranso/guix-packages/src/master/gnu/packages/jmacs.scm">custom channel</a>. For
  162. development purposes, it's actually easier to set up
  163. <code>GUIX_PACKAGE_PATH</code>.</p><p>So I copied my .bash&lt;sub&gt;profile&lt;/sub&gt; from the old machine.</p><pre><code>cat ~/.bash_profile</code></pre><p>The important bit is where I set <code>GUIX_PACKAGE_PATH</code>
  164. environmental variable. It might actually be a better idea to
  165. set that variable in ~/.profile, because that then those
  166. settings would be saved for any shell.</p><p>Take 2!</p><pre><code>guix pull
  167. guix package -i jmacs</code></pre><p>#+RESULTS</p><pre><code>build of /gnu/store/9m73xmni7ixvmlyksj74fid73ij9sn0b-ledger-mode-20200530.1710.tar.drv failed
  168. View build log at '/var/log/guix/drvs/9m/73xmni7ixvmlyksj74fid73ij9sn0b-ledger-mode-20200530.1710.tar.drv.bz2'.</code></pre><p>Oh, I guess I haven't actually used ledger mode in emacs in a
  169. while…let's disable that as well. A few more local edits in
  170. <code>~/gnu/guix/guix-packages/gnu/packages/jmacs.scm</code> later…</p><p>Take 3!</p><pre><code>guix package -i jmacs</code></pre><p>I do find it a little interesting that it is compiling Emacs
  171. from source. I'm not entirely certain why this is necessary.
  172. My <code>jmacs.scm</code> is not entirely complicated. Here is an excerpt:</p><pre><code>grep -A 15 '(define-public jmacs' /home/joshua/prog/gnu/guix/guix-packages/gnu/packages/jmacs.scm</code></pre><p>I'm essentially just setting up Emacs to use guix as the package
  173. manager for emacs packages.</p><p>Surprisingly, jmacs worked for me after I got it to install. I
  174. did not expect that to work out so well. I did have one tiny
  175. issue with autosaves. I just needed to create this directory:</p><pre><code>mkdir ~/.config/emacs/emacs-auto-saves</code></pre><p>&lt;a id=&quot;orgeb8ae8c&quot;&gt;&lt;/a&gt;</p><h2>Setting up my hosts file</h2><p>I have a 10 or lines in my /etc/hosts file, so that I can run my
  176. static websites locally. That way I can make local changes,
  177. before I upload them to the actual server. I've got most of
  178. these settings in my <a href="https://notabug.org/jbranso/guix-config/src/master/sway.scm">guix-config.scm</a>, but some of them are
  179. &quot;secret&quot;.</p><p>&lt;a id=&quot;orgd6b36d5&quot;&gt;&lt;/a&gt;</p><h2>re-installing firefox via flatpak</h2><p>And re-settung up firefox sync only took about 5 minutes.</p><pre><code>flatpak install flathub org.mozilla.firefox</code></pre><p>&lt;a id=&quot;org6c5528f&quot;&gt;&lt;/a&gt;</p><h2>Setting up application specific settings</h2><p>This following would not be all that necessary if I set up <a href="https://git.sr.ht/~abcdw/rde">guix
  180. home</a> or the slightly more &quot;perfect&quot; <a href="https://framagit.org/tyreunom/guix-home-manager">guix home manager.</a> Those two
  181. tools let you set up a user profile that declares all of your
  182. system state. The command for it might look like:</p><pre><code>guix home reconfigure home.scm</code></pre><p>At the moment, I am not using these tools. It also appears that
  183. guix home will be merged into GNU Guix soon-ish. I would
  184. recommend you use guix home, if you want to try it.</p><p>&lt;a id=&quot;orgf4086d5&quot;&gt;&lt;/a&gt;</p><h3>Setting up isync.</h3><p>Isync is what the cool kids are doing to set up local <a href="https://en.wikipedia.org/wiki/Maildir">maildirs</a>,
  185. which is how you can search for your email REALLY fast. Like
  186. the speed of thought fast. :)</p><p>isync's configuration file is found in <code>~/.mbsyncrc</code>. Now this
  187. file currently has the password for my email account. So I
  188. cannot simply put this file in my <code>guix-config</code> git repository.
  189. Or perhaps I could I would just modify the password line to look
  190. like:</p><p><code>password SomeReallyAwesomePassword</code></p><p>And then I would put .mbsyncrc into my .gitignore file. Any
  191. changes that I make to that file would not go in the repo.</p><p>It would probably be better to create a user service <a href="https://git.sr.ht/~abcdw/rde">guix home</a>
  192. or just a regular <a href="https://guix.gnu.org/manual/en/html_node/Services.html">Guix System Service</a>.</p><p>But then I still have to figure out how to give isync my
  193. password for my email account. One possibility comes from the
  194. <a href="https://wiki.archlinux.org/title/Isync#Configuring">archlinux wiki</a> (seriously, if you are ever configuring software,
  195. read the archlinux wiki first. It is hands down the best wiki
  196. out there to help you configure software! Beware though. Some
  197. webpages will tell you how to set up proprietary software).</p><p><code># PassCmd &quot;gpg2 -q --for-your-eyes-only --no-tty -d ~/.mailpass.gpg&quot;</code></p><p>Another option is to set up <a href="https://wiki.archlinux.org/title/Gnome_Keyring">Gnome keyring</a>, and to use the <a href="https://wiki.gnome.org/Projects/Libsecret">secret
  198. tool.</a> The Archlinux wiki page about the gnome keyring would
  199. probably be helpful in setting this up. But again, I would have
  200. to continually re-store my secrets on every upgrade. I do not
  201. know if Gnome keyring has a way of securely storing my secrets
  202. in a git repository.</p><p>For now, I will just chose the lazy option. Just copying the
  203. config from the <a href="https://wiki.archlinux.org/title/Isync#Configuring">archlinux wiki page</a> and tweaking it for my needs.
  204. My <code>~/.mbsyncrc</code> now works for me.</p><pre><code>mkdir -p ~/.mail/dismail
  205. mbsync -a</code></pre><p>&lt;a id=&quot;org9fa06cd&quot;&gt;&lt;/a&gt;</p><h3>Setting up termite settings</h3><p>My default terminal is termite, and I need to recreate the
  206. terminal configuration file: <code>~/.config/termite/config</code>:</p><pre><code>mkdir -p ~/.config/termite;
  207. nano -p ~/.config/termite/config
  208. # some edits later
  209. cat ~/.config/termite/config</code></pre><p>Done!</p><p>&lt;a id=&quot;orgb693454&quot;&gt;&lt;/a&gt;</p><h3>re-setting up tootle</h3><p>Tootle is a gtk application to access your mastodon account.
  210. It's actually pretty awesome! It only took me 5 minutes to get
  211. this re-setup. The file in
  212. <code>~/.config/com.github.bleakgrey.tootle/accounts.json</code> includes a
  213. secret API token. Again, I cannot put that in my guix-config.
  214. Though I think that guix-home has a way to get around this…I hope.</p><p>&lt;a id=&quot;orgea6efa5&quot;&gt;&lt;/a&gt;</p><h3>re-setting up linphone</h3><p>This first bit is authentication. That takes 5 minutes.</p><p>The trick bit is merging my contacts. I use jmp.chat, which is
  215. an awesome cellular service. For texting, jmp.chat uses XMPP.
  216. Which is awesome, because my contacts are saved on the server.</p><p>BUT linphone, stores all the contacts locally…So I need to
  217. find a way to automate all of my contacts when I upgrade. For
  218. now, it was pretty easy to just save my <code>~/.config/</code> directory
  219. from my hard drive to a usb, and copy the linphone directory over.</p><p>&lt;a id=&quot;orga2a283e&quot;&gt;&lt;/a&gt;</p><h3>re-setting up my wifi connections</h3><p>Right now I use sway, and I can't quite get nm-applet to work.
  220. So I set up wifi connections via</p><pre><code>sudo nmcli dev wifi connect &quot;&lt;WIFI Name&gt;&quot; password &lt;password&gt; [name &quot;&lt;name&gt;&quot;]</code></pre><p>I've got three or so wifi networks that I use:</p><ul><li><p>My parents wifi</p></li><li><p>work wifi</p></li><li><p>home wifi</p></li></ul><p>-public library wifi</p><p>&lt;a id=&quot;org94e1897&quot;&gt;&lt;/a&gt;</p><h3>setting up my git username</h3><pre><code>git config --global user.name &quot;Joshua Branson&quot;
  221. git config --global user.email &quot;jbranso AT gnucode.me&quot;</code></pre><p>I actually don't know where git stores these settings, because
  222. I do not see a <code>~/.config/git</code> directory.</p><p>&lt;a id=&quot;orga2d1f7d&quot;&gt;&lt;/a&gt;</p><h2>copying <code>~./authinfo</code></h2><p>So Emacs uses <code>~/.authinfo</code> to save my passwords for various
  223. machines. For example to use my dismail email account the lines
  224. look like:</p><pre><code>machine imap.dismail.de login jbranso@dismail.de port imaps password someCoolPassword
  225. machine smtp.dismail.de login jbranso@dismail.de port 587 password someCoolPassword</code></pre><p>Of course this password cannot be stored in a git repository, or
  226. anyone could read my email. So I have to copy this file
  227. directly from the old machine.</p><p>Please note that Emacs recommends that you use <code>~/.authinfo.gpg</code>
  228. to securely encrypt your passwords. For the life of me, I cannot
  229. figure out how to reliably get this to work. gpg is hard to
  230. use. I also lose my gpg key all the time, and then I cannot
  231. decrypt my <code>.authinfo.gpg</code> file. I also have a hard time setting
  232. up emacs to use <code>~/.authinfo.gpg</code>.</p><p>Perhaps I should invest in a physical<a href="https://en.wikipedia.org/wiki/Trusted_Platform_Module"> trusted platform module</a>
  233. like the <a href="https://www.yubico.com/products/">yubikey</a> or <a href="https://puri.sm/products/librem-key/">librem-key</a>. I've heard that makes gpg key
  234. management a little easier. But then I just <strong>cannot</strong> lose that
  235. physical key.</p><p>&lt;a id=&quot;org94b5f0b&quot;&gt;&lt;/a&gt;</p><h2>Conclusion</h2><p>Whew! If you've read this far, then you are an awesome human
  236. being! As you can see, many of up carry a lot of system state
  237. in your operating systems. I hope this convinces you that we
  238. should store this state, so that it can be reliable reproduced
  239. without too much hassle!</p><p>Also, as a fun aside, Guix System sure takes up a lot of disk
  240. space. My SSD is either 220 or 240 GB. My <code>/</code> partition
  241. originally had 219 GB of free space on it.</p><pre><code>sudo fdisk --list /dev/sda | grep -e '240|sda3'</code></pre><p>BUT after installing GNU Guix System, and setting up sway and a
  242. good amount of applications, 10% of <code>/</code> is already being used!</p><pre><code>df -h | grep -B 1 sda</code></pre><p>And <code>/gnu/</code> takes up 17GB!</p><pre><code>sudo du -hc --max-depth=1 /gnu/</code></pre><p>Now I've reconfigured a few times. How much of that <code>/gnu/store/</code> can be
  243. deleted once I have deleted some system generations and perhaps some
  244. package generations?</p><p>The below suggests that I have three system generations. Let's
  245. reboot (to make sure that the current generation works), and
  246. then delete those old generations.</p><pre><code>guix system list-generations | grep Generation
  247. Generation 3 Jun 22 2021 21:41:14
  248. Generation 4 Jun 27 2021 01:36:47 (current)</code></pre><p>Rebooting worked, now let's try deleting some old generations.</p><pre><code>sudo guix system delete-generations</code></pre><p>#+RESULTS</p><pre><code>deleting /var/guix/profiles/system-1-link
  249. deleting /var/guix/profiles/system-2-link
  250. building /gnu/store/gdbm5lvi901ys1dplgjpw144fymr9di5-grub.cfg.drv...
  251. building /gnu/store/zx89ajlx901m46jk48pql3zlb25zsdsa-install-bootloader.scm.drv...</code></pre><p>The same is true for my package generations:</p><pre><code>guix package --list-generations | grep Generation
  252. Generation 5 Jun 23 2021 02:31:59 (current)
  253. guix package --delete-generations</code></pre><p>New let's go and delete some garbage!</p><pre><code>guix gc
  254. deleting `/gnu/store/trash'
  255. deleting unused links...
  256. note: currently hard linking saves 1386.33 MiB
  257. guix gc: freed 13,245.99083 MiBs</code></pre><p>Now how much does space does <code>/gnu/</code> take up now?</p><pre><code>sudo du -hc --max-depth=1 /gnu/</code></pre><p>#+RESULTS</p><pre><code>11G /gnu/store
  258. 11G /gnu/
  259. 11G total</code></pre><p>So it looks like we deleted 6 GB of cruft! That's not too bad!</p></div></article></section></main><footer><p>© 2020 Joshua Branson. The text on this site is free culture under the Creative Commons Attribution Share-Alike 4.0 International license.</p><p>This website is build with Haunt, a static site generator written in Guile Scheme. Source code is <a href="https://notabug.org/jbranso/gnucode.me">available.</a></p><p>The color theme of this website is based off of the famous <a href="#3f3f3f" target="_blank">zenburn</a> theme.</p></footer></body>