refactor: hosts

This commit is contained in:
Ryan Yin committed 2024-01-21 15:21:05 +08:00
1 parent 489f82f24b
commit a76daab3ce
32 files changed
+34 -34

No files matched your search

+1 -1
View File
@@ -85,7 +85,7 @@ See [./secrets](./secrets) for details.
## How to Deploy this Flake?
> :red_circle: **IMPORTANT**: **You should NOT deploy this flake directly on your machine:exclamation: It will not succeed.** this flake contains my hardware configuration(such as [hardware-configuration.nix](hosts/idols/ai/hardware-configuration.nix), [cifs-mount.nix](https://github.com/ryan4yin/nix-config/blob/v0.1.1/hosts/idols/ai/cifs-mount.nix), [Nvidia Support](https://github.com/ryan4yin/nix-config/blob/v0.1.1/hosts/idols/ai/default.nix#L77-L91), etc.) which is not suitable for your hardware, and my private secrets repository [ryan4yin/nix-secrets](https://github.com/ryan4yin/nix-config/tree/main/secrets) that only I have access to. You may use this repo as a reference to build your own configuration.
> :red_circle: **IMPORTANT**: **You should NOT deploy this flake directly on your machine:exclamation: It will not succeed.** this flake contains my hardware configuration(such as [hardware-configuration.nix](hosts/idols_ai/hardware-configuration.nix), [cifs-mount.nix](https://github.com/ryan4yin/nix-config/blob/v0.1.1/hosts/idols_ai/cifs-mount.nix), [Nvidia Support](https://github.com/ryan4yin/nix-config/blob/v0.1.1/hosts/idols_ai/default.nix#L77-L91), etc.) which is not suitable for your hardware, and my private secrets repository [ryan4yin/nix-secrets](https://github.com/ryan4yin/nix-config/tree/main/secrets) that only I have access to. You may use this repo as a reference to build your own configuration.
For NixOS:
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+6 -6
View File
@@ -1,10 +1,10 @@
# Nix Environment Setup for Host: Idols - Ai
This flake prepares a Nix environment for setting my desktop [/hosts/idols/ai](/hosts/idols/ai/)(in main flake) up on a new machine.
This flake prepares a Nix environment for setting my desktop [/hosts/idols_ai](/hosts/idols_ai/)(in main flake) up on a new machine.
Other docs:
- README for [/hosts/12kingdoms/shoukei](/hosts/12kingdoms/shoukei): [./README.shoukei.md](./README.shoukei.md)
- README for [/hosts/12kingdoms_shoukei](/hosts/12kingdoms_shoukei): [./README.shoukei.md](./README.shoukei.md)
TODOs:
@@ -184,14 +184,14 @@ Then, generate the NixOS configuration:
nixos-generate-config --root /mnt
# we need to update our filesystem configs in old hardware-configuration.nix according to the generated one.
cp /etc/nixos/hardware-configuration.nix ./nix-config/hosts/idols/ai/hardware-configuration-new.nix
cp /etc/nixos/hardware-configuration.nix ./nix-config/hosts/idols_ai/hardware-configuration-new.nix
vim .
```
Then, Install NixOS:
```bash
cd ~/nix-config/hosts/idols/ai/nixos-installer
cd ~/nix-config/hosts/idols_ai/nixos-installer
# run this command if you're retrying to run nixos-install
rm -rf /mnt/etc
@@ -220,7 +220,7 @@ mv /etc/ssh /persistent/etc/
# delte the generated configuration after editing
rm -f /mnt/etc/nixos
rm ~/nix-config/hosts/idols/ai/hardware-configuration-new.nix
rm ~/nix-config/hosts/idols_ai/hardware-configuration-new.nix
# NOTE: `cat shoukei.md | grep git-1 > git-1.sh` to generate this script
# commit the changes after installing nixos successfully
@@ -259,4 +259,4 @@ cd ~/nix-config
just hypr
```
Finally, to enable secure boot, follow the instructions in [lanzaboote - Quick Start](https://github.com/nix-community/lanzaboote/blob/master/docs/QUICK_START.md) and [nix-config/ai/secure-boot.nix](https://github.com/ryan4yin/nix-config/blob/main/hosts/idols/ai/secureboot.nix)
Finally, to enable secure boot, follow the instructions in [lanzaboote - Quick Start](https://github.com/nix-community/lanzaboote/blob/master/docs/QUICK_START.md) and [nix-config/ai/secure-boot.nix](https://github.com/ryan4yin/nix-config/blob/main/hosts/idols_ai/secureboot.nix)
+6 -6
View File
@@ -4,7 +4,7 @@
> https://github.com/NixOS/nixos-hardware/tree/master/apple/t2
This flake prepares a Nix environment for setting my desktop [/hosts/12kingdoms/shoukei](/hosts/12kingdoms/shoukei)(in main flake) up on a new machine.
This flake prepares a Nix environment for setting my desktop [/hosts/12kingdoms_shoukei](/hosts/12kingdoms_shoukei)(in main flake) up on a new machine.
## Steps to Deploying
@@ -17,7 +17,7 @@ First, create a USB install medium from Apple T2's NixOS installer image: https:
```bash
sudo mkdir -p /lib
sudo tar -axvf ../hosts/12kingdoms/shoukei/brcm-firmware/firmware.tar.gz -C /lib/
sudo tar -axvf ../hosts/12kingdoms_shoukei/brcm-firmware/firmware.tar.gz -C /lib/
sudo modprobe -r brcmfmac && sudo modprobe brcmfmac
# check whether the wifi firmware is loaded
@@ -164,14 +164,14 @@ Then, generate the NixOS configuration:
nixos-generate-config --root /mnt
# we need to update our filesystem configs in old hardware-configuration.nix according to the generated one.
cp /etc/nixos/hardware-configuration.nix ./nix-config/hosts/12kingdoms/shoukei/hardware-configuration-new.nix
cp /etc/nixos/hardware-configuration.nix ./nix-config/hosts/12kingdoms_shoukei/hardware-configuration-new.nix
vim .
```
Then, Install NixOS:
```bash
cd ~/nix-config/hosts/12kingdoms/shoukei/nixos-installer/
cd ~/nix-config/hosts/12kingdoms_shoukei/nixos-installer/
# run this command if you're retrying to run nixos-install
rm -rf /mnt/etc
@@ -201,7 +201,7 @@ mv /etc/ssh /persistent/etc/
# delte the generated configuration after editing
rm -f /mnt/etc/nixos
rm ~/nix-config/hosts/idols/ai/hardware-configuration-new.nix
rm ~/nix-config/hosts/idols_ai/hardware-configuration-new.nix
# NOTE: `cat shoukei.md | grep git-1 > git-1.sh` to generate this script
# commit the changes after installing nixos successfully
@@ -239,4 +239,4 @@ cd ~/nix-config
just s-hypr
```
Finally, to enable secure boot, follow the instructions in [lanzaboote - Quick Start](https://github.com/nix-community/lanzaboote/blob/master/docs/QUICK_START.md) and [nix-config/ai/secure-boot.nix](https://github.com/ryan4yin/nix-config/blob/main/hosts/idols/ai/secureboot.nix)
Finally, to enable secure boot, follow the instructions in [lanzaboote - Quick Start](https://github.com/nix-community/lanzaboote/blob/master/docs/QUICK_START.md) and [nix-config/ai/secure-boot.nix](https://github.com/ryan4yin/nix-config/blob/main/hosts/idols_ai/secureboot.nix)
+4 -4
View File
@@ -26,8 +26,8 @@
../modules/nixos/base/user-group.nix
../modules/nixos/base/networking.nix
../hosts/idols/ai/hardware-configuration.nix
../hosts/idols/ai/impermanence.nix
../hosts/idols_ai/hardware-configuration.nix
../hosts/idols_ai/impermanence.nix
];
};
@@ -51,8 +51,8 @@
../modules/nixos/base/user-group.nix
../modules/nixos/base/networking.nix
../hosts/12kingdoms/shoukei/hardware-configuration.nix
../hosts/12kingdoms/shoukei/impermanence.nix
../hosts/12kingdoms_shoukei/hardware-configuration.nix
../hosts/12kingdoms_shoukei/impermanence.nix
];
};
};
+17 -17
View File
@@ -13,13 +13,13 @@ in {
idol_ai_modules_i3 = {
nixos-modules =
[
../hosts/idols/ai
../hosts/idols_ai
{modules.desktop.xorg.enable = true;}
]
++ desktop_base_modules.nixos-modules;
home-module.imports =
[
../hosts/idols/ai/home.nix
../hosts/idols_ai/home.nix
{modules.desktop.i3.enable = true;}
]
++ desktop_base_modules.home-module.imports;
@@ -28,13 +28,13 @@ in {
idol_ai_modules_hyprland = {
nixos-modules =
[
../hosts/idols/ai
../hosts/idols_ai
{modules.desktop.wayland.enable = true;}
]
++ desktop_base_modules.nixos-modules;
home-module.imports =
[
../hosts/idols/ai/home.nix
../hosts/idols_ai/home.nix
{modules.desktop.hyprland.enable = true;}
]
++ desktop_base_modules.home-module.imports;
@@ -43,12 +43,12 @@ in {
# 星野 愛久愛海, Hoshino Akuamarin
idol_aquamarine_modules = {
nixos-modules = [
../hosts/idols/aquamarine
../hosts/idols_aquamarine
../modules/nixos/server.nix
../modules/nixos/proxmox-hardware-configuration.nix
];
home-module.imports = [
../hosts/idols/aquamarine/home.nix
../hosts/idols_aquamarine/home.nix
../home/linux/server.nix
];
};
@@ -57,12 +57,12 @@ in {
# 星野 瑠美衣, Hoshino Rubii
idol_ruby_modules = {
nixos-modules = [
../hosts/idols/ruby
../hosts/idols_ruby
../modules/nixos/server.nix
../modules/nixos/proxmox-hardware-configuration.nix
];
home-module.imports = [
../hosts/idols/ruby/home.nix
../hosts/idols_ruby/home.nix
../home/linux/server.nix
];
};
@@ -71,12 +71,12 @@ in {
# 有馬 かな, Arima Kana
idol_kana_modules = {
nixos-modules = [
../hosts/idols/kana
../hosts/idols_kana
../modules/nixos/server.nix
../modules/nixos/proxmox-hardware-configuration.nix
];
home-module.imports = [
../hosts/idols/kana/home.nix
../hosts/idols_kana/home.nix
../home/linux/server.nix
];
};
@@ -85,7 +85,7 @@ in {
# 森友 望未, Moritomo Nozomi
rolling_nozomi_modules = {
nixos-modules = [
../hosts/rolling_girls/nozomi
../hosts/rolling_girls_nozomi
../modules/nixos/server-riscv64.nix
# cross-compilation this flake.
@@ -98,7 +98,7 @@ in {
# 小坂 結季奈, Kosaka Yukina
rolling_yukina_modules = {
nixos-modules = [
../hosts/rolling_girls/yukina
../hosts/rolling_girls_yukina
../modules/nixos/server-riscv64.nix
# cross-compilation this flake.
@@ -111,7 +111,7 @@ in {
# 大木 鈴, Ōki Suzu
_12kingdoms_suzu_modules = {
nixos-modules = [
../hosts/12kingdoms/suzu
../hosts/12kingdoms_suzu
../modules/nixos/server-riscv64.nix
# cross-compilation this flake.
@@ -125,13 +125,13 @@ in {
_12kingdoms_shoukei_modules_i3 = {
nixos-modules =
[
../hosts/12kingdoms/shoukei
../hosts/12kingdoms_shoukei
{modules.desktop.xorg.enable = true;}
]
++ desktop_base_modules.nixos-modules;
home-module.imports =
[
../hosts/12kingdoms/shoukei/home.nix
../hosts/12kingdoms_shoukei/home.nix
{modules.desktop.i3.enable = true;}
]
++ desktop_base_modules.home-module.imports;
@@ -140,13 +140,13 @@ in {
_12kingdoms_shoukei_modules_hyprland = {
nixos-modules =
[
../hosts/12kingdoms/shoukei
../hosts/12kingdoms_shoukei
{modules.desktop.wayland.enable = true;}
]
++ desktop_base_modules.nixos-modules;
home-module.imports =
[
../hosts/12kingdoms/shoukei/home.nix
../hosts/12kingdoms_shoukei/home.nix
{modules.desktop.hyprland.enable = true;}
]
++ desktop_base_modules.home-module.imports;