feat: refactor flake.nix

This commit is contained in:
Ryan Yin
2023-12-20 00:48:30 +08:00
parent 809a68fa27
commit 29511fa574
28 changed files with 416 additions and 422 deletions

View File

@@ -11,16 +11,9 @@
#############################################################
{
imports = [
{
nixpkgs.crossSystem = {
config = "aarch64-unknown-linux-gnu";
};
}
# import the rk3588 module, which contains the configuration for bootloader/kernel/firmware
(nixos-rk3588 + "/modules/boards/orangepi5.nix")
../../../modules/nixos/server-riscv64.nix
];
users.users.root.openssh.authorizedKeys.keys = config.users.users."${username}".openssh.authorizedKeys.keys;

View File

@@ -7,14 +7,6 @@
let
hostname = "harmonica";
in {
imports = [
../../modules/darwin
../../secrets/darwin.nix
];
nixpkgs.overlays = import ../../overlays args;
networking.hostName = hostname;
networking.computerName = hostname;
system.defaults.smb.NetBIOSName = hostname;

View File

@@ -1,6 +1,5 @@
{
config,
pkgs,
username,
...
}: {

View File

@@ -1,4 +1,3 @@
{lanzaboote, ...} @ args:
#############################################################
#
# Ai - my main computer, with NixOS + I5-13600KF + RTX 4090 GPU, for gaming & daily use.
@@ -12,12 +11,8 @@
./impermanence.nix
./secureboot.nix
../../../secrets/nixos.nix
];
nixpkgs.overlays = import ../../../overlays args;
networking = {
hostName = "ai";
wireless.enable = false; # Enables wireless support via wpa_supplicant.

View File

@@ -1,18 +1,9 @@
args:
#############################################################
#
# Aquamarine - A NixOS VM running on Proxmox
#
#############################################################
{
imports = [
../../../modules/nixos/proxmox-hardware-configuration.nix
../../../modules/nixos/server.nix
];
nixpkgs.overlays = import ../../../overlays args;
# Enable binfmt emulation of aarch64-linux, this is required for cross compilation.
boot.binfmt.emulatedSystems = ["aarch64-linux" "riscv64-linux"];
# supported fil systems, so we can mount any removable disks with these filesystems

View File

@@ -1,18 +1,9 @@
args:
#############################################################
#
# Kana - a NixOS VM running on Proxmox
#
#############################################################
{
imports = [
../../../modules/nixos/proxmox-hardware-configuration.nix
../../../modules/nixos/server.nix
];
nixpkgs.overlays = import ../../../overlays args;
# Enable binfmt emulation of aarch64-linux, this is required for cross compilation.
boot.binfmt.emulatedSystems = ["aarch64-linux" "riscv64-linux"];
# supported fil systems, so we can mount any removable disks with these filesystems

View File

@@ -1,18 +1,9 @@
args:
#############################################################
#
# Ruby - a NixOS VM running on Proxmox
#
#############################################################
{
imports = [
../../../modules/nixos/proxmox-hardware-configuration.nix
../../../modules/nixos/server.nix
];
nixpkgs.overlays = import ../../../overlays args;
# Enable binfmt emulation of aarch64-linux, this is required for cross compilation.
boot.binfmt.emulatedSystems = ["aarch64-linux" "riscv64-linux"];
# supported fil systems, so we can mount any removable disks with these filesystems

View File

@@ -1,9 +1,7 @@
{
config,
username,
# nixos-jh7110,
...
} @ args:
}:
#############################################################
#
# Chiaya - NixOS Configuration for Milk-V Mars
@@ -13,20 +11,8 @@
#############################################################
{
imports = [
{
# cross-compilation this flake.
nixpkgs.crossSystem = {
system = "riscv64-linux";
};
}
# TODO
../../../modules/nixos/server-riscv64.nix
];
users.users.root.openssh.authorizedKeys.keys = config.users.users."${username}".openssh.authorizedKeys.keys;
# Set static IP address / gateway / DNS servers.
networking = {
hostName = "chiaya"; # Define your hostname.
@@ -64,5 +50,5 @@
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "23.11"; # Did you read the comment?
system.stateVersion = "23.05"; # Did you read the comment?
}

View File

@@ -1,9 +1,4 @@
{
config,
username,
nixos-licheepi4a,
...
} @ args:
{nixos-licheepi4a, ...}:
#############################################################
#
# Nozomi - NixOS configuration for Lichee Pi 4A
@@ -11,23 +6,12 @@
#############################################################
{
imports = [
{
# cross-compilation this flake.
nixpkgs.crossSystem = {
system = "riscv64-linux";
};
}
# import the licheepi4a module, which contains the configuration for bootloader/kernel/firmware
(nixos-licheepi4a + "/modules/licheepi4a.nix")
# import the sd-image module, which contains the fileSystems & kernel parameters for booting from sd card.
(nixos-licheepi4a + "/modules/sd-image/sd-image-lp4a.nix")
../../../modules/nixos/server-riscv64.nix
];
users.users.root.openssh.authorizedKeys.keys = config.users.users."${username}".openssh.authorizedKeys.keys;
# Set static IP address / gateway / DNS servers.
networking = {
hostName = "nozomi"; # Define your hostname.
@@ -97,5 +81,5 @@
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "23.11"; # Did you read the comment?
system.stateVersion = "23.05"; # Did you read the comment?
}

View File

@@ -1,9 +1,4 @@
{
config,
username,
nixos-licheepi4a,
...
} @ args:
{nixos-licheepi4a, ...}:
#############################################################
#
# Yukina - NixOS configuration for Lichee Pi 4A
@@ -11,23 +6,12 @@
#############################################################
{
imports = [
{
# cross-compilation this flake.
nixpkgs.crossSystem = {
system = "riscv64-linux";
};
}
# import the licheepi4a module, which contains the configuration for bootloader/kernel/firmware
(nixos-licheepi4a + "/modules/licheepi4a.nix")
# import the sd-image module, which contains the fileSystems & kernel parameters for booting from sd card.
(nixos-licheepi4a + "/modules/sd-image/sd-image-lp4a.nix")
../../../modules/nixos/server-riscv64.nix
];
users.users.root.openssh.authorizedKeys.keys = config.users.users."${username}".openssh.authorizedKeys.keys;
# Set static IP address / gateway / DNS servers.
networking = {
hostName = "yukina"; # Define your hostname.
@@ -97,5 +81,5 @@
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "23.11"; # Did you read the comment?
system.stateVersion = "23.05"; # Did you read the comment?
}