From 6ef087a067637193b4419b72a4fc1db1d42b927e Mon Sep 17 00:00:00 2001
From: Gabriel Arazas <foo.dogsquared@gmail.com>
Date: Fri, 28 Aug 2020 15:58:17 +0800
Subject: [PATCH] Back to stable AGAIN and update the docs

---
 Makefile                                           |  11 +++++++----
 README.adoc                                        |  13 ++++++++++---
 default.nix                                        |   2 +-
 hosts/zilch/README.adoc                            |   4 ++++
 hosts/zilch/config/unison/backup.prf               |   0
 hosts/zilch/default.nix                            |  12 ++++++------
 hosts/zilch/hardware-configuration.nix             |   8 ++++----
 hosts/zilch/modules/overlays.nix                   |   0
 modules/desktop/music.nix                          |   2 +-
 modules/dev/android.nix                            |   2 +-
 modules/dev/gamedev.nix                            |   4 ++--
 modules/dev/javascript.nix                         |   2 +-
 modules/dev/perl.nix                               |   0
 modules/shell/base.nix                             |   1 +
 modules/themes/fair-and-square/config/wallpaper    | Bin
 packages/default.nix                               |   2 +-
 templates/themes/README.adoc                       |   4 ----
 .../{{ cookiecutter.name }}/config/wallpaper       | Bin
 18 files changed, 39 insertions(+), 28 deletions(-)
 mode change 100644 => 100755 hosts/zilch/README.adoc
 mode change 100644 => 100755 hosts/zilch/config/unison/backup.prf
 mode change 100644 => 100755 hosts/zilch/modules/overlays.nix
 mode change 100644 => 100755 modules/dev/perl.nix
 mode change 100644 => 100755 modules/themes/fair-and-square/config/wallpaper
 mode change 100644 => 100755 templates/themes/fair-and-square/{{ cookiecutter.name }}/config/wallpaper

diff --git a/Makefile b/Makefile
index 15e3d7a1..f0e02f75 100755
--- a/Makefile
+++ b/Makefile
@@ -6,9 +6,9 @@ DOTS	:= /etc/dotfiles
 NIXOS_VERSION	:= 20.03
 NIXOS_PREFIX	:= $(PREFIX)/etc/nixos
 FLAGS		:= -I "config=$$(pwd)/config" \
-		   -I "modules=$$(pwd)/modules" \
-		   -I "bin=$$(pwd)/bin" \
-		   $(FLAGS)
+		-I "modules=$$(pwd)/modules" \
+		-I "bin=$$(pwd)/bin" \
+		$(FLAGS)
 
 config:	$(NIXOS_PREFIX)/configuration.nix
 home:	$(HOME)/dotfiles
@@ -30,9 +30,12 @@ install: channels update
 	@sudo nixos-generate-config --root "$(PREFIX)" && sudo cp --update "$(NIXOS_PREFIX)/hardware-configuration.nix" "$$(pwd)/hosts/$(HOST)/hardware-configuration.nix"
 	@echo "import \"$(DOTS)\" \"$(HOST)\" \"$${USER}\"" | sudo tee "${NIXOS_PREFIX}/configuration.nix"
 	@sudo nixos-install --root "$(PREFIX)" $(FLAGS)
-	@sudo rm -r "$(PREFIX)/etc/dotfiles" && sudo cp -r "$(DOTS)" "$(PREFIX)/etc/dotfiles"
+	@sudo cp -r "$(DOTS)" "$(PREFIX)/etc/dotfiles"
 	@sudo nixos-enter --root "$(PREFIX)" -c chown $(USER):users $(DOTS)
 
+clean:
+	@sudo nix-collect-garbage -d
+
 upgrade: update switch
 
 rollback:
diff --git a/README.adoc b/README.adoc
index b9e27852..7d6b1fcd 100755
--- a/README.adoc
+++ b/README.adoc
@@ -19,15 +19,17 @@ To install, you have to do the following first:
 - Install GNU Make.
 
 Then simply run `make install`.
-The default behavior of the installation installs my default setup.
 It is equivalent to the following command:
 
 [source, shell]
 ----
-PREFIX=/mnt USER=foo-dogsquared HOST=zilch make --directory /etc/dotfiles install
+USER=foo-dogsquared HOST=zilch make --directory /etc/dotfiles install
 ----
 
-For more information, simply inspect the Makefile.
+As of 2020-08-28, it wouldn't work since it assumes the installation root is at `/` rather than `/mnt`.
+To correct this behavior, simply configure the `PREFIX` variable (e.g., `PREFIX=/mnt make install`).
+
+For more information, simply inspect the link:./Makefile[`./Makefile`].
 
 Assuming you did install, your project will have the following stuff.
 
@@ -68,6 +70,11 @@ nixos-config
 └── README.adoc*
 ----
 
