-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a20ac6f
commit dd92775
Showing
7 changed files
with
173 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -64,6 +64,7 @@ | |
"milkyway" | ||
"neptune" | ||
"phobos" | ||
"polaris" | ||
"proteus" | ||
"terra" | ||
"titan" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# polaris | ||
|
||
This is a _large_ bare-metal nixos server with dual rtx a6000s! | ||
|
||
## bootstrap | ||
|
||
```bash | ||
# load nixos iso | ||
# nixos-up | ||
sudo nix-shell https://nix.cobi.dev/os-up | ||
|
||
# generate ssh key, add to github | ||
ssh-keygen -o -a 100 -t ed25519 -C "jacobi@polaris" | ||
|
||
# clone repo | ||
nix-shell -p git | ||
git clone [email protected]:jpetrucciani/nix.git ~/cfg | ||
cd ~/cfg | ||
|
||
# initial switch. after this, you can use just `hms` to update! | ||
$(nix build --no-link --print-out-paths --extra-experimental-features nix-command --extra-experimental-features flakes ~/cfg#hmx.polaris)/bin/switch | ||
``` | ||
|
||
--- | ||
|
||
## In this directory | ||
|
||
### [configuration.nix](./configuration.nix) | ||
|
||
This file defines the OS configuration for the `polaris` machine. | ||
|
||
### [hardware-configuration.nix](./hardware-configuration.nix) | ||
|
||
This is an auto-generated file by [nixos-up](https://github.com/samuela/nixos-up) that configures disks and other plugins for nixos. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
{ config, flake, machine-name, pkgs, ... }: | ||
let | ||
inherit (flake.inputs) nixos-hardware; | ||
hostname = "polaris"; | ||
common = import ../common.nix { inherit config flake machine-name pkgs; }; | ||
in | ||
{ | ||
imports = [ | ||
"${common.home-manager}/nixos" | ||
./hardware-configuration.nix | ||
] ++ (with nixos-hardware.nixosModules; [ | ||
common-pc | ||
common-pc-ssd | ||
]); | ||
|
||
inherit (common) zramSwap swapDevices; | ||
|
||
nix = common.nix-cuda // { | ||
nixPath = [ | ||
"nixpkgs=/nix/var/nix/profiles/per-user/root/channels/nixos" | ||
"nixos-config=/home/jacobi/cfg/hosts/${hostname}/configuration.nix" | ||
"/nix/var/nix/profiles/per-user/root/channels" | ||
]; | ||
}; | ||
|
||
home-manager.users.jacobi = common.jacobi; | ||
|
||
boot = { | ||
loader = { | ||
systemd-boot.enable = true; | ||
efi.canTouchEfiVariables = true; | ||
}; | ||
kernel.sysctl = { } // common.sysctl_opts; | ||
tmp.useTmpfs = true; | ||
}; | ||
|
||
environment = { | ||
variables = { | ||
NIX_HOST = hostname; | ||
NIXOS_CONFIG = "/home/jacobi/cfg/hosts/${hostname}/configuration.nix"; | ||
}; | ||
systemPackages = with pkgs; [ | ||
cudaPackages.cudatoolkit | ||
cudaPackages.cudnn | ||
nvidia-docker | ||
nvtopPackages.nvidia | ||
linuxPackages.nvidia_x11 | ||
]; | ||
}; | ||
|
||
time.timeZone = common.timeZone; | ||
|
||
networking = { | ||
hostName = hostname; | ||
useDHCP = true; | ||
interfaces.enp4s0f2.useDHCP = true; | ||
firewall.enable = false; | ||
}; | ||
|
||
users = { | ||
mutableUsers = false; | ||
users = { | ||
root.hashedPassword = "!"; | ||
jacobi = { | ||
inherit (common) extraGroups; | ||
isNormalUser = true; | ||
hashedPasswordFile = "/etc/passwordFile-jacobi"; | ||
openssh.authorizedKeys.keys = with common.pubkeys; usual; | ||
}; | ||
}; | ||
}; | ||
|
||
services = { | ||
xserver.videoDrivers = [ "nvidia" ]; | ||
} // common.services; | ||
|
||
system.stateVersion = "24.05"; | ||
security.sudo = common.security.sudo; | ||
programs = { | ||
command-not-found.enable = false; | ||
nix-ld.enable = true; | ||
}; | ||
|
||
virtualisation.docker.enable = true; | ||
hardware = { | ||
nvidia = { | ||
open = false; | ||
package = config.boot.kernelPackages.nvidiaPackages.stable; | ||
}; | ||
nvidia-container-toolkit.enable = true; | ||
graphics = { | ||
enable = true; | ||
enable32Bit = true; | ||
}; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
{ config, lib, pkgs, modulesPath, ... }: | ||
|
||
{ | ||
imports = | ||
[ | ||
(modulesPath + "/installer/scan/not-detected.nix") | ||
]; | ||
|
||
boot.initrd.availableKernelModules = [ "ahci" "xhci_pci" "nvme" "usbhid" "usb_storage" "sd_mod" "sr_mod" ]; | ||
boot.initrd.kernelModules = [ ]; | ||
boot.kernelModules = [ ]; | ||
boot.extraModulePackages = [ ]; | ||
|
||
fileSystems."/" = { | ||
device = "/dev/disk/by-uuid/628eb25a-ec4f-4f73-84a7-8a96c335d47a"; | ||
fsType = "ext4"; | ||
}; | ||
|
||
fileSystems."/boot" = { | ||
device = "/dev/disk/by-uuid/12CE-A600"; | ||
fsType = "vfat"; | ||
}; | ||
|
||
swapDevices = [ ]; | ||
|
||
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking | ||
# (the default) this is the recommended approach. When using systemd-networkd it's | ||
# still possible to use this option, but it's recommended to use it in conjunction | ||
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`. | ||
networking.useDHCP = lib.mkDefault true; | ||
# networking.interfaces.eno1.useDHCP = lib.mkDefault true; | ||
# networking.interfaces.enp4s0f2.useDHCP = lib.mkDefault true; | ||
# networking.interfaces.tailscale0.useDHCP = lib.mkDefault true; | ||
|
||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; | ||
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters