-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Get gallium NAS up and running with a basic config
- Loading branch information
1 parent
8f9ba27
commit 7c7165a
Showing
6 changed files
with
170 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
root, | ||
inputs, | ||
... | ||
}: | ||
inputs.nixpkgs.lib.nixosSystem { | ||
system = "x86_64-linux"; | ||
|
||
extraModules = [ | ||
# Not sure why this has to be an extraModule instead of a regular module | ||
inputs.colmena.nixosModules.deploymentOptions | ||
]; | ||
|
||
modules = [root.nixosModules.machines.gallium.default]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{ | ||
root, | ||
inputs, | ||
super, | ||
homelab, | ||
... | ||
}: _: { | ||
imports = [ | ||
# Disk layout | ||
super.disko | ||
|
||
# Hardware | ||
super.hardware | ||
|
||
# Encrypted Secrets | ||
inputs.ragenix.nixosModules.default | ||
|
||
# Basic packages I want on every system | ||
root.nixosModules.basic-packages | ||
root.nixosModules.basic-settings | ||
|
||
# Add server user | ||
root.nixosModules.users.server | ||
|
||
(_: { | ||
networking.hostId = "8425e349"; | ||
|
||
# Load the deployment config from our homelab.toml | ||
inherit (homelab.machines.gallium) deployment; | ||
}) | ||
]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
{inputs, ...}: { | ||
imports = [ | ||
inputs.disko.nixosModules.disko | ||
]; | ||
|
||
config = { | ||
disko.devices = { | ||
disk = { | ||
a = { | ||
type = "disk"; | ||
device = "/dev/disk/by-id/nvme-WD_BLACK_SN770_1TB_23192N800112"; | ||
content = { | ||
type = "gpt"; | ||
partitions = { | ||
ESP = { | ||
size = "1G"; | ||
type = "EF00"; | ||
content = { | ||
type = "filesystem"; | ||
format = "vfat"; | ||
mountpoint = "/boot"; | ||
}; | ||
}; | ||
zfs = { | ||
size = "100%"; | ||
content = { | ||
type = "zfs"; | ||
pool = "boot"; | ||
}; | ||
}; | ||
}; | ||
}; | ||
}; | ||
}; | ||
zpool = { | ||
boot = { | ||
type = "zpool"; | ||
postCreateHook = "zfs snapshot boot@blank"; | ||
rootFsOptions = { | ||
compression = "zstd"; | ||
mountpoint = "none"; | ||
}; | ||
|
||
datasets = { | ||
reserve = { | ||
type = "zfs_fs"; | ||
options = { | ||
mountpoint = "none"; | ||
reservation = "5G"; | ||
}; | ||
}; | ||
root = { | ||
type = "zfs_fs"; | ||
mountpoint = "/"; | ||
options = { | ||
mountpoint = "legacy"; | ||
}; | ||
postCreateHook = "zfs snapshot boot/root@blank"; | ||
}; | ||
nix = { | ||
type = "zfs_fs"; | ||
mountpoint = "/nix"; | ||
options = { | ||
mountpoint = "legacy"; | ||
}; | ||
}; | ||
home = { | ||
type = "zfs_fs"; | ||
mountpoint = "/home"; | ||
options = { | ||
mountpoint = "legacy"; | ||
}; | ||
}; | ||
}; | ||
}; | ||
}; | ||
}; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
_: { | ||
config, | ||
lib, | ||
... | ||
}: { | ||
boot.initrd.availableKernelModules = ["xhci_pci" "ahci" "nvme" "sd_mod" "sdhci_pci"]; | ||
boot.initrd.kernelModules = []; | ||
boot.kernelModules = ["kvm-intel"]; | ||
boot.extraModulePackages = []; | ||
|
||
networking.useDHCP = lib.mkDefault true; | ||
|
||
time.timeZone = "America/Los_Angeles"; | ||
|
||
networking.hostName = "gallium"; | ||
|
||
boot.loader = { | ||
systemd-boot = { | ||
enable = true; | ||
consoleMode = "auto"; | ||
netbootxyz.enable = true; | ||
}; | ||
|
||
efi.canTouchEfiVariables = true; | ||
}; | ||
boot.zfs.forceImportRoot = false; | ||
boot.supportedFilesystems = ["zfs"]; | ||
boot.initrd.supportedFilesystems = ["zfs"]; | ||
|
||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; | ||
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; | ||
} |