Skip to content

Commit

Permalink
nix: devServer disko config
Browse files Browse the repository at this point in the history
  • Loading branch information
sarcasticadmin committed Oct 10, 2024
1 parent dfbb049 commit 5ca8786
Show file tree
Hide file tree
Showing 3 changed files with 103 additions and 30 deletions.
100 changes: 100 additions & 0 deletions nix/machines/devServer/disko.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
{
disko.devices = {
disk = {
one = {
type = "disk";
device = "/dev/disk/by-id/wwn-0x5000c500b794a007";
content = {
type = "gpt";
partitions = {
ESP = {
size = "512M";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
};
};
zfs = {
size = "100%";
content = {
type = "zfs";
pool = "tank0";
};
};
};
};
};
two = {
type = "disk";
device = "/dev/disk/by-id/wwn-0x5000c500bca7d633";
content = {
type = "gpt";
partitions = {
# Support multiple disks to boot from
ESP = {
size = "512M";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot2";
};
};
zfs = {
size = "100%";
content = {
type = "zfs";
pool = "tank0";
};
};
};
};
};
};
zpool = {
tank0 = {
type = "zpool";
mode = "mirror";
# Workaround: cannot import 'tank0': I/O error in disko tests
options.cachefile = "none";
rootFsOptions = {
compression = "zstd";
"com.sun:auto-snapshot" = "true";
acltype = "posixacl";
xattr = "sa";
canmount = "off";
mountpoint = "none";
};
options = {
ashift = "12";
autotrim = "on";
};

datasets = {
"root" = {
type = "zfs_fs";
mountpoint = "/";
options.mountpoint = "legacy";
};
"home" = {
type = "zfs_fs";
mountpoint = "/home";
options.mountpoint = "legacy";
};
"nix" = {
type = "zfs_fs";
mountpoint = "/nix";
options.mountpoint = "legacy";
};
"persist" = {
type = "zfs_fs";
mountpoint = "/persist";
options.mountpoint = "legacy";
};
};
};
};
};
}
31 changes: 1 addition & 30 deletions nix/machines/devServer/hardware-configuration.nix
Original file line number Diff line number Diff line change
Expand Up @@ -23,35 +23,6 @@
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];

fileSystems."/" = {
device = "zroot/root";
fsType = "zfs";
};
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/063A-73D6";
fsType = "vfat";
options = [ "nofail" ];
};
fileSystems."/boot2" = {
device = "/dev/disk/by-uuid/0655-58C2";
fsType = "vfat";
options = [ "nofail" ];
};
fileSystems."/nix" = {
device = "zroot/nix";
fsType = "zfs";
};

fileSystems."/home" = {
device = "zroot/home";
fsType = "zfs";
};

fileSystems."/persist" = {
device = "zroot/persist";
fsType = "zfs";
};

swapDevices = [ ];

nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
Expand All @@ -74,5 +45,5 @@
};

# ZFS uniq system ID
networking.hostId = "74405d06";
networking.hostId = "713fdc74";
}
2 changes: 2 additions & 0 deletions nix/machines/flake-module.nix
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ in
devServer = lib.nixosSystem {
system = "x86_64-linux";
modules = [
inputs.disko.nixosModules.disko
./devServer/disko.nix
./_common/base.nix
./_common/users.nix
./devServer/default.nix
Expand Down

0 comments on commit 5ca8786

Please sign in to comment.