Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@

flake = {
nixosConfigurations = {
rowhammer = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
(import ./hosts/rowhammer/configuration.nix)
agenix.nixosModules.default
];
};
vesuvius = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
Expand Down
17 changes: 17 additions & 0 deletions hosts/common/packages.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{ config, pkgs, ... }:
{
environment.systemPackages = with pkgs; [
btop
emacs
git
helix
htop
nano
neovim
python3
rsync
sl
tldr
wget
];
}
20 changes: 20 additions & 0 deletions hosts/rowhammer/configuration.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{ config, lib, pkgs, ... }:
{
imports =
[
./hardware-configuration.nix
./nvidia.nix
./packages.nix
../common/nix.nix
../common/packages.nix
../common/sshd.nix
../common/users-local.nix
../common/tz-locale.nix
];

networking.hostName = "rowhammer";

networking.networkmanager.enable = true;

system.stateVersion = "25.11";
}
77 changes: 77 additions & 0 deletions hosts/rowhammer/hardware-configuration.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# 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 = [ "ahci" "ehci_pci" "usbhid" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
boot.supportedFilesystems = [ "nfs" ];
boot.swraid.enable = true;

boot.loader.grub = {
enable = true;
efiSupport = true;
efiInstallAsRemovable = true;
device = "nodev";
mirroredBoots = [
{
devices = [
"/dev/disk/by-id/ata-SAMSUNG_SSD_PB22-JS3_FDE_TM_128GB_YCB310S926SY926A9648-part1"
"/dev/disk/by-id/ata-SAMSUNG_SSD_PB22-JS3_FDE_TM_128GB_YCB310S926SY926A9650-part1"
];
path = "/boot";
}
];
};
boot.loader.efi.canTouchEfiVariables = false;


fileSystems."/" =
{ device = "/dev/disk/by-uuid/73e3f9e4-d28d-4bfe-9a59-8849e36ef295";
fsType = "btrfs";
options = [ "compress=zstd" "subvol=root" ];
};

fileSystems."/home" =
{ device = "/dev/disk/by-uuid/73e3f9e4-d28d-4bfe-9a59-8849e36ef295";
fsType = "btrfs";
options = [ "compress=zstd" "subvol=home" ];
};

fileSystems."/var" =
{ device = "/dev/disk/by-uuid/73e3f9e4-d28d-4bfe-9a59-8849e36ef295";
fsType = "btrfs";
options = [ "compress=zstd" "subvol=var" ];
};

fileSystems."/nix" =
{ device = "/dev/disk/by-uuid/73e3f9e4-d28d-4bfe-9a59-8849e36ef295";
fsType = "btrfs";
options = [ "compress=zstd" "noatime" "subvol=nix" ];
};

fileSystems."/swap" =
{ device = "/dev/disk/by-uuid/73e3f9e4-d28d-4bfe-9a59-8849e36ef295";
fsType = "btrfs";
options = [ "subvol=swap" ];
};

fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/9210-B8CC";
fsType = "vfat";
options = [ "fmask=0022" "dmask=0022" ];
};

swapDevices = [ ];

nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;

}
41 changes: 41 additions & 0 deletions hosts/rowhammer/nvidia.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{ config, pkgs, ... }:
{
boot.kernelParams = [ "nvidia-drm.modeset=1" ];
boot.kernelModules = [ "nvidia_uvm" ];
boot.initrd.kernelModules = [ "nvidia" ];
boot.extraModulePackages = [ config.boot.kernelPackages.nvidia_x11 ];

# Needed to enable Nvidia stuff :(
nixpkgs.config.allowUnfree = true;
services.xserver.videoDrivers = [ "nvidia" ];

hardware.nvidia = {
# P100s don't work with the open-source shim
open = false;
modesetting.enable = true;
package = config.boot.kernelPackages.nvidiaPackages.stable;
nvidiaPersistenced = true;
};

hardware.graphics = {
enable = true;
enable32Bit = true;
};

# Install CUDA and stuff
nixpkgs.config.cudaSupport = true;
environment.systemPackages = with pkgs; [
cudaPackages.cudatoolkit
nvidia-vaapi-driver
nvtopPackages.nvidia
pciutils
];
environment.variables = {
CUDAPATH = "${pkgs.cudaPackages.cudatoolkit}";
LD_LIBRARY_PATH = [
"/run/opengl-driver/lib"
"${pkgs.linuxPackages.nvidia_x11}/lib"
"${pkgs.cudaPackages.cudatoolkit}/lib"
];
};
}
13 changes: 13 additions & 0 deletions hosts/rowhammer/packages.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{ config, pkgs, ... }:
{
environment.systemPackages = with pkgs; [
cmake
distrobox
gdb
gcc
];
virtualisation.podman = {
enable = true;
dockerCompat = true;
};
}