diff --git a/apps/gen-docs/script.sh b/apps/gen-docs/script.sh index 522d1900..83bfe1e0 100755 --- a/apps/gen-docs/script.sh +++ b/apps/gen-docs/script.sh @@ -1,9 +1,11 @@ -packageMetaFunc=$(cat << EOF +getMetaFunc=$(cat << EOF (x: { attrs = builtins.mapAttrs (_: v: { desc = builtins.replaceStrings ["\n"] [" "] (v.meta.description or ""); homepage = v.meta.homepage or ""; - }) (builtins.removeAttrs x.\${builtins.currentSystem} ["default"]); + roleDesc = builtins.replaceStrings ["\n"] [" "] (v.config.meta.roleDescription or ""); + hwDesc = builtins.replaceStrings ["\n"] [" "] (v.config.meta.hardwareDescription or ""); + }) (builtins.removeAttrs (x.\${builtins.currentSystem} or x) ["default"]); }) EOF ) @@ -15,12 +17,13 @@ substitute() { --impure \ --json \ "$FLAKE"#"$1" \ - --apply "$packageMetaFunc" | + --apply "$getMetaFunc" | jq -r - ) -t markdown --template "$2" -o "$3" + ) -t markdown --template "$FLAKE/apps/gen-docs/templates/$2.md" -o "$FLAKE/$2/README.md" } -# TODO: add configurations, homeManagerModules, lib, modules, nixFastChecks, overlays, scopedPackages -substitute "appsPackages" "$FLAKE/apps/gen-docs/templates/apps.md" "$FLAKE/apps/README.md" -substitute "devShells" "$FLAKE/apps/gen-docs/templates/devShells.md" "$FLAKE/devShells/README.md" -substitute "packages" "$FLAKE/apps/gen-docs/templates/packages.md" "$FLAKE/packages/README.md" +# TODO: add homeManagerModules, lib, modules, nixFastChecks, overlays, scopedPackages +substitute "appsPackages" "apps" +substitute "nixosConfigurations" "configurations" +substitute "devShells" "devShells" +substitute "packages" "packages" diff --git a/apps/gen-docs/templates/configurations.md b/apps/gen-docs/templates/configurations.md new file mode 100644 index 00000000..122a658e --- /dev/null +++ b/apps/gen-docs/templates/configurations.md @@ -0,0 +1,13 @@ +# nixosConfigurations + +This directory contains every device's main configuration file, their `hardware-configuration.nix` and some custom modules +unique to them. + +## List of my Devices + +| Name | Model / Specs | Description | +| --------- | ------------- | ------------------------------------------------------------------------------------------------ | +| `android` | OnePlus 9 Pro | [Nix-On-Droid](https://github.com/nix-community/nix-on-droid) configuration for my OnePlus 9 Pro | +$for(attrs/pairs)$ +| `$it.key$` | $it.value.hwDesc/nowrap$ | $it.value.roleDesc/nowrap$ | +$endfor$ diff --git a/apps/gen-docs/templates/packages.md b/apps/gen-docs/templates/packages.md index fcf9f0d8..c0935bc9 100644 --- a/apps/gen-docs/templates/packages.md +++ b/apps/gen-docs/templates/packages.md @@ -4,8 +4,8 @@ This directory contains every derivations for packages exposed by this flake. ## List of my packages found in `self.packages` -| Name | Description | -| ---- | ----------- | +| Name | Description | Homepage | +| ---- | ----------- | -------- | $for(attrs/pairs)$ | `$it.key$` | $it.value.desc/nowrap$ | $it.value.homepage/nowrap$ | $endfor$ diff --git a/configurations/README.md b/configurations/README.md index ebea17b4..3357e196 100644 --- a/configurations/README.md +++ b/configurations/README.md @@ -5,14 +5,15 @@ unique to them. ## List of my Devices -| Name | Model / Specs | Description | -| ------------- | --------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | -| `android` | OnePlus 9 Pro | [Nix-On-Droid](https://github.com/nix-community/nix-on-droid) configuration for my OnePlus 9 Pro | -| `bbsteamie` | 512GB OLED | My wife's SteamDeck that has a pink case (it took a lot of convincing for this) | -| `binto` | NVIDIA 3070 with Ryzen 7 3700X | Desktop PC with a multi-monitor setup | -| `cluster` | Lenovo ThinkCentre M900 | Two Lenovo mini PCs that make use of [NixOS-pcsd](https://github.com/matt1432/nixos-pcsd) to form a cluster | -| `live-image` | USB key | Basic configuration that serves as my custom ISO target | -| `homie` | Lenovo Thinkcentre M910q | Mini PC that serves as a Home-assistant server | -| `nos` | NVIDIA 3060 with i5-3600 | Custom built NAS and seedbox for Linux ISOs ;) | -| `servivi` | Headless Ryzen 5 3600 | Gaming PC in a previous life, it is now used as a build farm and hosts game servers | -| `wim` | ThinkPad L13 Yoga Gen 3 (Ryzen 7 PRO 5875U) | 2-1 Lenovo Laptop that I use for university | +| Name | Model / Specs | Description | +| --------- | ------------- | ------------------------------------------------------------------------------------------------ | +| `android` | OnePlus 9 Pro | [Nix-On-Droid](https://github.com/nix-community/nix-on-droid) configuration for my OnePlus 9 Pro | +| `bbsteamie` | 512GB OLED | My wife's SteamDeck that has a pink case (it took a lot of convincing for this) | +| `binto` | NVIDIA 3070 with Ryzen 7 3700X | Desktop PC with a multi-monitor setup | +| `homie` | Lenovo Thinkcentre M910q | Mini PC that serves as a Home-assistant server | +| `live-image` | USB key | Basic configuration that serves as my custom ISO target | +| `nos` | NVIDIA 3060 with i5-3600 | Custom built NAS and seedbox for Linux ISOs ;) | +| `servivi` | Headless Ryzen 5 3600 | Gaming PC in a previous life, it is now used as a build farm and hosts game servers | +| `thingone` | Lenovo ThinkCentre M900 | Mini PC that makes use of [NixOS-pcsd](https://github.com/matt1432/nixos-pcsd) to form a cluster with its twin | +| `thingtwo` | Lenovo ThinkCentre M900 | Mini PC that makes use of [NixOS-pcsd](https://github.com/matt1432/nixos-pcsd) to form a cluster with its twin | +| `wim` | ThinkPad L13 Yoga Gen 3 (Ryzen 7 PRO 5875U) | 2-1 Lenovo Laptop that I use for university | diff --git a/configurations/bbsteamie/default.nix b/configurations/bbsteamie/default.nix index 9cfb83f4..dc1a6939 100644 --- a/configurations/bbsteamie/default.nix +++ b/configurations/bbsteamie/default.nix @@ -13,6 +13,7 @@ self.nixosModules.base self.nixosModules.kmscon + self.nixosModules.meta self.nixosModules.plymouth self.nixosModules.server ]; @@ -41,6 +42,11 @@ # ------------------------------------------------ # `Self` Modules configuration # ------------------------------------------------ + meta = { + roleDescription = "My wife's SteamDeck that has a pink case (it took a lot of convincing for this)"; + hardwareDescription = "512GB OLED"; + }; + roles.base = { enable = true; user = mainUser; diff --git a/configurations/binto/default.nix b/configurations/binto/default.nix index f079a241..75e7ca50 100644 --- a/configurations/binto/default.nix +++ b/configurations/binto/default.nix @@ -14,6 +14,7 @@ self.nixosModules.base self.nixosModules.desktop self.nixosModules.kmscon + self.nixosModules.meta self.nixosModules.server ]; @@ -49,6 +50,11 @@ # ------------------------------------------------ # `Self` Modules configuration # ------------------------------------------------ + meta = { + roleDescription = "Desktop PC with a multi-monitor setup"; + hardwareDescription = "NVIDIA 3070 with Ryzen 7 3700X"; + }; + roles.base = { enable = true; user = mainUser; diff --git a/configurations/cluster/default.nix b/configurations/cluster/default.nix index 086da208..71b88595 100644 --- a/configurations/cluster/default.nix +++ b/configurations/cluster/default.nix @@ -16,6 +16,7 @@ in { self.nixosModules.base self.nixosModules.kmscon + self.nixosModules.meta self.nixosModules.server ]; @@ -53,6 +54,14 @@ in { # ------------------------------------------------ # `Self` Modules configuration # ------------------------------------------------ + meta = { + roleDescription = '' + Mini PC that makes use of [NixOS-pcsd](https://github.com/matt1432/nixos-pcsd) + to form a cluster with its twin. Files located in `cluster` + ''; + hardwareDescription = "Lenovo ThinkCentre M900"; + }; + roles.base = { enable = true; user = mainUser; diff --git a/configurations/homie/default.nix b/configurations/homie/default.nix index 58fa48ba..3dad18ff 100644 --- a/configurations/homie/default.nix +++ b/configurations/homie/default.nix @@ -14,6 +14,7 @@ self.nixosModules.base self.nixosModules.docker self.nixosModules.kmscon + self.nixosModules.meta self.nixosModules.server ]; @@ -42,6 +43,11 @@ # ------------------------------------------------ # `Self` Modules configuration # ------------------------------------------------ + meta = { + roleDescription = "Mini PC that serves as a Home-assistant server"; + hardwareDescription = "Lenovo Thinkcentre M910q"; + }; + roles.base = { enable = true; user = mainUser; diff --git a/configurations/live-image/default.nix b/configurations/live-image/default.nix index dea23623..0d66695b 100644 --- a/configurations/live-image/default.nix +++ b/configurations/live-image/default.nix @@ -11,12 +11,18 @@ "${nixpkgs}/nixos/modules/installer/cd-dvd/installation-cd-minimal.nix" self.nixosModules.base + self.nixosModules.meta self.nixosModules.server ]; # ------------------------------------------------ # `Self` Modules configuration # ------------------------------------------------ + meta = { + roleDescription = "Basic configuration that serves as my custom ISO target"; + hardwareDescription = "USB key"; + }; + roles.base = { enable = true; user = mainUser; diff --git a/configurations/nos/default.nix b/configurations/nos/default.nix index db5227ca..3a8b4afa 100644 --- a/configurations/nos/default.nix +++ b/configurations/nos/default.nix @@ -14,6 +14,7 @@ self.nixosModules.base self.nixosModules.docker self.nixosModules.kmscon + self.nixosModules.meta self.nixosModules.server ]; @@ -43,6 +44,11 @@ # ------------------------------------------------ # `Self` Modules configuration # ------------------------------------------------ + meta = { + roleDescription = "Custom built NAS and seedbox for Linux ISOs ;)"; + hardwareDescription = "NVIDIA 3060 with i5-3600"; + }; + roles.base = { enable = true; user = mainUser; diff --git a/configurations/servivi/default.nix b/configurations/servivi/default.nix index d6d4bb6a..a2d9cc13 100644 --- a/configurations/servivi/default.nix +++ b/configurations/servivi/default.nix @@ -14,6 +14,7 @@ self.nixosModules.base self.nixosModules.docker self.nixosModules.kmscon + self.nixosModules.meta self.nixosModules.server ]; @@ -56,6 +57,11 @@ # ------------------------------------------------ # `Self` Modules configuration # ------------------------------------------------ + meta = { + roleDescription = "Gaming PC in a previous life, it is now used as a build farm and hosts game servers"; + hardwareDescription = "Headless Ryzen 5 3600"; + }; + roles.base = { enable = true; user = mainUser; diff --git a/configurations/wim/default.nix b/configurations/wim/default.nix index 837dee6a..f3bc6d74 100644 --- a/configurations/wim/default.nix +++ b/configurations/wim/default.nix @@ -16,6 +16,7 @@ self.nixosModules.desktop self.nixosModules.docker self.nixosModules.kmscon + self.nixosModules.meta self.nixosModules.plymouth self.nixosModules.server ]; @@ -59,6 +60,11 @@ # ------------------------------------------------ # `Self` Modules configuration # ------------------------------------------------ + meta = { + roleDescription = "2-1 Lenovo Laptop that I use for university"; + hardwareDescription = "ThinkPad L13 Yoga Gen 3 (Ryzen 7 PRO 5875U)"; + }; + roles.base = { enable = true; user = mainUser; diff --git a/modules/default.nix b/modules/default.nix index cc709afe..cbbc01a9 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -9,6 +9,7 @@ self: { ha-plus = import ./ha-plus; kmscon = import ./kmscon; nvidia = import ./nvidia; + meta = import ./meta; plymouth = import ./plymouth; server = import ./server; tmux = import ./tmux; diff --git a/modules/meta/default.nix b/modules/meta/default.nix new file mode 100644 index 00000000..654e2e82 --- /dev/null +++ b/modules/meta/default.nix @@ -0,0 +1,15 @@ +{lib, ...}: let + inherit (lib) mkOption types; +in { + options.meta = { + roleDescription = mkOption { + type = types.str; + default = ""; + }; + + hardwareDescription = mkOption { + type = types.str; + default = ""; + }; + }; +}