Beacon config, beacon integration into emacs
This commit is contained in:
@@ -7,10 +7,22 @@
|
||||
...
|
||||
}: {
|
||||
imports = [
|
||||
"${modulesPath}/installer/cd-dvd/installation-cd-minimal.nix"
|
||||
"${modulesPath}/virtualisation/disk-image.nix"
|
||||
suiteModules.nixos.attic
|
||||
];
|
||||
|
||||
image.format = "raw";
|
||||
|
||||
boot.initrd.availableKernelModules = [
|
||||
"xhci_pci"
|
||||
"usb_storage"
|
||||
"uas"
|
||||
"ahci"
|
||||
"nvme"
|
||||
"usbhid"
|
||||
"sd_mod"
|
||||
];
|
||||
|
||||
nixpkgs.hostPlatform = "x86_64-linux";
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
nixpkgs.config.cudaSupport = true;
|
||||
@@ -28,11 +40,13 @@
|
||||
];
|
||||
};
|
||||
|
||||
security.sudo.wheelNeedsPassword = false;
|
||||
|
||||
networking.hostName = "beacon";
|
||||
time.timeZone = "Asia/Jerusalem";
|
||||
|
||||
# NetworkManager is enabled by installation-cd-minimal; configure WiFi + static IP
|
||||
# via a keyfile so it activates automatically on boot.
|
||||
networking.networkmanager.enable = true;
|
||||
hardware.enableRedistributableFirmware = true;
|
||||
networking.useDHCP = false;
|
||||
environment.etc."NetworkManager/system-connections/Zakobar.nmconnection" = {
|
||||
mode = "0600";
|
||||
@@ -62,47 +76,27 @@
|
||||
'';
|
||||
};
|
||||
|
||||
# Storage drive (ext4, label "storage") provides persistent nix store and data dir.
|
||||
# Prerequisites — run once on the storage drive before first boot:
|
||||
# mkfs.ext4 -L storage /dev/sdX
|
||||
# mount /dev/sdX /mnt/storage
|
||||
# mkdir -p /mnt/storage/nix-rw/store /mnt/storage/nix-rw/work /mnt/storage/data
|
||||
# umount /mnt/storage
|
||||
# The drive is required to boot; boot halts if it is not plugged in.
|
||||
fileSystems."/mnt/storage" = {
|
||||
device = "/dev/disk/by-label/storage";
|
||||
fsType = "ext4";
|
||||
neededForBoot = true;
|
||||
options = ["noatime"];
|
||||
# Swap is created on first boot after boot.growPartition expands the root
|
||||
# partition to the full drive size. Non-blocking: a failure just means no
|
||||
# swap on this boot (retried next boot once the partition has grown).
|
||||
systemd.services.beacon-swap = {
|
||||
description = "Create and activate swapfile";
|
||||
after = ["systemd-growfs@-.service" "local-fs.target"];
|
||||
wantedBy = ["multi-user.target"];
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
RemainAfterExit = true;
|
||||
};
|
||||
script = ''
|
||||
if [ ! -f /swapfile ]; then
|
||||
dd if=/dev/zero of=/swapfile bs=1M count=16384 status=progress
|
||||
chmod 600 /swapfile
|
||||
${pkgs.util-linux}/bin/mkswap /swapfile
|
||||
fi
|
||||
${pkgs.util-linux}/bin/swapon /swapfile
|
||||
'';
|
||||
};
|
||||
|
||||
# Redirect the live CD's tmpfs rw-store to the storage drive so nix store
|
||||
# writes survive across boots and don't consume RAM.
|
||||
fileSystems."/nix/.rw-store" = lib.mkForce {
|
||||
device = "/mnt/storage/nix-rw";
|
||||
fsType = "none";
|
||||
options = ["bind"];
|
||||
depends = ["/mnt/storage"];
|
||||
neededForBoot = true;
|
||||
};
|
||||
|
||||
fileSystems."/data" = {
|
||||
device = "/mnt/storage/data";
|
||||
fsType = "none";
|
||||
options = ["bind"];
|
||||
depends = ["/mnt/storage"];
|
||||
};
|
||||
|
||||
swapDevices = [
|
||||
{
|
||||
device = "/mnt/storage/swapfile";
|
||||
size = 16384;
|
||||
}
|
||||
];
|
||||
|
||||
# Ensure ext4 is available in initrd for the storage drive
|
||||
boot.initrd.kernelModules = ["ext4"];
|
||||
|
||||
# NVIDIA RTX 4050 — Ada Lovelace supports open kernel modules
|
||||
services.xserver.videoDrivers = ["nvidia"];
|
||||
hardware.nvidia = {
|
||||
@@ -112,7 +106,7 @@
|
||||
};
|
||||
hardware.graphics.enable = true;
|
||||
|
||||
services.getty.autologinUser = lib.mkForce "aner";
|
||||
services.getty.autologinUser = "aner";
|
||||
|
||||
services.openssh = {
|
||||
enable = true;
|
||||
@@ -135,8 +129,15 @@
|
||||
rsync
|
||||
tmux
|
||||
vim
|
||||
wget
|
||||
rclone
|
||||
pciutils
|
||||
nvtopPackages.nvidia
|
||||
cudaPackages.cudatoolkit
|
||||
cudaPackages.cudnn
|
||||
cudaPackages.nccl
|
||||
python3
|
||||
direnv
|
||||
];
|
||||
|
||||
azos.attic.enable = true;
|
||||
|
||||
Reference in New Issue
Block a user