Added system3

This commit is contained in:
2021-08-06 16:25:01 -07:00
parent 2faa6c750a
commit 5b92cefc97
8 changed files with 281 additions and 51 deletions
+134
View File
@@ -0,0 +1,134 @@
{ config, lib, pkgs, ... }:
with lib;
let
in {
imports = [ <nixpkgs/nixos/modules/installer/scan/not-detected.nix> ];
system.stateVersion = "21.05";
boot = {
loader = {
systemd-boot.enable = true;
efi.canTouchEfiVariables = true;
};
initrd = {
availableKernelModules =
[ "xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" ];
kernelModules = [ "amdgpu" ];
};
kernelModules = [ "kvm-amd" ];
supportedFilesystems = [ "zfs" ];
kernelPackages = pkgs.linuxPackages_latest;
zfs.enableUnstable = true;
# kernelPatches = [{
# name = "big-navi";
# patch = null;
# extraConfig = ''
# DRM_AMD_DC_DCN3_0 y
# DRM_AMD_DC_DCN y
# '';
# }];
};
fileSystems = {
"/boot" = {
device = "/dev/disk/by-label/SYS3-BOOT";
fsType = "vfat";
options = [ "noexec" ];
};
"/" = {
device = "system3-root";
fsType = "tmpfs";
options = [ "mode=755" ];
};
"/nix" = {
device = "system3/transient/nix";
fsType = "zfs";
};
"/var/log" = {
device = "system3/transient/logs";
fsType = "zfs";
neededForBoot = true;
options = [ "noexec" ];
};
"/state" = {
device = "system3/persistent/state";
fsType = "zfs";
};
"/home" = {
device = "system3/persistent/home";
fsType = "zfs";
};
};
swapDevices = [{ device = "/dev/disk/by-label/system3-swap"; }];
hardware = {
bluetooth.enable = true;
cpu.amd.updateMicrocode = true;
opengl = {
driSupport = true;
driSupport32Bit = true;
extraPackages = with pkgs; [
rocm-opencl-icd
rocm-opencl-runtime
amdvlk
driversi686Linux.amdvlk
];
setLdLibraryPath = true;
};
pulseaudio = {
support32Bit = true;
package = pkgs.pulseaudioFull;
};
enableRedistributableFirmware = true;
};
services = {
xserver.videoDrivers = [ "amdgpu" ];
compton.backend = "xrender";
};
networking = {
hostId = substring 0 8 (fileContents /etc/machine-id);
useDHCP = false;
macvlans = {
intif0 = {
interface = "enp6s0";
mode = "bridge";
};
};
interfaces = {
intif0 = {
# output of: echo lambda-intif0|md5sum|sed 's/^\(..\)\(..\)\(..\)\(..\)\(..\).*$/02:\1:\2:\3:\4:\5/'
macAddress = "02:0d:df:2d:46:90";
};
};
};
systemd.targets = {
sleep.enable = false;
suspend.enable = false;
hibernate.enable = false;
hybrid-sleep.enable = false;
};
}
+14 -15
View File
@@ -1,9 +1,7 @@
{ config, lib, pkgs, ... }:
{
imports =
[ <nixpkgs/nixos/modules/installer/scan/not-detected.nix>
];
imports = [ <nixpkgs/nixos/modules/installer/scan/not-detected.nix> ];
boot = {
loader = {
@@ -18,19 +16,17 @@
extraModulePackages = [ ];
};
fileSystems."/" =
{ device = "/dev/disk/by-label/zbox-root";
fsType = "btrfs";
};
fileSystems."/" = {
device = "/dev/disk/by-label/zbox-root";
fsType = "btrfs";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-label/BOOT";
fsType = "vfat";
};
fileSystems."/boot" = {
device = "/dev/disk/by-label/BOOT";
fsType = "vfat";
};
swapDevices =
[ { device = "/dev/disk/by-label/zbox-swap"; }
];
swapDevices = [{ device = "/dev/disk/by-label/zbox-swap"; }];
hardware = {
bluetooth.enable = true;
@@ -44,7 +40,10 @@
# extraPackages32 = with pkgs.i686Linux; [ libva ];
};
pulseaudio.support32Bit = true;
pulseaudio = {
support32Bit = true;
package = pkgs.pulseaudioFull;
};
};
networking = {
+68
View File
@@ -0,0 +1,68 @@
{ config, lib, pkgs, ... }:
let state-dir = "/state";
in {
fudo.slynk.enable = true;
environment.systemPackages = with pkgs; [ opencv-java ];
networking = { interfaces = { intif0 = { useDHCP = true; }; }; };
systemd.tmpfiles.rules = [
"L /root/.gnupg - - - - ${state-dir}/user/root/gnupg"
"L /root/.ssh/id_rsa - - - - ${state-dir}/user/root/ssh/id_rsa"
"L /root/.ssh/id_rsa.pub - - - - ${state-dir}/user/root/ssh/id_rsa.pub"
"L /root/.ssh/known_hosts - - - - ${state-dir}/user/root/ssh/known_hosts"
"L /var/lib/flatpak - - - - ${state-dir}/lib/flatpak"
];
services.openssh.hostKeys = [
{
path = "${state-dir}/ssh/ssh_host_rsa_key";
type = "rsa";
bits = 4096;
}
{
path = "${state-dir}/ssh/ssh_host_ed25519_key";
type = "ed25519";
bits = 4096;
}
];
environment.etc = {
"ssh/ssh_host_rsa_key" = {
source = "${state-dir}/ssh/ssh_host_rsa_key";
user = "root";
group = "root";
mode = "0400";
};
"ssh/ssh_host_rsa_key.pub" = {
source = "${state-dir}/ssh/ssh_host_rsa_key.pub";
user = "root";
group = "root";
mode = "0444";
};
"ssh/ssh_host_ed25519_key" = {
source = "${state-dir}/ssh/ssh_host_ed25519_key";
user = "root";
group = "root";
mode = "0400";
};
"ssh/ssh_host_ed25519_key.pub" = {
source = "${state-dir}/ssh/ssh_host_ed25519_key.pub";
user = "root";
group = "root";
mode = "0444";
};
nixos.source = "/etc/nixos-live";
"machine-id".source = "${state-dir}/host/machine-id";
"host-config.nix".source = "${state-dir}/host/host-config.nix";
adjtime.source = "${state-dir}/host/adjtime";
NIXOS.source = "${state-dir}/host/NIXOS";
};
security.sudo.extraConfig = ''
# Due to rollback, sudo will lecture after every reboot
Defaults lecture = never
'';
}
+17
View File
@@ -0,0 +1,17 @@
{
description = "Niten's gaming desktop.";
ssh-fingerprints = [
"1 1 c1bec5217880c0567f23414663d59804cf5c0fe4"
"1 2 bb4e479f14591dc230141e0d87b1a0fd1bdee52ad369a83188714100476c26f6"
"4 1 c1c2c74c3e2bb214f59b51a6a02452fe2e1658ea"
"4 2 897793ada12accb15231732a4c6e4ea34f1cd88d13ee9f3fc0b74a40d588b36c"
];
rp = "niten";
admin-email = "niten@fudo.org";
enable-gui = true;
ssh-pubkey =
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEb/+VMOdBavfZxZOto/qa7Xy0T1nJdd7X52nPJdfB1k";
profile = "desktop";
domain = "sea.fudo.org";
site = "seattle";
}
+4
View File
@@ -139,6 +139,10 @@ in {
ipv4-address = "10.0.0.110";
mac-address = "02:DD:80:52:83:9B";
};
system3 = {
ipv4-address = "10.0.0.111";
mac-address = "02:0d:df:2d:46:90";
};
ubiquiti-wifi = {
ipv4-address = "10.0.0.126";
mac-address = "04:18:d6:20:48:fb";