Skip to content

Instantly share code, notes, and snippets.

@YorikSar
Last active June 9, 2026 23:09
Show Gist options
  • Select an option

  • Save YorikSar/f00f5e32e982008ef002da272d6791f8 to your computer and use it in GitHub Desktop.

Select an option

Save YorikSar/f00f5e32e982008ef002da272d6791f8 to your computer and use it in GitHub Desktop.

NixOS install on DGX Spark

Disable Secure Boot

Update firmware

In the DGX OS (maybe possible to boot to recovery), run:

sudo fwupdmgr get-updates
sudo fwupdmgr update

Then maybe reboot is needed.

Set up boot config

Use releases from https://github.com/nix-community/nixos-images.

  • To get kernel arguments:

    curl -L https://github.com/nix-community/nixos-images/releases/download/nixos-26.05/netboot-aarch64-linux.ipxe
    
  • fetch kernel and initrd

    curl -L -o kernel https://github.com/nix-community/nixos-images/releases/download/nixos-26.05/Image-aarch64-linux \
            -o initrd https://github.com/nix-community/nixos-images/releases/download/nixos-26.05/initrd-aarch64-linux
    
  • copy them to /boot:

    sudo mkdir /boot/nixos
    sudo cp -v kernel initrd /boot/nixos
    
  • edit GRUB config with sudo vim /boot/grub/grub.cfg, copy the first menuentry there, replace:

    • name with NixOS
    • id with nixos
    • kernel path with /boot/nixos/kernel
    • initrd path with /boot/nixos/initrd
    • kernel cmdline with the output from the first curl

Reboot into installer

  • tell GRUB to boot into this menuentry with sudo grub-reboot nixos
  • reboot
  • set up SSH authorized key or password for root using console

Install NixOS

I used nixos-anywhere, because I'm lazy:

