refactor: Use haumea for filesystem-based module system for flake outputs

refactor: Use hyphen(`-`) for variable names & folder names(except Python), replace all unserscore(`_`) with hyphen(`-`).
This commit is contained in:
Ryan Yin
2024-03-09 01:32:58 +08:00
parent d7738efed2
commit b382999a70
167 changed files with 1570 additions and 955 deletions
@@ -1,7 +1,7 @@
{
disko,
nixos-rk3588,
vars_networking,
myvars,
...
}:
#############################################################
@@ -11,7 +11,7 @@
#############################################################
let
hostName = "rakushun"; # Define your hostname.
hostAddress = vars_networking.hostAddress.${hostName};
hostAddress = myvars.networking.hostAddress.${hostName};
in {
imports = [
# import the rk3588 module, which contains the configuration for bootloader/kernel/firmware
@@ -24,7 +24,7 @@ in {
networking = {
inherit hostName;
inherit (vars_networking) defaultGateway nameservers;
inherit (myvars.networking) defaultGateway nameservers;
networkmanager.enable = false;
# RJ45 port 1
@@ -1,6 +1,6 @@
{
nixos-hardware,
vars_networking,
myvars,
...
}:
#############################################################
@@ -18,7 +18,7 @@ in {
{hardware.myapple-t2.enableAppleSetOsLoader = true;}
./hardware-configuration.nix
../idols_ai/impermanence.nix
../idols-ai/impermanence.nix
];
boot.kernelModules = ["kvm-amd"];
@@ -26,7 +26,7 @@ in {
networking = {
inherit hostName;
inherit (vars_networking) defaultGateway nameservers;
inherit (myvars.networking) defaultGateway nameservers;
# configures the network interface(include wireless) via `nmcli` & `nmtui`
networkmanager.enable = true;
@@ -53,11 +53,10 @@
# whether to allow TRIM requests to the underlying device.
# it's less secure, but faster.
allowDiscards = true;
# Whether to bypass dm-crypts internal read and write workqueues.
# Enabling this should improve performance on SSDs;
# Whether to bypass dm-crypts internal read and write workqueues.
# Enabling this should improve performance on SSDs;
# https://wiki.archlinux.org/index.php/Dm-crypt/Specialties#Disable_workqueue_for_increased_solid_state_drive_(SSD)_performance
bypassWorkqueues = true;
};
};
@@ -1,7 +1,7 @@
{
disko,
nixos-rk3588,
vars_networking,
myvars,
...
}:
#############################################################
@@ -11,7 +11,7 @@
#############################################################
let
hostName = "suzu"; # Define your hostname.
hostAddress = vars_networking.hostAddress.${hostName};
hostAddress = myvars.networking.hostAddress.${hostName};
in {
imports = [
# import the rk3588 module, which contains the configuration for bootloader/kernel/firmware
@@ -24,7 +24,7 @@ in {
networking = {
inherit hostName;
inherit (vars_networking) defaultGateway nameservers;
inherit (myvars.networking) defaultGateway nameservers;
networkmanager.enable = false;
interfaces.end1 = {
@@ -1,4 +1,8 @@
{vars_networking, mylib, ...}:
{
myvars,
mylib,
...
}:
#############################################################
#
# Tailscale Gateway(homelab subnet router) - a NixOS VM running on Proxmox
@@ -6,7 +10,7 @@
#############################################################
let
hostName = "tailscale-gw"; # Define your hostname.
hostAddress = vars_networking.hostAddress.${hostName};
hostAddress = myvars.networking.hostAddress.${hostName};
in {
imports = mylib.scanPaths ./.;
@@ -22,10 +26,10 @@ in {
networking = {
inherit hostName;
inherit (vars_networking) nameservers;
inherit (myvars.networking) nameservers;
# Use mainGateway instead of defaultGateway to make NAT Traversal work
defaultGateway = vars_networking.mainGateway;
defaultGateway = myvars.networking.mainGateway;
networkmanager.enable = false;
interfaces.ens18 = {
@@ -1,10 +1,10 @@
{
config,
username,
myvars,
...
}: {
# mount a smb/cifs share
fileSystems."/home/${username}/SMB-Downloads" = {
fileSystems."/home/${myvars.username}/SMB-Downloads" = {
device = "//192.168.5.194/Downloads";
fsType = "cifs";
options = [
@@ -1,4 +1,4 @@
{vars_networking, ...}:
{myvars, ...}:
#############################################################
#
# Ai - my main computer, with NixOS + I5-13600KF + RTX 4090 GPU, for gaming & daily use.
@@ -6,7 +6,7 @@
#############################################################
let
hostName = "ai"; # Define your hostname.
hostAddress = vars_networking.hostAddress.${hostName};
hostAddress = myvars.networking.hostAddress.${hostName};
in {
imports = [
./cifs-mount.nix
@@ -19,7 +19,7 @@ in {
networking = {
inherit hostName;
inherit (vars_networking) defaultGateway nameservers;
inherit (myvars.networking) defaultGateway nameservers;
wireless.enable = false; # Enables wireless support via wpa_supplicant.
# configures the network interface(include wireless) via `nmcli` & `nmtui`
@@ -56,8 +56,8 @@
# whether to allow TRIM requests to the underlying device.
# it's less secure, but faster.
allowDiscards = true;
# Whether to bypass dm-crypts internal read and write workqueues.
# Enabling this should improve performance on SSDs;
# Whether to bypass dm-crypts internal read and write workqueues.
# Enabling this should improve performance on SSDs;
# https://wiki.archlinux.org/index.php/Dm-crypt/Specialties#Disable_workqueue_for_increased_solid_state_drive_(SSD)_performance
bypassWorkqueues = true;
};
@@ -1,4 +1,4 @@
{vars_networking, ...}:
{myvars, ...}:
#############################################################
#
# Aquamarine - A NixOS VM running on Proxmox
@@ -27,7 +27,7 @@ in {
networking = {
inherit hostName;
inherit (vars_networking) nameservers;
inherit (myvars.networking) nameservers;
};
# This value determines the NixOS release from which the default
@@ -1,4 +1,4 @@
{useremail, ...}: {
{myvars, ...}: {
services.caddy = {
enable = true;
# Reload Caddy instead of restarting it when configuration file changes.
@@ -16,7 +16,7 @@
'';
# ACME related settings.
# email = useremail;
# email = myvars.useremail;
# acmeCA = "https://acme-v02.api.letsencrypt.org/directory";
virtualHosts."http://dashy.writefor.fun".extraConfig = ''
@@ -1,5 +1,5 @@
{
vars_networking,
myvars,
mylib,
...
}:
@@ -10,7 +10,7 @@
#############################################################
let
hostName = "kana"; # Define your hostname.
hostAddress = vars_networking.hostAddress.${hostName};
hostAddress = myvars.networking.hostAddress.${hostName};
in {
imports = mylib.scanPaths ./.;
@@ -32,7 +32,7 @@ in {
networking = {
inherit hostName;
inherit (vars_networking) defaultGateway nameservers;
inherit (myvars.networking) defaultGateway nameservers;
networkmanager.enable = false;
interfaces.ens18 = {

Before

Width:  |  Height:  |  Size: 5.5 MiB

After

Width:  |  Height:  |  Size: 5.5 MiB

@@ -1,6 +1,6 @@
{
config,
username,
myvars,
...
}: let
dataDir = "/var/lib/transmission";
@@ -60,8 +60,8 @@ in {
# Wildcards allowed using '*'. Example: "*.foo.org,example.com",
rpc-host-whitelist-enabled = true;
rpc-host-whitelist = "*.writefor.fun,localhost,192.168.5.*";
rpc-user = username;
rpc-username = username;
rpc-user = myvars.username;
rpc-username = myvars.username;
# rpc-password = "test"; # you'd better use the credentialsFile for this.
incomplete-dir-enabled = true;
@@ -1,4 +1,4 @@
{useremail, ...}: {
{myvars, ...}: {
services.caddy = {
enable = true;
# Reload Caddy instead of restarting it when configuration file changes.
@@ -16,7 +16,7 @@
'';
# ACME related settings.
# email = useremail;
# email = myvars.useremail;
# acmeCA = "https://acme-v02.api.letsencrypt.org/directory";
virtualHosts."http://grafana.writefor.fun".extraConfig = ''
@@ -1,5 +1,5 @@
{
vars_networking,
myvars,
mylib,
...
}:
@@ -10,7 +10,7 @@
#############################################################
let
hostName = "ruby"; # Define your hostname.
hostAddress = vars_networking.hostAddress.${hostName};
hostAddress = myvars.networking.hostAddress.${hostName};
in {
imports = mylib.scanPaths ./.;
@@ -32,7 +32,7 @@ in {
networking = {
inherit hostName;
inherit (vars_networking) defaultGateway nameservers;
inherit (myvars.networking) defaultGateway nameservers;
networkmanager.enable = false;
interfaces.ens18 = {
@@ -1,8 +1,6 @@
{
config,
pkgs,
username,
useremail,
myvars,
...
}: {
services.grafana = {
@@ -28,8 +26,8 @@
};
security = {
admin_user = username;
admin_email = useremail;
admin_user = myvars.username;
admin_email = myvars.useremail;
# Use file provider to read the admin password from a file.
# https://grafana.com/docs/grafana/latest/setup-grafana/configure-grafana/#file-provider
admin_password = "$__file{${config.age.secrets."grafana-admin-password".path}}";
@@ -1,6 +1,6 @@
{
config,
vars_networking,
myvars,
...
}: {
# https://prometheus.io/docs/prometheus/latest/configuration/configuration/
@@ -56,7 +56,7 @@
# All my NixOS hosts.
targets =
map (host: "${host.address}:9100")
(builtins.attrValues vars_networking.hostAddress);
(builtins.attrValues myvars.networking.hostAddress);
labels.type = "node";
}
];
@@ -70,7 +70,7 @@
metrics_path = "/metrics";
static_configs = [
{
targets = ["${vars_networking.hostAddress.aquamarine.address}:9153"];
targets = ["${myvars.networking.hostAddress.aquamarine.address}:9153"];
labels.type = "app";
labels.app = "dnsmasq";
}
@@ -83,7 +83,7 @@
metrics_path = "/metrics";
static_configs = [
{
targets = ["${vars_networking.hostAddress.kana.address}:9153"];
targets = ["${myvars.networking.hostAddress.kana.address}:9153"];
labels.type = "app";
labels.app = "v2ray";
}
@@ -96,7 +96,7 @@
metrics_path = "/metrics";
static_configs = [
{
targets = ["${vars_networking.hostAddress.kana.address}:10000"];
targets = ["${myvars.networking.hostAddress.kana.address}:10000"];
labels.type = "app";
labels.app = "v2ray";
}
@@ -122,7 +122,7 @@
# The smarthost and SMTP sender used for mail notifications.
smtp_smarthost = "smtp.qq.com:465";
smtp_from = "$SMTP_SENDER_EMAIL";
smtp_auth_username = "$SMTP_AUTH_USERNAME";
smtp_auth_myvars.username = "$SMTP_AUTH_USERNAME";
smtp_auth_password = "$SMTP_AUTH_PASSWORD";
# smtp.qq.com:465 support SSL only, so we need to disable TLS here.
# https://service.mail.qq.com/detail/0/310
@@ -1,13 +1,14 @@
{
pkgs,
vars_networking,
myvars,
mylib,
...
}: let
hostName = "k3s-prod-1-master-1"; # Define your hostname.
k8sLib = import ../lib.nix;
coreModule = k8sLib.gencoreModule {
inherit pkgs hostName vars_networking;
inherit pkgs hostName;
inherit (myvars) networking;
};
in {
imports =
@@ -1,7 +1,7 @@
{
config,
pkgs,
username,
myvars,
...
}: let
package = pkgs.k3s_1_29;
@@ -29,7 +29,7 @@ in {
tokenFile = config.age.secrets."k3s-prod-1-token".path;
# https://docs.k3s.io/cli/server
extraFlags =
" --write-kubeconfig /home/${username}/.kube/config"
" --write-kubeconfig /home/${myvars.username}/.kube/config"
+ " --write-kubeconfig-mode 644"
+ " --service-node-port-range 80-32767"
+ " --kube-apiserver-arg='--allow-privileged=true'" # required by kubevirt
@@ -1,13 +1,14 @@
{
pkgs,
vars_networking,
myvars,
mylib,
...
}: let
hostName = "k3s-prod-1-master-2"; # define your hostname.
k8sLib = import ../lib.nix;
coreModule = k8sLib.gencoreModule {
inherit pkgs hostName vars_networking;
inherit pkgs hostName;
inherit (myvars) networking;
};
in {
imports =
@@ -1,11 +1,11 @@
{
config,
pkgs,
vars_networking,
myvars,
...
}: let
serverName = "k3s-prod-1-master-1";
serverIp = vars_networking.hostAddress.${serverName}.address;
serverIp = myvars.networking.hostAddress.${serverName}.address;
package = pkgs.k3s_1_29;
in {
environment.systemPackages = [package];
@@ -1,13 +1,14 @@
{
pkgs,
vars_networking,
myvars,
mylib,
...
}: let
hostName = "k3s-prod-1-master-3"; # define your hostname.
k8sLib = import ../lib.nix;
coreModule = k8sLib.gencoreModule {
inherit pkgs hostName vars_networking;
inherit pkgs hostName;
inherit (myvars) networking;
};
in {
imports =
@@ -1,11 +1,11 @@
{
config,
pkgs,
vars_networking,
myvars,
...
}: let
serverName = "k3s-prod-1-master-1";
serverIp = vars_networking.hostAddress.${serverName}.address;
serverIp = myvars.networking.hostAddress.${serverName}.address;
package = pkgs.k3s_1_29;
in {
environment.systemPackages = [package];
@@ -1,13 +1,14 @@
{
pkgs,
vars_networking,
myvars,
mylib,
...
}: let
hostName = "k3s-prod-1-worker-1"; # define your hostname.
k8sLib = import ../lib.nix;
coreModule = k8sLib.gencoreModule {
inherit pkgs hostName vars_networking;
inherit pkgs hostName;
inherit (myvars) networking;
};
in {
imports =
@@ -1,11 +1,11 @@
{
config,
pkgs,
vars_networking,
myvars,
...
}: let
serverName = "k3s-prod-1-master-1";
serverIp = vars_networking.hostAddress.${serverName}.address;
serverIp = myvars.networking.hostAddress.${serverName}.address;
package = pkgs.k3s_1_29;
in {
environment.systemPackages = [package];
@@ -1,13 +1,14 @@
{
pkgs,
vars_networking,
myvars,
mylib,
...
}: let
hostName = "k3s-prod-1-worker-2"; # define your hostname.
k8sLib = import ../lib.nix;
coreModule = k8sLib.gencoreModule {
inherit pkgs hostName vars_networking;
inherit pkgs hostName;
inherit (myvars) networking;
};
in {
imports =
@@ -1,11 +1,11 @@
{
config,
pkgs,
vars_networking,
myvars,
...
}: let
serverName = "k3s-prod-1-master-1";
serverIp = vars_networking.hostAddress.${serverName}.address;
serverIp = myvars.networking.hostAddress.${serverName}.address;
package = pkgs.k3s_1_29;
in {
environment.systemPackages = [package];
@@ -1,13 +1,14 @@
{
pkgs,
vars_networking,
myvars,
mylib,
...
}: let
hostName = "k3s-prod-1-worker-3"; # define your hostname.
k8sLib = import ../lib.nix;
coreModule = k8sLib.gencoreModule {
inherit pkgs hostName vars_networking;
inherit pkgs hostName;
inherit (myvars) networking;
};
in {
imports =
@@ -1,11 +1,11 @@
{
config,
pkgs,
vars_networking,
myvars,
...
}: let
serverName = "k3s-prod-1-master-1";
serverIp = vars_networking.hostAddress.${serverName}.address;
serverIp = myvars.networking.hostAddress.${serverName}.address;
package = pkgs.k3s_1_29;
in {
environment.systemPackages = [package];
@@ -1,7 +1,7 @@
{
pkgs,
mylib,
vars_networking,
myvars,
disko,
...
}: let
@@ -9,7 +9,8 @@
hostName = "kubevirt-shoryu"; # Define your hostname.
k8sLib = import ../lib.nix;
coreModule = k8sLib.gencoreModule {
inherit pkgs hostName vars_networking;
inherit pkgs hostName;
inherit (myvars) networking;
};
in {
imports =
@@ -17,6 +18,6 @@ in {
++ [
coreModule
disko.nixosModules.default
../kubevirt-disko-fs.nix
../disko_config/kubevirt-disko-fs.nix
];
}
@@ -1,7 +1,7 @@
{
config,
pkgs,
username,
myvars,
...
}: let
package = pkgs.k3s_1_29;
@@ -1,14 +1,15 @@
{
pkgs,
mylib,
vars_networking,
myvars,
disko,
...
}: let
hostName = "kubevirt-shushou"; # Define your hostname.
k8sLib = import ../lib.nix;
coreModule = k8sLib.gencoreModule {
inherit pkgs hostName vars_networking;
inherit pkgs hostName;
inherit (myvars) networking;
};
in {
imports =
@@ -16,6 +17,6 @@ in {
++ [
coreModule
disko.nixosModules.default
../kubevirt-disko-fs.nix
../disko_config/kubevirt-disko-fs.nix
];
}
@@ -1,7 +1,7 @@
{
config,
pkgs,
username,
myvars,
...
}: let
package = pkgs.k3s_1_29;
@@ -1,14 +1,15 @@
{
pkgs,
mylib,
vars_networking,
myvars,
disko,
...
}: let
hostName = "kubevirt-youko"; # Define your hostname.
k8sLib = import ../lib.nix;
coreModule = k8sLib.gencoreModule {
inherit pkgs hostName vars_networking;
inherit pkgs hostName;
inherit (myvars) networking;
};
in {
imports =
@@ -16,6 +17,6 @@ in {
++ [
coreModule
disko.nixosModules.default
../kubevirt-disko-fs.nix
../disko_config/kubevirt-disko-fs.nix
];
}

Some files were not shown because too many files have changed in this diff Show More