+* The entrypoint of this setup is link:./default.nix[`./default.nix`] (which is like `index.html` for webpages).
+It contains a function that accepts two arguments: the name of the host and the username of the main user.
+The host should exist at `./hosts/$HOST/` (see <<Hosts>> for more info).
+Meanwhile, the main user is primarily referred with the `my` attribute defined at link:./modules/default.nix[`./modules/default.nix`].
+
 * The directory paid with the most attention would most likely be the `modules/` folder which contains cluster-wide footnote:[Whenever I say 'cluster-wide', I really mean my laptop (which I have none at the moment) and desktop (which I have only one at the moment).]  modules intended to be used in each device.
 
 ** Another folder worthy of attention is the `modules/themes` which sets up a complete desktop environment for you so you don't have to.
diff --git a/default.nix b/default.nix
index dcfc13e5..066d5143 100755
--- a/default.nix
+++ b/default.nix
@@ -63,7 +63,7 @@ device: username:
   my.user = {
     isNormalUser = true;
     uid = 1000;
-    extraGroups = [ "wheel" "video" "networkmanager" "libvirtd" ];
+    extraGroups = [ "wheel" "video" "libvirtd" ];
     shell = pkgs.zsh;
   };
 
diff --git a/hosts/zilch/README.adoc b/hosts/zilch/README.adoc
old mode 100644
new mode 100755
index e8484740..01425196
--- a/hosts/zilch/README.adoc
+++ b/hosts/zilch/README.adoc
@@ -3,6 +3,10 @@
 This is Zilch, the main machine (and only desktop as of 2020-08-16).
 As such, it contains muh games and other stuff I attempt to bring over to Linux such as my music production workflow (I'm also learning how to compose music __properly__) and computer-aided designing with computers.
 
+One of the main points to keep in mind is the `dots` alias attached to the main user.
+It provides a convenient way to upgrade the whole system in one fell swoop.
+You can use https://nixos.org/nix/manual/#sec-profiles[user profiles] and run local upgrades (e.g., `nix-env -i all`, `home-manager switch upgrade`) for your other accounts.
+
 Just to make this note seem more important, I'll just list the games I'm currently into:
 
 - https://play0ad.com/[0 A.D.]
diff --git a/hosts/zilch/config/unison/backup.prf b/hosts/zilch/config/unison/backup.prf
old mode 100644
new mode 100755
diff --git a/hosts/zilch/default.nix b/hosts/zilch/default.nix
index 8ed36e5a..7c37bdfc 100755
--- a/hosts/zilch/default.nix
+++ b/hosts/zilch/default.nix
@@ -141,12 +141,12 @@
 
   my.packages = with pkgs; [
     # Muh games.
-    dwarf-fortress      # Losing is fun!
-    endless-sky         # Losing is meh!
-    minetest            # Losing?! What's that?
-    openmw              # Losing is even more meh1
-    wesnoth             # Losing is frustrating!
-    zeroad              # Losing is fun and frustrating!
+    unstable.dwarf-fortress      # Losing is fun!
+    unstable.endless-sky         # Losing is meh!
+    unstable.minetest            # Losing?! What's that?
+    unstable.openmw              # Losing is even more meh1
+    unstable.wesnoth             # Losing is frustrating!
+    unstable.zeroad              # Losing is fun and frustrating!
 
     # Installing some of the dependencies required for my scripts.
     ffcast
diff --git a/hosts/zilch/hardware-configuration.nix b/hosts/zilch/hardware-configuration.nix
index 39838224..3732f70c 100755
--- a/hosts/zilch/hardware-configuration.nix
+++ b/hosts/zilch/hardware-configuration.nix
@@ -8,23 +8,23 @@
     [ <nixpkgs/nixos/modules/installer/scan/not-detected.nix>
     ];
 
-  boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "ohci_pci" "ehci_pci" "usb_storage" "uas" "usbhid" "sd_mod" ];
+  boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "ohci_pci" "ehci_pci" "usb_storage" "usbhid" "sd_mod" ];
   boot.initrd.kernelModules = [ ];
   boot.kernelModules = [ "kvm-amd" ];
   boot.extraModulePackages = [ ];
 
   fileSystems."/" =