nixos-anywhere --flake .#spark-805c --target-host spark-805c.local -L --build-on remote --phases disko,install,reboot
{ ... }:
{
hardware.dgx-spark.enable = true;
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
nixpkgs.hostPlatform = "aarch64-linux";
networking.networkmanager.enable = true;
nix.settings.experimental-features = [
"nix-command"
"flakes"
];
services.openssh.enable = true;
system.stateVersion = "26.05";
users.users.yorik = {
isNormalUser = true;
hashedPassword = "$y$j9T$HT9IkT1IhDCARk11kSc45/$yvKF8AAXycM2dMiPr7TBXdkfryatOZ.SXeqwWCZC1B9";
extraGroups = [ "wheel" ];
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIhbLedpUuSKCU9adOjUAVXWWm0zoBwdSnkhVh0tfKFF"
];
group = "yorik";
};
users.groups.yorik = { };
}
{ lib, ... }:
{
disko.devices = {
disk.main = {
device = lib.mkDefault "/dev/nvme0n1";
type = "disk";
content = {
type = "gpt";
partitions = {
esp = {
size = "512M";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
};
};
swap = {
size = "2G";
content = {
type = "swap";
};
};
root = {
size = "100%";
content = {
type = "filesystem";
format = "ext4";
mountpoint = "/";
};
};
};
};
};
};
}
{
"nodes": {
"dgx-spark": {
"inputs": {
"disko": "disko",
"flake-parts": "flake-parts",
"nix-gl-host": "nix-gl-host",
"nixified-ai": "nixified-ai",
"nixpkgs": "nixpkgs",
"pre-commit-hooks": "pre-commit-hooks"
},
"locked": {
"lastModified": 1778439526,
"narHash": "sha256-6WtmX4FqcipWxhrRp0e90Kj9AqP0ynXQztdcBGaqYgo=",
"owner": "graham33",
"repo": "nixos-dgx-spark",
"rev": "586d458e4f8f80470a35f573056ea5495ae348b6",
"type": "github"
},
"original": {
"owner": "graham33",
"repo": "nixos-dgx-spark",
"type": "github"
}
},
"disko": {
"inputs": {
"nixpkgs": [
"dgx-spark",
"nixpkgs"
]
},
"locked": {
"lastModified": 1773889306,
"narHash": "sha256-PAqwnsBSI9SVC2QugvQ3xeYCB0otOwCacB1ueQj2tgw=",
"owner": "nix-community",
"repo": "disko",
"rev": "5ad85c82cc52264f4beddc934ba57f3789f28347",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "disko",
"type": "github"
}
},
"disko_2": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1777713215,
"narHash": "sha256-8GzXDOXckDWwST8TY5DbwYFjdvQLlP7K9CLSVx6iTTo=",
"owner": "nix-community",
"repo": "disko",
"rev": "63b4e7e6cf75307c1d26ac3762b886b5b0247267",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "disko",
"type": "github"
}
},
"disko_3": {
"inputs": {
"nixpkgs": [
"nixos-anywhere",
"nixpkgs"
]
},
"locked": {
"lastModified": 1769524058,
"narHash": "sha256-zygdD6X1PcVNR2PsyK4ptzrVEiAdbMqLos7utrMDEWE=",
"owner": "nix-community",
"repo": "disko",
"rev": "71a3fc97d80881e91710fe721f1158d3b96ae14d",
"type": "github"
},
"original": {
"owner": "nix-community",
"ref": "master",
"repo": "disko",
"type": "github"
}
},
"flake-compat": {
"flake": false,
"locked": {
"lastModified": 1767039857,
"narHash": "sha256-vNpUSpF5Nuw8xvDLj2KCwwksIbjua2LZCqhV1LNRDns=",
"owner": "NixOS",
"repo": "flake-compat",
"rev": "5edf11c44bc78a0d334f6334cdaf7d60d732daab",
"type": "github"
},
"original": {
"owner": "NixOS",
"repo": "flake-compat",
"type": "github"
}
},
"flake-parts": {
"inputs": {
"nixpkgs-lib": "nixpkgs-lib"
},
"locked": {
"lastModified": 1775087534,
"narHash": "sha256-91qqW8lhL7TLwgQWijoGBbiD4t7/q75KTi8NxjVmSmA=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "3107b77cd68437b9a76194f0f7f9c55f2329ca5b",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
"flake-parts_2": {
"inputs": {
"nixpkgs-lib": [
"dgx-spark",
"nixified-ai",
"nixpkgs"
]
},
"locked": {
"lastModified": 1768135262,
"narHash": "sha256-PVvu7OqHBGWN16zSi6tEmPwwHQ4rLPU9Plvs8/1TUBY=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "80daad04eddbbf5a4d883996a73f3f542fa437ac",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
"flake-parts_3": {
"inputs": {
"nixpkgs-lib": [
"dgx-spark",
"nixified-ai",
"hercules-ci-effects",
"nixpkgs"
]
},
"locked": {
"lastModified": 1768135262,
"narHash": "sha256-PVvu7OqHBGWN16zSi6tEmPwwHQ4rLPU9Plvs8/1TUBY=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "80daad04eddbbf5a4d883996a73f3f542fa437ac",
"type": "github"
},
"original": {
"id": "flake-parts",
"type": "indirect"
}
},
"flake-parts_4": {
"inputs": {
"nixpkgs-lib": [
"nixos-anywhere",
"nixpkgs"
]
},
"locked": {
"lastModified": 1768135262,
"narHash": "sha256-PVvu7OqHBGWN16zSi6tEmPwwHQ4rLPU9Plvs8/1TUBY=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "80daad04eddbbf5a4d883996a73f3f542fa437ac",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
"gitignore": {
"inputs": {
"nixpkgs": [
"dgx-spark",
"pre-commit-hooks",
"nixpkgs"
]
},
"locked": {
"lastModified": 1709087332,
"narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=",
"owner": "hercules-ci",
"repo": "gitignore.nix",
"rev": "637db329424fd7e46cf4185293b9cc8c88c95394",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "gitignore.nix",
"type": "github"
}
},
"hercules-ci-effects": {
"inputs": {
"flake-parts": "flake-parts_3",
"nixpkgs": [
"dgx-spark",
"nixified-ai",
"nixpkgs"
]
},
"locked": {
"lastModified": 1768476106,
"narHash": "sha256-V0YOJRum50gtKgwavsAfwXc9+XAsJCC7386YZx1sWGQ=",
"owner": "hercules-ci",
"repo": "hercules-ci-effects",
"rev": "c19e263e6e22ec7379d972f19e6a322f943c73fb",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "hercules-ci-effects",
"type": "github"
}
},
"nix-gl-host": {
"inputs": {
"nixpkgs": [
"dgx-spark",
"nixpkgs"
]
},
"locked": {
"lastModified": 1732211616,
"narHash": "sha256-QZCKJoypcwgS3tDNSWMjlxEBZtOYPW3eXV24rMzKsac=",
"owner": "numtide",
"repo": "nix-gl-host",
"rev": "5269b233f83880a0b433eafe026f0bc0d8f1a4a9",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "nix-gl-host",
"type": "github"
}
},
"nix-vm-test": {
"inputs": {
"nixpkgs": [
"nixos-anywhere",
"nixpkgs"
]
},
"locked": {
"lastModified": 1769079217,
"narHash": "sha256-R6qzhu+YJolxE2vUsPQWWwUKMbAG5nXX3pBtg8BNX38=",
"owner": "Enzime",
"repo": "nix-vm-test",
"rev": "58c15f78947b431d6c206e0966500c7e9139bd2f",
"type": "github"
},
"original": {
"owner": "Enzime",
"ref": "pr-105-latest",
"repo": "nix-vm-test",
"type": "github"
}
},
"nixified-ai": {
"inputs": {
"flake-parts": "flake-parts_2",
"hercules-ci-effects": "hercules-ci-effects",
"nixpkgs": [
"dgx-spark",
"nixpkgs"
]
},
"locked": {
"lastModified": 1769630654,
"narHash": "sha256-bcZIn2PyW0vJ0VnMb94ooWa7kmaR8+IQPNLW+j4Xjrc=",
"owner": "nixified-ai",
"repo": "flake",
"rev": "0cc4031a34a8bec924f7045a865ce25b47ea9f42",
"type": "github"
},
"original": {
"owner": "nixified-ai",
"repo": "flake",
"type": "github"
}
},
"nixos-anywhere": {
"inputs": {
"disko": "disko_3",
"flake-parts": "flake-parts_4",
"nix-vm-test": "nix-vm-test",
"nixos-images": "nixos-images",
"nixos-stable": "nixos-stable",
"nixpkgs": [
"nixpkgs"
],
"treefmt-nix": "treefmt-nix"
},
"locked": {
"lastModified": 1769956140,
"narHash": "sha256-D+RQ+DaIC/GVwv5lUs7e8jSmh8aPc77Kg/gRjaS25Zk=",
"owner": "nix-community",
"repo": "nixos-anywhere",
"rev": "92f82c5196a5f8588be4967e535c4cfd35e85902",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nixos-anywhere",
"type": "github"
}
},
"nixos-images": {
"inputs": {
"nixos-stable": [
"nixos-anywhere",
"nixos-stable"
],
"nixos-unstable": [
"nixos-anywhere",
"nixpkgs"
]
},
"locked": {
"lastModified": 1766770015,
"narHash": "sha256-kUmVBU+uBUPl/v3biPiWrk680b8N9rRMhtY97wsxiJc=",
"owner": "nix-community",
"repo": "nixos-images",
"rev": "e4dba54ddb6b2ad9c6550e5baaed2fa27938a5d2",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nixos-images",
"type": "github"
}
},
"nixos-stable": {
"locked": {
"lastModified": 1769598131,
"narHash": "sha256-e7VO/kGLgRMbWtpBqdWl0uFg8Y2XWFMdz0uUJvlML8o=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "fa83fd837f3098e3e678e6cf017b2b36102c7211",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-25.11",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1776616485,
"narHash": "sha256-n+j1THgYwvcKhB5G29+mpcb9NJMM1wDMVavnn0zRCsA=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "e8ac1bbff8b912dcf00b8fd347e62e581095c9bb",
"type": "github"
},
"original": {
"owner": "NixOS",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-lib": {
"locked": {
"lastModified": 1774748309,
"narHash": "sha256-+U7gF3qxzwD5TZuANzZPeJTZRHS29OFQgkQ2kiTJBIQ=",
"owner": "nix-community",
"repo": "nixpkgs.lib",
"rev": "333c4e0545a6da976206c74db8773a1645b5870a",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nixpkgs.lib",
"type": "github"
}
},
"pre-commit-hooks": {
"inputs": {
"flake-compat": "flake-compat",
"gitignore": "gitignore",
"nixpkgs": [
"dgx-spark",
"nixpkgs"
]
},
"locked": {
"lastModified": 1775036584,
"narHash": "sha256-zW0lyy7ZNNT/x8JhzFHBsP2IPx7ATZIPai4FJj12BgU=",
"owner": "cachix",
"repo": "pre-commit-hooks.nix",
"rev": "4e0eb042b67d863b1b34b3f64d52ceb9cd926735",
"type": "github"
},
"original": {
"owner": "cachix",
"repo": "pre-commit-hooks.nix",
"type": "github"
}
},
"root": {
"inputs": {
"dgx-spark": "dgx-spark",
"disko": "disko_2",
"nixos-anywhere": "nixos-anywhere",
"nixpkgs": [
"dgx-spark",
"nixpkgs"
]
}
},
"treefmt-nix": {
"inputs": {
"nixpkgs": [
"nixos-anywhere",
"nixpkgs"
]
},
"locked": {
"lastModified": 1769691507,
"narHash": "sha256-8aAYwyVzSSwIhP2glDhw/G0i5+wOrren3v6WmxkVonM=",
"owner": "numtide",
"repo": "treefmt-nix",
"rev": "28b19c5844cc6e2257801d43f2772a4b4c050a1b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "treefmt-nix",
"type": "github"
}
}
},
"root": "root",
"version": 7
}
{
inputs.dgx-spark.url = "github:graham33/nixos-dgx-spark";
inputs.nixpkgs.follows = "dgx-spark/nixpkgs";
inputs.disko = {
url = "github:nix-community/disko";
inputs.nixpkgs.follows = "nixpkgs";
};
inputs.nixos-anywhere = {
url = "github:nix-community/nixos-anywhere";
inputs.nixpkgs.follows = "nixpkgs";
};
outputs =
{
self,
dgx-spark,
nixpkgs,
disko,
nixos-anywhere,
}:
{
nixosConfigurations.spark-805c = nixpkgs.lib.nixosSystem {
modules = [
dgx-spark.nixosModules.dgx-spark
disko.nixosModules.disko
{ networking.hostName = "spark-805c"; }
./disk-config.nix
./configuration.nix
];
};
devShells.aarch64-darwin.default = nixpkgs.legacyPackages.aarch64-darwin.mkShell {
packages = [ nixos-anywhere.packages.aarch64-darwin.default ];
};
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment