mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-07-17 01:51:15 +02:00
feat: format via 'ls **/*.nix | each { |it| nixfmt $it.name }'
This commit is contained in:
@@ -5,7 +5,8 @@
|
||||
myvars,
|
||||
disko,
|
||||
...
|
||||
}: let
|
||||
}:
|
||||
let
|
||||
# MoreFine - S500Plus
|
||||
hostName = "kubevirt-shoryu"; # Define your hostname.
|
||||
|
||||
@@ -45,17 +46,16 @@
|
||||
# so we should not disable flannel here.
|
||||
disableFlannel = false;
|
||||
};
|
||||
in {
|
||||
imports =
|
||||
(mylib.scanPaths ./.)
|
||||
++ [
|
||||
disko.nixosModules.default
|
||||
../disko-config/kubevirt-disko-fs.nix
|
||||
./hardware-configuration.nix
|
||||
./preservation.nix
|
||||
coreModule
|
||||
k3sModule
|
||||
];
|
||||
in
|
||||
{
|
||||
imports = (mylib.scanPaths ./.) ++ [
|
||||
disko.nixosModules.default
|
||||
../disko-config/kubevirt-disko-fs.nix
|
||||
./hardware-configuration.nix
|
||||
./preservation.nix
|
||||
coreModule
|
||||
k3sModule
|
||||
];
|
||||
|
||||
boot.kernelParams = [
|
||||
# disable transparent hugepage(allocate hugepages dynamically)
|
||||
|
||||
@@ -4,7 +4,8 @@
|
||||
pkgs,
|
||||
modulesPath,
|
||||
...
|
||||
}: {
|
||||
}:
|
||||
{
|
||||
imports = [
|
||||
(modulesPath + "/installer/scan/not-detected.nix")
|
||||
];
|
||||
@@ -18,12 +19,25 @@
|
||||
# clear /tmp on boot to get a stateless /tmp directory.
|
||||
boot.tmp.cleanOnBoot = true;
|
||||
|
||||
boot.initrd.availableKernelModules = ["xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod"];
|
||||
boot.kernelModules = ["kvm-amd" "vfio-pci"];
|
||||
boot.initrd.availableKernelModules = [
|
||||
"xhci_pci"
|
||||
"ahci"
|
||||
"nvme"
|
||||
"usbhid"
|
||||
"usb_storage"
|
||||
"sd_mod"
|
||||
];
|
||||
boot.kernelModules = [
|
||||
"kvm-amd"
|
||||
"vfio-pci"
|
||||
];
|
||||
boot.extraModprobeConfig = "options kvm_amd nested=1"; # for amd cpu
|
||||
|
||||
# Enable binfmt emulation of aarch64-linux, this is required for cross compilation.
|
||||
boot.binfmt.emulatedSystems = ["aarch64-linux" "riscv64-linux"];
|
||||
boot.binfmt.emulatedSystems = [
|
||||
"aarch64-linux"
|
||||
"riscv64-linux"
|
||||
];
|
||||
# supported file systems, so we can mount any removable disks with these filesystems
|
||||
boot.supportedFilesystems = [
|
||||
"ext4"
|
||||
|
||||
@@ -3,9 +3,11 @@
|
||||
pkgs,
|
||||
myvars,
|
||||
...
|
||||
}: let
|
||||
}:
|
||||
let
|
||||
inherit (myvars) username;
|
||||
in {
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
preservation.nixosModules.default
|
||||
];
|
||||
@@ -68,25 +70,27 @@ in {
|
||||
# Note that immediate parent directories of persisted files can also be
|
||||
# configured with ownership and permissions from the `parent` settings if
|
||||
# `configureParent = true` is set for the file.
|
||||
systemd.tmpfiles.settings.preservation = let
|
||||
permission = {
|
||||
user = username;
|
||||
group = "users";
|
||||
mode = "0755";
|
||||
systemd.tmpfiles.settings.preservation =
|
||||
let
|
||||
permission = {
|
||||
user = username;
|
||||
group = "users";
|
||||
mode = "0755";
|
||||
};
|
||||
in
|
||||
{
|
||||
"/home/${username}/.config".d = permission;
|
||||
"/home/${username}/.local".d = permission;
|
||||
"/home/${username}/.local/share".d = permission;
|
||||
"/home/${username}/.local/state".d = permission;
|
||||
"/home/${username}/.terraform.d".d = permission;
|
||||
};
|
||||
in {
|
||||
"/home/${username}/.config".d = permission;
|
||||
"/home/${username}/.local".d = permission;
|
||||
"/home/${username}/.local/share".d = permission;
|
||||
"/home/${username}/.local/state".d = permission;
|
||||
"/home/${username}/.terraform.d".d = permission;
|
||||
};
|
||||
|
||||
# systemd-machine-id-commit.service would fail but it is not relevant
|
||||
# in this specific setup for a persistent machine-id so we disable it
|
||||
#
|
||||
# see the firstboot example below for an alternative approach
|
||||
systemd.suppressedSystemUnits = ["systemd-machine-id-commit.service"];
|
||||
systemd.suppressedSystemUnits = [ "systemd-machine-id-commit.service" ];
|
||||
|
||||
# let the service commit the transient ID to the persistent volume
|
||||
systemd.services.systemd-machine-id-commit = {
|
||||
|
||||
Reference in New Issue
Block a user