= foo-dogsquared's NixOS config
:toc:
:devos_link: https://github.com/divnix/digga/tree/580fc57ffaaf9cf3a582372235759dccfe44ac92/examples/devos
:doc_site: https://foo-dogsquared.github.io/nixos-config
:canonical_flake_url: github:foo-dogsquared/nixos-config
:canonical_flake_url_tarball_master: https://github.com/foo-dogsquared/nixos-config/archive/master.tar.gz
:canonical_flake_url_tarball_specific: https://github.com/foo-dogsquared/nixos-config/archive/35c27749c55077727529f412dade862e4deb2ae8.tar.gz

This is my NixOS config as a link:https://www.tweag.io/blog/2020-05-25-flakes/[Nix flake] eventually containing my (almost) complete setup from a desktop, to a server, to a personalized installer, almost everything.
Who knows it might contain another server just for the infrastructure for my custom non-NixOS distro just to flex how flexible NixOS can be. footnote:[This is how Garuda Linux is set up, btw.]

Anyways, this project also has a dedicated website at {doc_site} which I recommend to take a gander on how this project structures its configuration (and much of the information is not covered in this README anyways).
If you want the local documentation and has angst against online documentation, you can view the source code of the book at link:./docs/[`./docs/`].




== Getting started

This is an overencumbered set of NixOS configurations for different systems.
For this section though, we'll assume you're only interested in installing the desktop configuration.

To start, you'll have to download a NixOS installer image.
While you can download link:https://releases.nixos.org/?prefix=nixos/unstable/[the latest revisions from the official website], you can get my personalized installer from link:https://github.com/foo-dogsquared/nixos-config/releases/tag/latest[the releases page of this project].
Next, boot into the installer image.
Then as root, install the desktop with the following commands.

[source, shell, subs=attributes]
----
bash $(nix build --no-link --print-out-paths {canonical_flake_url}#nixosConfigurations.ni.config.system.build.diskoScript)
nixos-install --flake {canonical_flake_url}#ni
----

The above command will automate everything for you including the partitioning steps.

Voila!
You should have my desktop configuration installed.

However, it should also be barely usable since there are a couple of missing components that are needed such as the private keys for the desktop which is required for certain tasks such as backup task with Borg among other things.
There are also some additional prerequisites such as partitioning which is already handled with link:https://github.com/nix-community/disko[disko].




== TODO

In order of priority:

* [x] Create custom modules.
* [x] Create a themes system similar to link:https://github.com/hlissner/dotfiles[this NixOS config].
* [x] Create a good workflow for creating ISOs.
* [x] Create development shells.
* [x] Manage secrets with agenix.
* [ ] Create a good workflow for tests.
* [x] Automate backups with NixOS config.
* [x] Create custom packages and export it to flakes. (Maybe consider making it to upstream)
* [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:{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.


=== Out of scope:

* Set most program configurations with Nix.
This is especially applicable to programs I always use such as my text editor configs.

** The reason: managing them can be chaotic when applied with Nix.
The potential for it is pretty nice especially when seen with similar implementations such as Guix home environment.
However, I don't want to rebuild it every time I change it.

* Migration of my link:https://github.com/foo-dogsquared/dotfiles[dotfiles].
I still use it on other non-NixOS systems.

* To be a configuration framework.
This is my personal configuration which means experimentation will always be here.
Sudden changes can happen at any point.




== Copyright

This project is licensed under MIT license.
I just chose it to make it easier to upstream parts of this project to nixpkgs and to make it easier to copy it without much problems (just don't forget to add attribution as indicated from the license).
Please see link:./LICENSE[`./LICENSE`] for the full text.
