Skip to content

Commit

Permalink
systems/bruddynix: init
Browse files Browse the repository at this point in the history
  • Loading branch information
khaneliman committed Dec 8, 2024
1 parent 7c0a2eb commit 529cc05
Show file tree
Hide file tree
Showing 5 changed files with 259 additions and 0 deletions.
125 changes: 125 additions & 0 deletions systems/x86_64-linux/bruddynix/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
{
config,
lib,
namespace,
...
}:
let
inherit (lib.${namespace}) enabled;
in
{
imports = [
./disks.nix
./hardware.nix
./network.nix
./specializations.nix
];

khanelinix = {
nix = enabled;

archetypes = {
gaming = enabled;
personal = enabled;
};

hardware = {
audio = {
enable = true;
extra-packages = [ ];
};

bluetooth = enabled;
cpu.amd = enabled;
gpu.amd = enabled;
opengl = enabled;
rgb.openrgb.enable = true;

storage = {
enable = true;
ssdEnable = true;
};

tpm = enabled;
};

programs = {
graphical = {
desktop-environment = {
gnome = {
enable = true;
};
};
};
};

services = {
avahi = enabled;
# TODO: input-leap replace barrier
geoclue = enabled;
power = enabled;
printing = enabled;

openssh = {
enable = true;

authorizedKeys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEpfTVxQKmkAYOrsnroZoTk0LewcBIC4OjlsoJY6QbB0"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINBG8l3jQ2EPLU+BlgtaQZpr4xr97n2buTLAZTxKHSsD"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIM7UBwfd7+K0mdkAIb2TE6RzMu6L4wZnG/anuoYqJMPB"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJAZIwy7nkz8CZYR/ZTSNr+7lRBW2AYy1jw06b44zaID"
];

# TODO: make part of ssh config proper
extraConfig = ''
Host server
User ${config.${namespace}.user.name}
Hostname austinserver.local
'';
};
};

security = {
# doas = enabled;
keyring = enabled;
sudo-rs = enabled;
# sops = {
# enable = true;
# sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ];
# defaultSopsFile = lib.snowfall.fs.get-file "secrets/bruddynix/default.yaml";
# };
};

system = {
boot = {
enable = true;
secureBoot = true;
plymouth = true;
silentBoot = true;
};

fonts = enabled;
locale = enabled;
networking = {
enable = true;
optimizeTcp = true;
};
realtime = enabled;
time = enabled;
};
};

nix.settings = {
cores = 8;
max-jobs = 8;
};

services = {
mpd = {
musicDirectory = "nfs://austinserver.local/mnt/user/data/media/music";
};
rpcbind.enable = true; # needed for NFS
};

system.stateVersion = "24.11";
}
53 changes: 53 additions & 0 deletions systems/x86_64-linux/bruddynix/disks.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
disko.devices.disk = {
main = {
device = "/dev/nvme0n1";
type = "disk";
content = {
type = "gpt";
partitions = {
ESP = {
size = "1G";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
mountOptions = [ "umask=0077" ];
extraArgs = [
"-n"
"ESP"
];
};
};
root = {
size = "100%";
content = {
type = "filesystem";
format = "ext4";
mountpoint = "/";
mountOptions = [
"defaults"
];
extraArgs = [
"-Lnixos"
];
};
};
swap = {
size = "32G";
content = {
type = "swap";
discardPolicy = "both";
resumeDevice = true; # resume from hiberation from this device
extraArgs = [
"-Lswap"
];
};
};
};
};
};
};

}
50 changes: 50 additions & 0 deletions systems/x86_64-linux/bruddynix/hardware.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{ pkgs, modulesPath, ... }:
{
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];

##
# Desktop VM config
##
boot = {
blacklistedKernelModules = [ "eeepc_wmi" ];

kernelPackages = pkgs.linuxPackages_latest;
kernel.sysctl."kernel.sysrq" = 1;

initrd = {
availableKernelModules = [
"ahci"
# "ehci_pci"
"nvme"
"sd_mod"
# "sr_mod"
"usb_storage"
"usbhid"
"xhci_pci"
];
# verbose = false;
};
};

# fileSystems = {
# "/" = {
# device = "/dev/disk/by-label/nixos";
# fsType = "ext4";
# };
#
# "/boot" = {
# device = "/dev/disk/by-label/ESP";
# fsType = "vfat";
# options = [
# "fmask=0077"
# "dmask=0077"
# ];
# };
# };

# swapDevices = [ { device = "/dev/disk/by-label/swap"; } ];

hardware = {
enableRedistributableFirmware = true;
};
}
13 changes: 13 additions & 0 deletions systems/x86_64-linux/bruddynix/network.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
_: {
systemd = {
network.networks = {
"30-network-defaults-wired" = {
matchConfig.Name = "en* | eth* | usb*";
networkConfig = {
DHCP = "ipv4";
MulticastDNS = true;
};
};
};
};
}
18 changes: 18 additions & 0 deletions systems/x86_64-linux/bruddynix/specializations.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{ lib, pkgs, ... }:
{
specialisation = {
zen = {
inheritParentConfig = true;
configuration = {
boot.kernelPackages = lib.mkForce pkgs.linuxPackages_zen;
};
};

lts = {
inheritParentConfig = true;
configuration = {
boot.kernelPackages = lib.mkForce pkgs.linuxPackages;
};
};
};
}

0 comments on commit 529cc05

Please sign in to comment.