-    { device = "/dev/disk/by-uuid/5a99c954-92ae-4368-af6d-3e4b1d464474";
+    { device = "/dev/disk/by-uuid/8479243e-fce0-44aa-8b1c-66b6915992d5";
       fsType = "ext4";
     };
 
   fileSystems."/boot" =
-    { device = "/dev/disk/by-uuid/F3B1-E4AC";
+    { device = "/dev/disk/by-uuid/F4BC-C230";
       fsType = "vfat";
     };
 
   swapDevices =
-    [ { device = "/dev/disk/by-uuid/4b2a4a00-f705-45b9-a014-e60acce2ae2a"; }
+    [ { device = "/dev/disk/by-uuid/df977c05-495e-4bd4-b99a-919cf3caaaa1"; }
     ];
 
   nix.maxJobs = lib.mkDefault 2;
diff --git a/hosts/zilch/modules/overlays.nix b/hosts/zilch/modules/overlays.nix
old mode 100644
new mode 100755
diff --git a/modules/desktop/music.nix b/modules/desktop/music.nix
index 6f22713b..0ebe292d 100755
--- a/modules/desktop/music.nix
+++ b/modules/desktop/music.nix
@@ -31,7 +31,7 @@ in {
         fluidsynth  # Synth for fluid sounds.
         helm        # A great synthesizer plugin.
         hydrogen    # Them drum beats composition will get good.
-        polyphone   # Edit your fonts for sound.
+        unstable.polyphone   # Edit your fonts for sound.
         zynaddsubfx # Ze most advanced synthesizer I've seen so far (aside from the upcoming Vital syntehsizer).
 
         # As of 2020-07-03, lmms has some trouble regarding Qt or something so at least use the "unstable" channel just to be safe.
diff --git a/modules/dev/android.nix b/modules/dev/android.nix
index a4c80baf..64f8cc0b 100755
--- a/modules/dev/android.nix
+++ b/modules/dev/android.nix
@@ -14,7 +14,7 @@ with lib;
     my.packages = with pkgs; [
       android-studio        # The apartment for Android development.
       dart                  # It's JavaScript except saner and slimmer.
-      flutter               # It's Electron except saner and slimmer.
+      unstable.flutter               # It's Electron except saner and slimmer.
       kotlin                # It's Java except saner and slimmer.
     ];
 
diff --git a/modules/dev/gamedev.nix b/modules/dev/gamedev.nix
index 07ba32f1..ed75d7ae 100755
--- a/modules/dev/gamedev.nix
+++ b/modules/dev/gamedev.nix
@@ -24,8 +24,8 @@ in
       ] else []) ++
 
       (if cfg.unity3d.enable then [
-        unity3d     # The Unity, not to be confused with a certain ideal.
-        unityhub    # The ideal hub for your Unity projects.
+        unstable.unity3d     # The Unity, not to be confused with a certain ideal.
+        unstable.unityhub    # The ideal hub for your Unity projects.
       ] else []);
   };
 }
diff --git a/modules/dev/javascript.nix b/modules/dev/javascript.nix
index da0388c1..7a1d84f3 100755
--- a/modules/dev/javascript.nix
+++ b/modules/dev/javascript.nix
@@ -21,7 +21,7 @@ in
   config = {
     my.packages = with pkgs;
       (if cfg.deno.enable then [
-        deno        # The Deltarune of Node.
+       unstable.deno        # The Deltarune of Node.
       ] else []) ++
 
       (if cfg.node.enable then [
diff --git a/modules/dev/perl.nix b/modules/dev/perl.nix
old mode 100644
new mode 100755
diff --git a/modules/shell/base.nix b/modules/shell/base.nix
index 633646a7..d28f216b 100755
--- a/modules/shell/base.nix
+++ b/modules/shell/base.nix
@@ -12,6 +12,7 @@ with lib;
 
   config = mkIf config.modules.shell.base.enable {
     my.packages = with pkgs; [
+      aria2         # The sequel to aria(1).
       aspell        # Hunt down a spelling bee champion to come to your shell.
       bat           # cat(1) with wings.
       # buku          # A developer-oriented browser-independent bookmark manager.
diff --git a/modules/themes/fair-and-square/config/wallpaper b/modules/themes/fair-and-square/config/wallpaper
old mode 100644
new mode 100755
diff --git a/packages/default.nix b/packages/default.nix
index 92350ff5..84bd772e 100755
--- a/packages/default.nix
+++ b/packages/default.nix
@@ -3,7 +3,7 @@
     # defold = (callPackage ./defold.nix {});
 
     # Add packages from the unstable channel with `pkgs.unstable.$PKG`.
-    # unstable = import <nixpkgs-unstable> { inherit config; };
+    unstable = import <nixpkgs-unstable> { inherit config; };
   })
 
   # The unstable branch of Emacs.
diff --git a/templates/themes/README.adoc b/templates/themes/README.adoc
index 49a9c270..7b1adf9e 100755
--- a/templates/themes/README.adoc
+++ b/templates/themes/README.adoc
@@ -3,7 +3,3 @@
 These are some of my themes om NixOS as a module ala-link:https://github.com/hlissner/dotfiles[hlissner NixOS modules] as a https://github.com/cookiecutter/cookiecutter[Cookiecutter template].
 Most of them just need a Pywal JSON scheme in the appropriate config file and generate the module with the given color scheme as a result.
 
-Also, to make them working, you need to have home-manager installed (or do the hardwork of converting them to be suitable for system configuration yourself, your choice).
-Furthermore, be careful when using the themes as they may override some of the current configuration.
-The modules assume you don't have much installed and/or enabled (e.g., display servers, window managers) and handle installing those packages for you.
-
diff --git a/templates/themes/fair-and-square/{{ cookiecutter.name }}/config/wallpaper b/templates/themes/fair-and-square/{{ cookiecutter.name }}/config/wallpaper
old mode 100644
new mode 100755