add onyx
Charlotte Som charlotte@som.codes
Tue, 03 Mar 2026 21:55:05 +0000
9 files changed,
208 insertions(+),
13 deletions(-)
M
flake.lock
→
flake.lock
@@ -1,5 +1,41 @@
{ "nodes": { + "disko": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1772867152, + "narHash": "sha256-RIFgZ4O6Eg+5ysZ8Tqb3YvcqiRaNy440GEY22ltjRrs=", + "owner": "nix-community", + "repo": "disko", + "rev": "eaafb89b56e948661d618eefd4757d9ea8d77514", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "disko", + "type": "github" + } + }, + "nixos-hardware": { + "locked": { + "lastModified": 1772972630, + "narHash": "sha256-mUJxsNOrBMNOUJzN0pfdVJ1r2pxeqm9gI/yIKXzVVbk=", + "owner": "NixOS", + "repo": "nixos-hardware", + "rev": "3966ce987e1a9a164205ac8259a5fe8a64528f72", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "master", + "repo": "nixos-hardware", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1769318308,@@ -34,6 +70,8 @@ }
}, "root": { "inputs": { + "disko": "disko", + "nixos-hardware": "nixos-hardware", "nixpkgs": "nixpkgs", "nixpkgs-unstable": "nixpkgs-unstable" }
M
flake.nix
→
flake.nix
@@ -3,11 +3,18 @@ description = "charlotte's NixOS flake";
inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.11"; nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable"; + + disko.url = "github:nix-community/disko"; + disko.inputs.nixpkgs.follows = "nixpkgs"; + + nixos-hardware.url = "github:NixOS/nixos-hardware/master"; }; outputs = { self , nixpkgs , nixpkgs-unstable + , disko + , nixos-hardware , ... }@inputs: {@@ -21,12 +28,9 @@ unstable-pkgs = nixpkgs-unstable.legacyPackages."x86_64-linux";
}; modules = [ - ( - { ... }: - { - system.stateVersion = "24.05"; - } - ) + ({ ... }: { + system.stateVersion = "24.05"; + }) ./profiles/common/base.nix ./profiles/common/locale.nix@@ -35,6 +39,35 @@
./profiles/runestone/hardware-configuration.nix ./profiles/runestone/base.nix ./profiles/runestone/postgres.nix + ]; + }; + + onyx = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + + specialArgs = { + user-pkgs = self.packages."x86_64-linux"; + unstable-pkgs = nixpkgs-unstable.legacyPackages."x86_64-linux"; + }; + + modules = [ + ({ ... }: { + system.stateVersion = "25.11"; + }) + + nixos-hardware.nixosModules.framework-desktop-amd-ai-max-300-series + + disko.nixosModules.disko + ./profiles/onyx/disks.nix + + ./profiles/common/base.nix + ./profiles/common/locale.nix + ./profiles/common/networking.nix + + ./profiles/onyx/hardware-configuration.nix + ./profiles/onyx/base.nix + ./profiles/onyx/nvidia.nix + ./profiles/onyx/hyper-v.nix ]; }; };
M
profiles/common/base.nix
→
profiles/common/base.nix
@@ -71,5 +71,11 @@ ]
++ [ unstable-pkgs.jujutsu unstable-pkgs.vim + unstable-pkgs.ghostty.terminfo ]; + + environment.etc.certfile = { + source = "/etc/ssl/certs/ca-bundle.crt"; + target = "ssl/cert.pem"; + }; }
M
profiles/common/desktop.nix
→
profiles/common/desktop.nix
@@ -3,13 +3,6 @@ {
hardware.bluetooth.enable = true; hardware.bluetooth.powerOnBoot = true; - services.xserver.enable = true; - services.xserver.xkb = lib.mkDefault { - layout = "us"; - variant = ""; - options = "compose:ralt"; - }; - hardware.pulseaudio.enable = false; security.rtkit.enable = true; services.pipewire = {
A
profiles/onyx/base.nix
@@ -0,0 +1,27 @@
+{ + pkgs, + user-pkgs, + unstable-pkgs, + ... +}: +{ + networking.hostName = "onyx"; + time.timeZone = "Europe/London"; + + hardware.graphics.enable = true; + + users.users.charlotte = { + isNormalUser = true; + description = "charlotte"; + extraGroups = [ + "networkmanager" + "wheel" + "video" + ]; + shell = pkgs.zsh; + }; + + users.users.charlotte.packages = [ + unstable-pkgs.zed-editor.remote_server + ]; +}
A
profiles/onyx/disks.nix
@@ -0,0 +1,44 @@
+{ lib, ... }: { + disko.devices.disk.primary = { + device = lib.mkDefault "/dev/disk/by-id/nvme-WD_BLACK_SN850X_2000GB_240264805134"; + type = "disk"; + content = { + type = "gpt"; + partitions = { + ESP = { + size = "4G"; + type = "EF00"; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + mountOptions = [ + "defaults" + "umask=0077" + ]; + }; + }; + root = { + size = "100%"; + type = "8300"; + content = { + type = "btrfs"; + subvolumes = { + "/root" = { + mountpoint = "/"; + }; + "/nix" = { + mountOptions = [ + "compress=zstd" + "noatime" + "noacl" + ]; + mountpoint = "/nix"; + }; + }; + }; + }; + }; + }; + }; +}
A
profiles/onyx/hardware-configuration.nix
@@ -0,0 +1,18 @@
+# Do not modify this file! It was generated by ‘nixos-generate-config’ +# and may be overwritten by future invocations. Please make changes +# to /etc/nixos/configuration.nix instead. +{ config, lib, pkgs, modulesPath, ... }: + +{ + imports = + [ (modulesPath + "/installer/scan/not-detected.nix") + ]; + + boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "thunderbolt" "usbhid" "usb_storage" "sd_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-amd" ]; + boot.extraModulePackages = [ ]; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +}
A
profiles/onyx/hyper-v.nix
@@ -0,0 +1,9 @@
+{ ... }: { + boot.initrd.availableKernelModules = [ "hv_vmbus" "hv_storvsc" ]; + + systemd.services.tailscaled.environment = { + TS_ENCRYPT_STATE = "false"; + }; + + virtualisation.hypervGuest.enable = true; +}
A
profiles/onyx/nvidia.nix
@@ -0,0 +1,27 @@
+{ config, ... }: { + services.hardware.bolt.enable = true; + + services.xserver.videoDrivers = [ "amdgpu" "nvidia" ]; + hardware.nvidia = { + open = false; + + nvidiaSettings = true; + package = config.boot.kernelPackages.nvidiaPackages.stable; + }; + + boot.blacklistedKernelModules = [ + "nouveau" + "nvidiafb" + ]; + boot.kernelModules = [ + "thunderbolt" + "usbhid" + "joydev" + "xpad" + "nvidia" + "nvidia_modeset" + "nvidia_uvm" + "nvidia_drm" + "amdgpu" + ]; +}