Update flakes and documentations

This commit is contained in:
Gabriel Arazas 2021-12-06 17:57:54 +08:00
parent d4f15e4c0b
commit e8b5f05bfd
4 changed files with 31 additions and 22 deletions

2
.gitmodules vendored
View File

@ -1,3 +1,3 @@
[submodule "users/config"] [submodule "users/config"]
path = users/foo-dogsquared/config path = users/home-manager/foo-dogsquared/config
url = https://github.com/foo-dogsquared/dotfiles.git url = https://github.com/foo-dogsquared/dotfiles.git

View File

@ -46,9 +46,8 @@ nixos-config
This usually configures like the hardware setup, timezone, and users. This usually configures like the hardware setup, timezone, and users.
Host configurations are also exported in the flakes in `outputs.nixosConfigurations`. Host configurations are also exported in the flakes in `outputs.nixosConfigurations`.
* link:./modules/[`./modules/`] contain my custom modules including for NixOS and home-manager. * link:./modules/[`./modules/`] contain my custom modules including NixOS and home-manager modules.
For more information, see the link:./modules/README.adoc[related documentation]. For more information, see the link:./modules/README.adoc[related documentation].
It is also exported from the flake in `outputs.nixosModules`.
* link:./pkgs/[`./pkgs/`] contains my custom packages. * link:./pkgs/[`./pkgs/`] contains my custom packages.
It is exported in the flakes at `outputs.packages` compiled through various systems (but only `x86_64-linux` is mainly tested). It is exported in the flakes at `outputs.packages` compiled through various systems (but only `x86_64-linux` is mainly tested).
@ -66,6 +65,7 @@ In order of priority:
* [x] Create custom modules. * [x] Create custom modules.
* [x] Create a themes system similar to link:https://github.com/hlissner/dotfiles[this NixOS config]. * [x] Create a themes system similar to link:https://github.com/hlissner/dotfiles[this NixOS config].
* [ ] Create development shells.
* [x] Manage secrets with agenix. * [x] Manage secrets with agenix.
* [ ] Create link:https://github.com/numtide/devshell[devshells]. * [ ] Create link:https://github.com/numtide/devshell[devshells].
* [x] Automate backups with NixOS config. * [x] Automate backups with NixOS config.

30
flake.lock generated
View File

@ -7,11 +7,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1638319138, "lastModified": 1638748414,
"narHash": "sha256-ve33f4nTKQluyvm5URQwL019x0Fnrg8urqzvymNeD+s=", "narHash": "sha256-5lII/CiiO1tobd92RMpVcwDAWVdpIvQdHCMT9kLRtk0=",
"owner": "ryantm", "owner": "ryantm",
"repo": "agenix", "repo": "agenix",
"rev": "52ea2f8c3231cc2b5302fa28c63588aacb77ea29", "rev": "c53ac31e44285ef77f239cc985aa43c03533172f",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -81,11 +81,11 @@
}, },
"locked": { "locked": {
"dir": "contrib", "dir": "contrib",
"lastModified": 1638653427, "lastModified": 1638765202,
"narHash": "sha256-4GjEJ3skxI7qrdh75bDfsmHo7QHkWWDo3waQ3Hotej4=", "narHash": "sha256-eW/ZDUrfP8rD8a5Rotqo8i5PKiK7UFWe75DgMLAtenY=",
"owner": "neovim", "owner": "neovim",
"repo": "neovim", "repo": "neovim",
"rev": "1e6eeca9d1360554ee18525603e83c3a1999a622", "rev": "523f03b506bf577811c0e136bc852cdb89f92c00",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -102,11 +102,11 @@
"nixpkgs": "nixpkgs" "nixpkgs": "nixpkgs"
}, },
"locked": { "locked": {
"lastModified": 1638692002, "lastModified": 1638778450,
"narHash": "sha256-qA5erdDRylHAdbWcSaa5MLQi5T7lwlNOcglvNt2GMbY=", "narHash": "sha256-C5UoHcRk5YjKNz9bVv+Kp28PjT/A+R49rUlpa1hFxvU=",
"owner": "nix-community", "owner": "nix-community",
"repo": "neovim-nightly-overlay", "repo": "neovim-nightly-overlay",
"rev": "ccbfeaac2c0b0cae2ab48a1dca49cba4f4ac9b8c", "rev": "740f1503ca2e5c066507e836bac13aa21c87da3b",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -117,11 +117,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1638376152, "lastModified": 1638535497,
"narHash": "sha256-ucgLpVqhFnClH7YRUHBHnmiOd82RZdFR3XJt36ks5fE=", "narHash": "sha256-tk5LNbdkUhALp00+r5ZmQ3t7n2d5M7YUQB+MznWvVOg=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "6daa4a5c045d40e6eae60a3b6e427e8700f1c07f", "rev": "c71f061c68ba8ce53471b767d5049cbd0f3d8490",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -133,11 +133,11 @@
}, },
"nixpkgs_2": { "nixpkgs_2": {
"locked": { "locked": {
"lastModified": 1638432899, "lastModified": 1638671387,
"narHash": "sha256-iZ+rgyRx3JVyylXYxSyW01liDWEn+O8cKnin6cMzOFU=", "narHash": "sha256-xjxuLNcbwoGU9UXuEbbsYigVDXANOI+09nlMTUAtxLQ=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "56cbe42f1668338d05febfbb866e32f2c865609a", "rev": "5a1f29a6574d5086cc6d97c2ab1eea4d0302ab94",
"type": "github" "type": "github"
}, },
"original": { "original": {

View File

@ -1,8 +1,7 @@
= Modules = Modules
:toc: :toc:
These are the modules to be used for the system configuration. These are various modules ranging from link:https://nixos.org/manual/nixos/stable/index.html#sec-writing-modules[NixOS modules] and link:https://github.com/nix-community/home-manager[home-manager] modules.
Multiple types of modules can be found here but the usual types of modules you'll be paying attention is the modules for link:https://nixos.org/manual/nixos/stable/index.html#sec-writing-modules[NixOS modules] and home-manager, both in link:./nixos/[`./nixos/`] and link:./home-manager/[`./home-manager/`], respectively.
The modules are imported usually through `lib.filesToAttr`, allowing for easier structuring without modifying the index file of each module (i.e., `default.nix`). The modules are imported usually through `lib.filesToAttr`, allowing for easier structuring without modifying the index file of each module (i.e., `default.nix`).
(See the implementation for more details.) (See the implementation for more details.)
@ -11,7 +10,7 @@ For example, take the following module folder structure...
[source, tree] [source, tree]
---- ----
system/ nixos/
├── themes/ ├── themes/
│   ├── a-happy-gnome/ │   ├── a-happy-gnome/
│   │   ├── default.nix │   │   ├── default.nix
@ -51,7 +50,7 @@ system/
---- ----
The resulting attribute set can be easily be used for importing. The resulting attribute set can be easily be used for importing.
Here's an example of a NixOS system created with the NixOS modules which can used for shared configuration between hosts. Here's an example of a NixOS system created with the custom NixOS modules (i.e., link:./nixos/[`./nixos/`]) which can used for shared configuration between hosts.
[source, nix] [source, nix]
---- ----
@ -60,3 +59,13 @@ lib.nixosSystem {
modules = lib.mapAttrsToList (name: path: import path) (lib.filesToAttr ./modules/nixos); modules = lib.mapAttrsToList (name: path: import path) (lib.filesToAttr ./modules/nixos);
} }
---- ----
== Flake outputs
Various modules are then exported to the project flake as the following output:
* `nixosModules` exports modules from link:./nixos/[`./nixos/`].
* `homeManagerModules` exports modules from link:./home-manager/[`./home-manager/`].