ezConfig for orangepihole

This commit is contained in:
Chris Dombroski 2024-09-20 21:16:48 -04:00
parent 927e6b1543
commit 445c9efd11
3 changed files with 95 additions and 50 deletions

View file

@ -120,16 +120,6 @@
}
];
};
orangepihole = inputs.nixpkgs.lib.nixosSystem {
specialArgs = {
inherit inputs;
pkgs-unstable = inputs.nixunstable.legacyPackages.aarch64-linux;
};
modules = [
./systems/orangepihole/configuration.nix
inputs.impermanence.nixosModules.impermanence
];
};
};
};
perSystem =

View file

@ -1,19 +1,78 @@
{ config, pkgs, ... }:
{
config,
pkgs,
modulesPath,
ezModules,
lib,
inputs,
...
}:
{
imports = [
# Include the results of the hardware scan.
./hardware-configuration.nix
../../nixos-modules
../../nixos-modules/networkd-base.nix
"${modulesPath}/installer/scan/not-detected.nix"
inputs.impermanence.nixosModules.impermanence
ezModules.networkd-base
];
boot.loader.grub.enable = false;
boot.loader.generic-extlinux-compatible.enable = true;
boot.loader.timeout = 1;
boot.tmp.cleanOnBoot = true;
boot = {
loader = {
grub.enable = false;
generic-extlinux-compatible.enable = true;
timeout = 1;
};
tmp.cleanOnBoot = true;
};
fileSystems = {
"/" = {
device = "none";
fsType = "tmpfs";
options = [
"defaults"
"mode=755"
];
};
"/persist" = {
device = "/dev/disk/by-uuid/6df53c4f-42b6-478b-8be4-f7887ad18b5b";
fsType = "btrfs";
neededForBoot = true;
options = [
"compress=lzo"
"autodefrag"
"defaults"
"subvol=@nixos/root"
];
};
"/boot" = {
device = "/dev/disk/by-uuid/a4d76da9-b8eb-4615-9d64-a36e1383da80";
fsType = "ext4";
options = [ "defaults" ];
};
"/nix" = {
device = "/dev/disk/by-uuid/6df53c4f-42b6-478b-8be4-f7887ad18b5b";
fsType = "btrfs";
options = [
"compress=lzo"
"autodefrag"
"defaults"
"subvol=@nixos/nix"
];
};
};
networking = {
hostName = "orangepihole"; # Define your hostname.
firewall = {
allowedUDPPorts = [
53
67
68
];
allowedTCPPorts = [ 53 ];
};
useDHCP = lib.mkDefault true;
};
systemd.network.networks."40-end0" = {
matchConfig.Name = "end0";
@ -40,8 +99,10 @@
];
};
networkConfig.IPv6SendRA = true;
ipv6SendRAConfig.RouterLifetimeSec = 0;
ipv6SendRAConfig.EmitDNS = false;
ipv6SendRAConfig = {
RouterLifetimeSec = 0;
EmitDNS = false;
};
ipv6Prefixes = [ { ipv6PrefixConfig.Prefix = "fd72:3dd5:21ae:3c97::/64"; } ];
};
zramSwap.enable = true;
@ -67,7 +128,7 @@
};
include = [
"/etc/unbound/ads.conf"
"${./unbound-local.conf}"
"${../configs/unbound-local.conf}"
];
};
};
@ -117,35 +178,30 @@
};
};
networking.firewall = {
allowedUDPPorts = [
53
67
68
];
allowedTCPPorts = [ 53 ];
};
system.stateVersion = "23.11"; # Did you read the comment?
sops.secrets."nixremote/sshkey" = { };
nix.buildMachines = [
{
hostName = "zeus";
systems = [
"x86_64-linux"
"aarch64-linux"
];
protocol = "ssh-ng";
sshKey = config.sops.secrets."nixremote/sshkey".path;
sshUser = "nixremote";
supportedFeatures = [
"nixos-test"
"benchmark"
"big-parallel"
"kvm"
];
}
];
nix = {
distributedBuilds = true;
settings.max-jobs = 0;
buildMachines = [
{
hostName = "zeus";
systems = [
"x86_64-linux"
"aarch64-linux"
];
protocol = "ssh-ng";
sshKey = config.sops.secrets."nixremote/sshkey".path;
sshUser = "nixremote";
supportedFeatures = [
"nixos-test"
"benchmark"
"big-parallel"
"kvm"
];
}
];
};
programs.ssh.extraConfig = ''
Host zeus
User nixremote
@ -153,6 +209,5 @@
IdentitiesOnly yes
IdentityFile ${config.sops.secrets."nixremote/sshkey".path}
'';
nix.distributedBuilds = true;
nix.settings.max-jobs = 0;
nixpkgs.hostPlatform = lib.mkDefault "aarch64-linux";
}