flake/README.org

69 lines
4.3 KiB
Org Mode
Raw Permalink Normal View History

#+title: Flake Readme
#+author: Zonsopkomst
#+date: 2022-11-30
2023-11-13 20:49:48 +01:00
* My NixOS Configuraton File
This is my NixOS setup to manage multiple computers with a home-manager config structure using nix flakes.
2023-11-13 21:28:42 +01:00
** Current Desktop Screenshots:
*** Gnome
2023-11-13 20:59:28 +01:00
#+caption: Gnome
2023-11-13 21:29:23 +01:00
#+attr_org: :width 200
2023-11-13 21:25:57 +01:00
[[Gnome][https://git.disroot.org/Zonsopkomst/flake/raw/branch/working/reference/assets/20231102NixOSTyr3.png]]
2023-11-13 21:28:42 +01:00
** Emacs
2023-11-13 21:25:57 +01:00
#+caption: Emacs
2023-11-13 21:29:23 +01:00
#+attr_org: :width 200
2023-11-13 21:11:16 +01:00
[[Gnome][https://git.disroot.org/Zonsopkomst/flake/raw/branch/working/reference/assets/20231102NixOSTyr.png]]
2023-11-13 21:07:48 +01:00
2023-11-13 20:49:48 +01:00
** Highlights:
2023-11-13 20:54:19 +01:00
*** Multiple NixOS configurations: desktop, laptop, and hopefully a test server and eventually a full transition over from my Ubuntu server.
2023-11-13 20:59:28 +01:00
** How to:
#+caption: South Park
#+attr_org: :width 500
2023-11-13 20:49:48 +01:00
[[Process][https://git.disroot.org/Zonsopkomst/flake/raw/branch/working/reference/assets/underpants-gnomes.png]]
1. NixOS Installation
2023-11-13 21:14:36 +01:00
1. Install NixOS on a computer using the default Gnome installer from [https://nixos.org/download.html].
1. Clone this repository [https://git.disroot.org/zonsopkomst] in the `/home/<username>/ directory.
1. Update the subdirectories in `hosts` and `users`.
1. Copy the `configuration.nix` and `hardware-configuration.nix` files from the `/etc/nixos` directory and move them to `hosts/PLACE(local OR remote)/NEW_PC_NAME`.
1. Rename `configuration.nix` to `default.nix` and, update `flake.nix` located in the top directory, link the appropriate modules to be used.
2. Segment out items from new `default.nix` to appropriate `.nix` files.
3. Make sure the correct version of NixOS is listed in the appropriate files.
2. `flake.nix` is where `.nix` files are imported with further instructions on declared packages and modules.
1. Declare packages either globally under `/hosts/<location>/hostname/packages.nix` or `/users/<username>/home-manager.nix`.
3. Rebuild NixOS *(<hostname> must be include the first time rebuilding, after the first rebuild, .# can be used and the system will know which hostname is to be used)*
2023-11-13 20:53:19 +01:00
1. `nix flake --update && nixos-rebuild switch --flake .#<hostname>`
4. Push the updated git files to the repository so that they can be pulled, and the system rebuilt during the next update.
2023-11-13 20:49:48 +01:00
*** Maintenance
1. See `/config/.bashrc` for `alias`: `flkup` using `sudo nixos-rebuild switch --flake .#<hostname>` commands and other useful items
2023-11-13 20:49:48 +01:00
*** Sources
2023-11-13 21:14:36 +01:00
**** Nix Flakes: [https://nixos.wiki/wiki/Flakes]
**** home-manager: [https://github.com/nix-community/home-manager]
***** Home Manager as a NixOS Module: [https://nix-community.github.io/home-manager/index.html#sec-flakes-nixos-module]
2023-11-13 20:49:48 +01:00
** Structure
| Directory | What is it for? |
| common | Shared configurations and modules |
| config | Config files that are managed by NixOS |
| desktop | Shared desktop configs |
| display | Login Display managers |
| hosts | The PCs deployed |
| reference | Package list, git assets, notes, etc. |
| users | Individual User configs |
| flake.nix & flake.lock | Declared configuration using the above directories & configs |
** Hosts
2023-11-30 02:54:32 +01:00
| Hostname | Model | Type | RAM | Processor | Main Use |
| weda | Dell Inspiron 15 | Laptop | 16GB | AMD Ryzen 5 (Cezanne) | Business |
| frija | Acer Aspire 3 | Laptop | 4GB | AMD A9 | Testing |
| tyr | Intel i5 | Desktop | 16GB | Intel i5 | Media |
| tii | Dell Lattitude 5511 | Laptop | 16GB | Intel i5 Quad (i5-10400H) | Remote |
| tuisto | AMD Ryzen 5 | Desktop | 16GB | AMD Ryzen 5 (Renoir) | Remote |
| sintanne | Intel i5 | Desktop | 16GB | Intel i5-11320H | Remote |
| thuner | AMD Ryzen 5 | Server | ??GB | AMD 2200G | Test Server |
| fryslan (Ubuntu) | AMD Ryzen 5 | Server | ??GB | AMD 2200G | Main Server |