more work on hosts/ and modules/config

Signed-off-by: unexplrd <unexplrd@linerds.us>
This commit is contained in:
2025-05-04 18:48:42 +03:00
parent a87f912600
commit 03bcc94645
27 changed files with 136 additions and 249 deletions

View File

@ -1,4 +1,8 @@
{inputs, ...}: {
{
config,
inputs,
...
}: {
imports = with inputs; [
self.nixosModules.config
self.nixosModules.desktop
@ -8,6 +12,7 @@
];
networking = {
networkmanager.enable = true;
hostId = "c7f6c4a1";
hostName = "dunamis";
};
@ -18,13 +23,15 @@
desktop.niri.enable = true;
module.config = {
secureBoot = true;
tpmDiskUnlock = true;
};
module.stylix = {
enable = true;
theme = "helios";
module = {
config = {
secureBoot = true;
tpmDiskUnlock = true;
};
stylix = {
enable = true;
theme = "helios";
};
};
locale.ukrainian.enable = true;
@ -32,4 +39,16 @@
qmk-vial.enable = true;
security.basic.enable = true;
virtual.libvirt.enable = true;
nix = let
inherit (builtins) readFile;
inherit (config.users.users) user;
in {
settings.trusted-users = ["nix-ssh"];
sshServe = {
enable = true;
write = true;
keys = map (f: readFile f) user.openssh.authorizedKeys.keyFiles;
};
};
}

View File

@ -1,39 +0,0 @@
{
pkgs,
inputs,
...
}: {
imports = with inputs;
[
chaotic.nixosModules.default
lanzaboote.nixosModules.lanzaboote
]
++ [
./loader.nix
];
boot = {
# kernelPackages = pkgs.linuxPackages_latest;
plymouth.enable = true;
consoleLogLevel = 0;
kernelPackages = pkgs.linuxPackages_cachyos;
kernelParams = [
"amd_iommu=force_isolation"
"debugfs=off"
"efi=disable_early_pci_dma"
"gather_data_sampling=force"
"intel_iommu=on"
"iommu.passthrough=0"
"iommu.strict=1"
"iommu=force"
"page_alloc.shuffle=1"
"vsyscall=none"
# "ia32_emulation=0"
# "lockdown=confidentiality"
# "module.sig_enforce=1"
];
initrd = {
systemd.enable = true; # needed for auto-unlocking with TPM
systemd.tpm2.enable = false; # no TPM
};
};
}

View File

@ -1,15 +0,0 @@
{config, ...}: {
boot = {
lanzaboote = {
enable = false;
pkiBundle = "/var/lib/sbctl";
};
loader = {
efi.canTouchEfiVariables = true;
systemd-boot = {
enable = !config.boot.lanzaboote.enable;
consoleMode = "auto";
};
};
};
}

View File

@ -2,29 +2,38 @@
imports = with inputs; [
self.nixosModules.desktop
self.nixosModules.system
./boot
./disko
./hardware
./networking
./nix
../dunamis/programs.nix
../dunamis/services.nix
../dunamis/sops.nix
../dunamis/users.nix
];
networking = {
networkmanager.enable = true;
# hostId = "";
hostName = "eldrid";
};
environment.memoryAllocator.provider = "mimalloc";
system.stateVersion = "25.05";
time.timeZone = "Europe/Kyiv";
desktop.plasma.enable = true;
locale.ukrainian.enable = true;
module.stylix = {
enable = true;
theme = "nord";
module = {
config = {
secureBoot = true;
useIwd = true;
};
stylix = {
enable = true;
theme = "helios";
};
};
locale.ukrainian.enable = true;
opentabletdriver.enable = false;
qmk-vial.enable = true;
security.basic.enable = true;
system.stateVersion = "25.05";
virtual.libvirt.enable = false;
swapDevices = [
{
@ -32,8 +41,4 @@
size = 8 * 1024; # eight gigs
}
];
time.timeZone = "Europe/Kyiv";
# virtual.libvirt.enable = true;
}

View File

@ -1,8 +1,6 @@
{
imports = [
./facter.nix
./laptop
./vaapi/intel-media-driver.nix
];
services = {
logind = {

View File

@ -1,14 +0,0 @@
{
config,
inputs,
...
}: let
inherit (inputs) mysecrets;
inherit (config.networking) hostName;
in {
imports = with inputs; [
nixos-facter-modules.nixosModules.facter
];
facter.reportPath = "${mysecrets}/facter/${hostName}.json";
systemd.network.wait-online.enable = false;
}

View File

@ -1,7 +0,0 @@
{pkgs, ...}: {
hardware.graphics.extraPackages = with pkgs; [
intel-compute-runtime
intel-media-driver
vpl-gpu-rt
];
}

View File

@ -1,9 +0,0 @@
{
imports = [
./network-manager.nix
./host-name-id.nix
];
networking = {
hosts = import ./hosts.nix;
};
}

View File

@ -1,6 +0,0 @@
{
networking = {
# hostId = "";
hostName = "eldrid";
};
}

View File

@ -1,3 +0,0 @@
{
"192.168.1.42" = ["dunamis"];
}

View File

@ -1,11 +0,0 @@
{pkgs, ...}: {
nix = {
package = pkgs.lixPackageSets.latest.lix;
channel.enable = false;
daemonCPUSchedPolicy = "idle";
settings = {
experimental-features = ["nix-command" "flakes"];
builders-use-substitutes = true;
};
};
}

View File

@ -1,7 +0,0 @@
{
imports = [
./common.nix
./substituters.nix
./distributed-build.nix
];
}

View File

@ -1,10 +0,0 @@
{config, ...}: let
inherit (builtins) readFile;
inherit (config.users.users) user;
in {
nix.sshServe = {
enable = true;
write = true;
keys = map (f: readFile f) user.openssh.authorizedKeys.keyFiles;
};
}

View File

@ -1,16 +0,0 @@
{
nix.settings = {
substituters = [
"https://cache.nixos.org/"
"https://chaotic-nyx.cachix.org/"
"https://cosmic.cachix.org/"
"https://nix-community.cachix.org/"
];
trusted-public-keys = [
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
"chaotic-nyx.cachix.org-1:HfnXSw4pj95iI/n17rIDy40agHj12WfF+Gqk6SonIT8="
"cosmic.cachix.org-1:Dya9IyXD4xdBehWjrkPv6rtxpmMdRel02smYzA85dPE="
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
];
};
}

View File

@ -5,27 +5,33 @@
self.nixosModules.config
./disko
./hardware
./distributed-build.nix
];
networking = {
networkmanager.enable = true;
hostId = "31150fae";
hostName = "sarien";
};
environment.memoryAllocator.provider = "mimalloc";
system.stateVersion = "25.05";
time.timeZone = "Europe/Kyiv";
module.config = {
useIwd = true;
};
module.stylix = {
enable = true;
theme = "himalaya";
};
desktop.niri.enable = true;
module = {
config = {
useIwd = true;
};
stylix = {
enable = true;
theme = "himalaya";
};
};
locale.ukrainian.enable = true;
opentabletdriver.enable = false;
qmk-vial.enable = true;
security.basic.enable = true;
virtual.libvirt.enable = true;

View File

@ -0,0 +1,30 @@
{
config,
inputs,
...
}: let
inherit (builtins) readFile;
inherit (config.networking) hostName;
inherit (config.sops) secrets;
inherit (inputs) mysecrets;
pubHost = readFile "${mysecrets}/ssh/ssh_host_ed25519_dunamis.base64";
in {
nix = {
distributedBuilds = true;
buildMachines = [
{
hostName = "dunamis";
publicHostKey = pubHost;
sshKey = secrets."ssh-${hostName}-user".path;
sshUser = "nix-ssh";
supportedFeatures = [
"benchmark"
"big-parallel"
"kvm"
"nixos-test"
];
system = "x86_64-linux";
}
];
};
}