add jetson host
This commit is contained in:
parent
d33c120ee9
commit
d0f891e144
5 changed files with 154 additions and 1 deletions
20
flake.nix
20
flake.nix
|
|
@ -19,9 +19,11 @@
|
|||
disko.inputs.nixpkgs.follows = "nixpkgs";
|
||||
jovian-nixos.url = "github:Jovian-Experiments/Jovian-NixOS";
|
||||
jovian-nixos.inputs.nixpkgs.follows = "nixpkgs";
|
||||
jetpack-nixos.url = "github:anduril/jetpack-nixos";
|
||||
jetpack-nixos.inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
outputs = inputs@{ self, nix-darwin, nixpkgs, home-manager, nixvim, claude-code, firefox-addons, nix-homebrew, disko, jovian-nixos }:
|
||||
outputs = inputs@{ self, nix-darwin, nixpkgs, home-manager, nixvim, claude-code, firefox-addons, nix-homebrew, disko, jovian-nixos, jetpack-nixos }:
|
||||
{
|
||||
darwinConfigurations."macbook" = nix-darwin.lib.darwinSystem {
|
||||
modules = [
|
||||
|
|
@ -67,6 +69,16 @@
|
|||
];
|
||||
};
|
||||
|
||||
nixosConfigurations."jetson" = nixpkgs.lib.nixosSystem {
|
||||
system = "aarch64-linux";
|
||||
modules = [
|
||||
disko.nixosModules.disko
|
||||
jetpack-nixos.nixosModules.default
|
||||
./hosts/nixos/jetson/system.nix
|
||||
./hosts/nixos/jetson/disk-config.nix
|
||||
];
|
||||
};
|
||||
|
||||
homeConfigurations = {
|
||||
"yanlin@macbook" = home-manager.lib.homeManagerConfiguration {
|
||||
pkgs = nixpkgs.legacyPackages.aarch64-darwin;
|
||||
|
|
@ -97,6 +109,12 @@
|
|||
modules = [ ./hosts/nixos/deck/home.nix ];
|
||||
extraSpecialArgs = { inherit claude-code nixvim firefox-addons; };
|
||||
};
|
||||
|
||||
"yanlin@jetson" = home-manager.lib.homeManagerConfiguration {
|
||||
pkgs = nixpkgs.legacyPackages.aarch64-linux;
|
||||
modules = [ ./hosts/nixos/jetson/home.nix ];
|
||||
extraSpecialArgs = { inherit claude-code nixvim; };
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
38
hosts/nixos/jetson/disk-config.nix
Normal file
38
hosts/nixos/jetson/disk-config.nix
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
# Disko configuration for Jetson Orin Nano Super Developer Kit
|
||||
# Simple NVMe configuration with systemd-boot
|
||||
{
|
||||
disko.devices = {
|
||||
disk = {
|
||||
main = {
|
||||
type = "disk";
|
||||
device = "/dev/nvme0n1";
|
||||
content = {
|
||||
type = "gpt";
|
||||
partitions = {
|
||||
# EFI System Partition
|
||||
ESP = {
|
||||
size = "512M";
|
||||
type = "EF00";
|
||||
content = {
|
||||
type = "filesystem";
|
||||
format = "vfat";
|
||||
mountpoint = "/boot";
|
||||
mountOptions = [ "fmask=0077" "dmask=0077" ];
|
||||
};
|
||||
};
|
||||
|
||||
# Root partition - takes remaining space
|
||||
root = {
|
||||
size = "100%";
|
||||
content = {
|
||||
type = "filesystem";
|
||||
format = "ext4";
|
||||
mountpoint = "/";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
26
hosts/nixos/jetson/hardware-configuration.nix
Normal file
26
hosts/nixos/jetson/hardware-configuration.nix
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
# PLACEHOLDER hardware configuration for Jetson Orin Nano
|
||||
# This file should be regenerated on the actual device by running:
|
||||
# nixos-generate-config --root /mnt
|
||||
# Then copy the generated hardware-configuration.nix to this location.
|
||||
{ config, lib, pkgs, modulesPath, ... }:
|
||||
|
||||
{
|
||||
imports =
|
||||
[ (modulesPath + "/installer/scan/not-detected.nix")
|
||||
];
|
||||
|
||||
# These are placeholder kernel modules - will be auto-detected by nixos-generate-config
|
||||
boot.initrd.availableKernelModules = [ "nvme" "usb_storage" "usbhid" "sd_mod" ];
|
||||
boot.initrd.kernelModules = [ ];
|
||||
boot.kernelModules = [ ];
|
||||
boot.extraModulePackages = [ ];
|
||||
|
||||
# Filesystems are managed by disko configuration
|
||||
# No filesystem declarations needed here
|
||||
|
||||
# Enable DHCP on network interfaces
|
||||
networking.useDHCP = lib.mkDefault true;
|
||||
|
||||
# ARM64 platform for Jetson Orin Nano
|
||||
nixpkgs.hostPlatform = lib.mkDefault "aarch64-linux";
|
||||
}
|
||||
7
hosts/nixos/jetson/home.nix
Normal file
7
hosts/nixos/jetson/home.nix
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
../home-default.nix
|
||||
];
|
||||
}
|
||||
64
hosts/nixos/jetson/system.nix
Normal file
64
hosts/nixos/jetson/system.nix
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
./hardware-configuration.nix
|
||||
../system-default.nix # Common NixOS system configuration
|
||||
];
|
||||
|
||||
# Bootloader - UEFI setup for Jetson
|
||||
boot.loader = {
|
||||
systemd-boot.enable = true;
|
||||
systemd-boot.configurationLimit = 50;
|
||||
efi.canTouchEfiVariables = true;
|
||||
timeout = 3;
|
||||
};
|
||||
|
||||
# Use latest kernel for best hardware support
|
||||
boot.kernelPackages = pkgs.linuxPackages_latest;
|
||||
|
||||
# Hardware support for Jetson Orin Nano
|
||||
hardware = {
|
||||
enableRedistributableFirmware = true;
|
||||
|
||||
# Graphics and CUDA configuration via jetpack-nixos
|
||||
graphics.enable = true;
|
||||
|
||||
nvidia-jetpack = {
|
||||
enable = true;
|
||||
som = "orin-nano";
|
||||
carrierBoard = "devkit";
|
||||
};
|
||||
};
|
||||
|
||||
# Network configuration
|
||||
networking = {
|
||||
hostName = "jetson";
|
||||
networkmanager.enable = true;
|
||||
firewall.enable = false;
|
||||
};
|
||||
|
||||
# Host-specific SSH configuration
|
||||
services.openssh = {
|
||||
settings = {
|
||||
PermitRootLogin = "no";
|
||||
};
|
||||
};
|
||||
|
||||
# Host-specific user configuration
|
||||
users.users.yanlin = {
|
||||
extraGroups = [ "networkmanager" "wheel" "video" ];
|
||||
hashedPassword = "$6$kSyaRzAtj8VPcNeX$NsEP6zQAfp6O8YWcolfPRKnhIcJlKu5luZgWqozJAHtbE/gv90KoOOKU7Dt.FnbPB0Ej26jXoBH4X.7y/OLGB1";
|
||||
openssh.authorizedKeys.keys = [
|
||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICp2goZiuSfwMA02GsHhYzUZHrQPPBgP5sWSNP9kQR3e yanlin@imac"
|
||||
];
|
||||
};
|
||||
|
||||
# Basic system packages
|
||||
environment.systemPackages = with pkgs; [
|
||||
pciutils
|
||||
usbutils
|
||||
unzip
|
||||
];
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue