mirror of
https://github.com/foo-dogsquared/nixos-config.git
synced 2025-01-31 04:58:01 +00:00
docs: update READMEs and comments
This commit is contained in:
parent
30c7ee0203
commit
eebaf93938
14
README.adoc
14
README.adoc
@ -1,5 +1,6 @@
|
|||||||
= foo-dogsquared's NixOS config
|
= foo-dogsquared's NixOS config
|
||||||
:toc:
|
: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].
|
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.
|
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.
|
Nonetheless, the parts is it isn't reproducible is only about 10% of this config.
|
||||||
Everything else is fine and dandy.
|
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!
|
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.
|
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.
|
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:
|
My NixOS config should look like the following:
|
||||||
|
|
||||||
@ -157,7 +161,7 @@ In order of priority:
|
|||||||
* [x] Create cluser-wide configs.
|
* [x] Create cluser-wide configs.
|
||||||
* [x] Create host-wide configs.
|
* [x] Create host-wide configs.
|
||||||
* [x] Create user-specific configs with home-manager.
|
* [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.
|
* [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.
|
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:
|
Here's a few I personally dug into:
|
||||||
+
|
+
|
||||||
* https://github.com/divnix/devos
|
* {devos_link}
|
||||||
* https://github.com/hlissner/dotfiles
|
* https://github.com/hlissner/dotfiles
|
||||||
* https://github.com/thiagokokada/nix-configs
|
* 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.
|
This feature somewhat helped me understand more about the Nix language, oddly.
|
||||||
I guess those lightbulb moments can come from random places.
|
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.
|
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.
|
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.
|
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:
|
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.
|
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.
|
Though, this is where my config is heading to be and instead slowly making parts of my config based from this template.
|
||||||
|
|
||||||
|
@ -231,7 +231,7 @@
|
|||||||
};
|
};
|
||||||
in {
|
in {
|
||||||
# Exposes only my library with the custom functions to make it easier to
|
# 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; };
|
lib = import ./lib { lib = nixpkgs.lib; };
|
||||||
|
|
||||||
# A list of NixOS configurations from the `./hosts` folder. It also has
|
# A list of NixOS configurations from the `./hosts` folder. It also has
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
= Host-specific configuration
|
= Host-specific configuration
|
||||||
:toc:
|
: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.
|
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
|
== Integrating with custom modules
|
||||||
|
|
||||||
The host configurations placed here most likely use the link:../modules/nixos[custom NixOS 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.
|
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].
|
||||||
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).
|
|
||||||
|
|
||||||
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.
|
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`].
|
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.
|
* 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:
|
You can use it as follows:
|
||||||
+
|
+
|
||||||
[source, nix]
|
[source, nix]
|
||||||
@ -36,6 +35,3 @@ imports = [ # Your modules ]
|
|||||||
# Import the following NixOS users.
|
# Import the following NixOS users.
|
||||||
++ (lib.attrValues (lib.getUsers "nixos" [ "foo-dogsquared" "polski" ]));
|
++ (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.
|
|
||||||
|
@ -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 {
|
(lib.mkIf cfg.wine.enable {
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
cfg.wine.package # The star of the show.
|
cfg.wine.package # The star of the show.
|
||||||
|
@ -3,9 +3,9 @@
|
|||||||
|
|
||||||
These are where my themes are defined and configured.
|
These are where my themes are defined and configured.
|
||||||
Basically, themes are mainly graphical sessions concerned with aesthetics.
|
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.
|
The following list is the summary which can also serve as a guideline to developing a theme.
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
:toc:
|
:toc:
|
||||||
|
|
||||||
This is where user-specific configurations comes in.
|
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:
|
Take note of the following structure:
|
||||||
|
|
||||||
@ -16,7 +16,6 @@ users/
|
|||||||
├── nixos/
|
├── nixos/
|
||||||
│ ├── foo-dogsquared/
|
│ ├── foo-dogsquared/
|
||||||
│ ├── harepoint/
|
│ ├── harepoint/
|
||||||
│ ├── polski/
|
|
||||||
│ └── vmguest/
|
│ └── vmguest/
|
||||||
└── README.adoc
|
└── README.adoc
|
||||||
----
|
----
|
||||||
|
Loading…
Reference in New Issue
Block a user