From eebaf939388aaedb1f41c84dc74999654bda4512 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sat, 9 Jul 2022 14:04:17 +0800 Subject: [PATCH] docs: update READMEs and comments --- README.adoc | 14 +++++++++----- flake.nix | 2 +- hosts/README.adoc | 10 +++------- modules/nixos/profiles/system.nix | 3 ++- modules/nixos/themes/README.adoc | 4 ++-- users/README.adoc | 3 +-- 6 files changed, 18 insertions(+), 18 deletions(-) diff --git a/README.adoc b/README.adoc index 296a47aa..bd7dc859 100644 --- a/README.adoc +++ b/README.adoc @@ -1,5 +1,6 @@ = foo-dogsquared's NixOS config :toc: +:devos_link: https://github.com/divnix/digga/tree/580fc57ffaaf9cf3a582372235759dccfe44ac92/examples/devos This is my NixOS config as a link:https://www.tweag.io/blog/2020-05-25-flakes/[Nix flake]. @@ -17,6 +18,9 @@ Despite being a NixOS system, it isn't entirely reproducible to the point of ins It has some things needed in the first place to work like my external backup setup where it needs my SSH private keys to work in the first place. Nonetheless, the parts is it isn't reproducible is only about 10% of this config. Everything else is fine and dandy. + +Oh right... +Don't expect everything is working in each commit but I'm doing my best to make them build successfully in each, yeah? ==== Hey there, fellow traveler! @@ -94,7 +98,7 @@ It uses GitHub workflows to enable things such as... Last and foremost, we have the project directory — the environment you'll be living in for the next year, tinkering your Nix configs. . It is required to be familiar with the workspace, after all. -My configuration takes a lot of cues from link:https://github.com/divnix/devos[devos] (which is unfortunately is a lot to take if you're just beginning to grok Nix as a whole). +My configuration takes a lot of cues from link:{devos_link}[devos] (which is unfortunately is a lot to take if you're just beginning to grok Nix as a whole). My NixOS config should look like the following: @@ -157,7 +161,7 @@ In order of priority: * [x] Create cluser-wide configs. * [x] Create host-wide configs. * [x] Create user-specific configs with home-manager. -* [x] ~Steal~ Get some ideas from link:https://github.com/divnix/devos[this overengineered template]. +* [x] ~Steal~ Get some ideas from link:{devos_link}[this overengineered template]. * [x] Make use of other established utilities such as link:https://github.com/divnix/digga/[digga], link:https://github.com/gytis-ivaskevicius/flake-utils-plus[flake-utils-plus], and link:https://github.com/nix-community/home-manager[home-manager] once I'm familiar to create my own Nix programs. @@ -199,7 +203,7 @@ Fortunately footnote:[Or unfortunately from a different perspective.], it is mos For a more practical start, I recommend to look into several configurations to see the general gist of configuration with Nix. Here's a few I personally dug into: + -* https://github.com/divnix/devos +* {devos_link} * https://github.com/hlissner/dotfiles * https://github.com/thiagokokada/nix-configs @@ -225,7 +229,7 @@ With that said, it is workable to be a daily part of the NixOS experience especi This feature somewhat helped me understand more about the Nix language, oddly. I guess those lightbulb moments can come from random places. -Is this based from link:https://github.com/divnix/devos[devos]?:: +Is this based from link:{devos_link}[devos]?:: Yes but I've created this from scratch. One of my goals when creating this config is to use as little dependency as much as possible and to understand more what's going under the hood with Nix. At the time I've rewritten this configuration, I have little idea about Nix as a language and I find devos to be overwhelming so I doubled down to create from scratch. @@ -241,7 +245,7 @@ It is nice that such a project exists serving as a reference for bigger configur I ~stole~ got several parts of this configuration from the following projects: -* link:https://github.com/divnix/devos[devos, an overengineered configuration framework.] +* link:{devos_link}[devos, an overengineered configuration framework.] I'm slowly grokking Nix and its ecosystem so I didn't use this outright. Though, this is where my config is heading to be and instead slowly making parts of my config based from this template. diff --git a/flake.nix b/flake.nix index 5dfda9b8..8595922f 100644 --- a/flake.nix +++ b/flake.nix @@ -231,7 +231,7 @@ }; in { # Exposes only my library with the custom functions to make it easier to - # include in other flakes. + # include in other flakes for whatever reason may be. lib = import ./lib { lib = nixpkgs.lib; }; # A list of NixOS configurations from the `./hosts` folder. It also has diff --git a/hosts/README.adoc b/hosts/README.adoc index 805da95e..3db312e6 100644 --- a/hosts/README.adoc +++ b/hosts/README.adoc @@ -1,7 +1,7 @@ = Host-specific configuration :toc: -These are NixOS configurations that are specific to a machine (e.g., desktop, servers, VM, containers). +These are NixOS configurations that are specific to a machine (e.g., desktop, servers, VMs, containers, installation media). Ideally, it should be made minimal as much as possible considering you also have to manage your users. @@ -10,8 +10,7 @@ Ideally, it should be made minimal as much as possible considering you also have == Integrating with custom modules The host configurations placed here most likely use the link:../modules/nixos[custom NixOS modules]. -The custom modules shouldn't be imported manually from the host. -In the case for our link:../flake.nix[flake configuration], the importing of modules are already taken care of — specifically through `mkHost` from link:../lib/flake-utils.nix[`../lib/flake-utils.nix`] (see the linked file for the implementation). +The custom modules shouldn't be imported manually from the host as this is already taken care of from the link:../flake.nix[flake definition]. It is best practice to assume the host configurations make use of the link:../modules/nixos[custom NixOS modules], link:../pkgs[custom packages], and the flake inputs. In other words, always pay attention to link:../flake.nix[`../flake.nix`]. @@ -27,7 +26,7 @@ For managing users, there are multiple ways to manage them with this config: * If you intend to import users from the link:../users/nixos/[`../users/nixos/`], you can simply import them through `imports` in the system module. + -For a convenient option, there is the function `getUsers` defined from the link:../lib/default.nix[custom library]. +For a convenient option, there is the function `getUsers` defined from the link:../lib/private.nix[private custom library]. You can use it as follows: + [source, nix] @@ -36,6 +35,3 @@ imports = [ # Your modules ] # Import the following NixOS users. ++ (lib.attrValues (lib.getUsers "nixos" [ "foo-dogsquared" "polski" ])); ---- - -* link:../modules/nixos/profiles/users.nix[`modules.users.users.${user}`] which is my implementation for managing users from link:../users/home-manager/[`../users/home-manager/`] — e.g., `modules.users.users.foo-dogsquared = {}`. -This is integrating my home-manager users to map into NixOS users. diff --git a/modules/nixos/profiles/system.nix b/modules/nixos/profiles/system.nix index b7773818..58c988fd 100644 --- a/modules/nixos/profiles/system.nix +++ b/modules/nixos/profiles/system.nix @@ -177,7 +177,8 @@ in { }; }) - # I try to avoid using Wine on NixOS because most of them uses FHS or something and I just want it to work but here goes. + # I try to avoid using Wine on NixOS because most of them uses FHS or + # something and I just want it to work but here goes. (lib.mkIf cfg.wine.enable { environment.systemPackages = with pkgs; [ cfg.wine.package # The star of the show. diff --git a/modules/nixos/themes/README.adoc b/modules/nixos/themes/README.adoc index 35ddfb42..0e53bb3e 100644 --- a/modules/nixos/themes/README.adoc +++ b/modules/nixos/themes/README.adoc @@ -3,9 +3,9 @@ These are where my themes are defined and configured. Basically, themes are mainly graphical sessions concerned with aesthetics. -It could also include specific workflows and configurations. +It could also include system-wide workflows and configurations. -This is where modules will define how you're going to interact with the computer. +This is where modules will define how you're going to interact with the computer whether you should use something ranging from a full-fledged desktop environment with bells and whistles to a minimalist desktop environment only composing of a window manager, a terminal, and a bar. The following list is the summary which can also serve as a guideline to developing a theme. diff --git a/users/README.adoc b/users/README.adoc index 1eaabf1a..d8a0adbf 100644 --- a/users/README.adoc +++ b/users/README.adoc @@ -2,7 +2,7 @@ :toc: This is where user-specific configurations comes in. -Similar to modules, the top-level of this directory contains users for various types (e.g., home-manager, NixOS) where it contains individual users for that type. +Similar to modules, the top-level of this directory contains users for various modules (e.g., home-manager, NixOS). Take note of the following structure: @@ -16,7 +16,6 @@ users/ ├── nixos/ │ ├── foo-dogsquared/ │ ├── harepoint/ -│ ├── polski/ │   └── vmguest/ └── README.adoc ----