asgard

> [!IMPORTANT] > This configuration is under constant construction so some things may be remove or add accordings to my needs but i want to keep all even if it's not used anymore. > > Since this configuration is made for my own needs, you can take inspiration and some configuration but do not expect it to work on your side. > > Any damage caused by this configuration is not my responsibility, so use it at your own risks. ## Table of Contents - [Features & Capabilities](#features--capabilities) - [Machines](#machines) - [Installation](#installation) - [Folder Structure](#folder-structure) - [Commands](#commands) - [Documentations](#documentations) - [Troubleshooting](#troubleshooting) ## Features & Capabilities This repository want this to be multi-user and multi-host so there is some workaround to make things work like i want and keep it simple. - [x] NixOS - [x] Nix Darwin - [ ] WSL (not used anymore) - [ ] Nix BSD (in wait of a stable state to be used anywhere else than a vm) - [ ] MicroVM for servers (astro/microvm) - [ ] Secrets management (agenix) - [ ] Secure Boot (lanzaboot) - [ ] Persistant storage (impermanence) - [ ] Disk configuration (disko) - [ ] Encrypted disks (?) - [ ] Home management (hjem) - [-] Automatic updates (*cannot be entirely done, since tangled does not support pipeline based on time.*) - Network topology (nix-topology) ## Installation > TODO: write the documentation to install easely a new host with a few steps ## Machines | Hostname | Motherboard | CPU | GPU | RAM | OS | Usage | Status | | :------------- | :-------------------------------- | :------------------- | :------------ | :--: | :-: | :------: | :----: | | `andhrimnir` | Aorus B450 Elite | AMD Ryzen 3 3300X | Nvidia 1060 | 16Go | โ„๏ธ | ๐Ÿ–ฅ๏ธ - ๐ŸŽฎ๏ธ | ๐ŸŸข๏ธ | | `elli` | HP ProDesk 400 G1 DM | Intel Pentium G3250T | - | 8Go | โ„๏ธ | ๐Ÿ’พ๏ธ | ๐ŸŸ  | | `loki` | ASUS ROG STRIX B760-I GAMING WIFI | Intel i5 13600kf | Nvidia 4070ti | 32Go | โ„๏ธ | ๐ŸŽฎ๏ธ | ๐ŸŸข๏ธ | | `nanna` | Lenovo Legion Y530 15ICH | Intel i5 | Nvidia 1050ti | 16Go | โ„๏ธ | ๐Ÿ–ฅ๏ธ - ๐ŸŽฎ๏ธ | ๐ŸŸข๏ธ | | `njord` | - | Apple M2 Pro | Apple M2 Pro | 32Go | ๐ŸŽ๏ธ | ๐Ÿ–ฅ๏ธ | ๐ŸŸข๏ธ | | `sunna` | ASUS ROG STRIX G15 | Intel i7 10870H | Nvidia 2060 | 16Go | โ„๏ธ | ๐Ÿ–ฅ๏ธ | ๐Ÿ”ด | | `syn` | Raspberry Pi3 b+ | - | - | 1Go | โ„๏ธ | ๐Ÿ’พ๏ธ | ๐Ÿ”ด | | `vali` | WSL | - | - | - | โ„๏ธ | ๐Ÿ’พ๏ธ | ๐Ÿ”ด |
Annotations - ๐ŸŽฎ๏ธ : Gamingstation - ๐Ÿ’พ๏ธ : Server - โ˜๏ธ : Virtual Machime - ๐Ÿ–ฅ๏ธ : Workstation - ๐Ÿงจ๏ธ : Testing purpose - โ„๏ธ : NixOS - ๐ŸŽ๏ธ : MacOS - ๐Ÿ‘น๏ธ : FreeBSD with [NixBSD](https://github.com/nixos-bsd/nixbsd)
## Folder structure This repository use a `dentritic pattern` to make everything work with ease. With this pattern, every file is a modules (modules, configurations, ...), so everything needs to be inside the modules folders and imported as it. The only things not treated as it are the custom packages inside the packages folder. > [!NOTE] > This is my current idea of what will look the folders, it can change in the future. ``` . โ”œโ”€โ”€ modules/ โ”‚ โ”œโ”€โ”€ features/ # Feature definitions โ”‚ โ”œโ”€โ”€ hjem/ # Hjem modules (not using flake-parts modules) โ”‚ โ”œโ”€โ”€ hosts/ # machines configurations โ”‚ โ”œโ”€โ”€ lib/ # Custom library (mostly factories) โ”‚ โ”œโ”€โ”€ packages/ # Custom packages derivations (per-system) โ”‚ โ”œโ”€โ”€ tools/ # Basic tools configurations (flake-parts, hjem, impermanence, ...) โ”‚ โ”œโ”€โ”€ users/ # Users configurations โ”‚ โ””โ”€โ”€ default.nix # Modules entrypoint with auto-import โ”œโ”€โ”€ secrets/ # Secrets files used by agenix โ”‚ โ””โ”€โ”€ secrets.nix # Secrets entrypoint โ”œโ”€โ”€ flake.nix # Configuration entrypoint โ””โ”€โ”€ justfile # Command helper ``` ## Commands You can get all recipes using the `just` command and running one of the available commands below with `just `: ```sh Available recipes: boot hostname=hostname # Build a new configuration clean # Cleanup all unused packages and generations format # Format code size # Print size of the nix store switch hostname=hostname # Rebuild the system update # Update dependencies ``` ## Documentations These are the things that help me the most to understand Nix ecosystem and help me build my configuration from scratch. You can retrieve dotfiles that inspired me inside my [`dotfiles` star list](https://github.com/stars/Cosmeak/lists/useful-dotfiles). - [Flakes book](https://nixos-and-flakes.thiscute.world/) - [Nix Language](https://nix.dev/) - [Nix Tour](https://nixcloud.io/tour/?id=introduction/nix) - [Dentritic Pattern explanation](https://github.com/Doc-Steve/dendritic-design-with-flake-parts) ## Troubleshooting - If the rebuild command failed because an experimental feature is disabled use this command: ```sh sudo -E NIX_CONFIG="experimental-features = nix-command flakes pipe-operators" nixos-rebuild switch --flake . ```