got nixos-anywhere half working

This commit is contained in:
Leyla Becker 2024-09-14 09:19:08 -05:00
parent 20e65ebf0f
commit 2a30c00ffb
6 changed files with 193 additions and 17 deletions

View file

@ -11,19 +11,39 @@
../../enviroments/server
];
sops.defaultSopsFile = ../../secrets/secrets.yaml;
sops.defaultSopsFormat = "yaml";
sops = {
defaultSopsFile = ../../secrets/secrets.yaml;
defaultSopsFormat = "yaml";
sops.age.keyFile = "/home/leyla/.config/sops/age/keys.txt";
age ={
keyFile = "/home/leyla/.config/sops/age/keys.txt";
# sshKeyPaths = ["${config.home.homeDirectory}/.ssh/nix-ed25519"];
# generateKey = true;
};
};
# home.sessionVariables = {
# SOPS_AGE_KEY_FILE = "${config.home.homeDirectory}/.config/sops-nix/key.txt";
# };
users.leyla.isThinUser = true;
boot.loader.grub = {
enable = true;
device = "/dev/sda";
useOSProber = true;
zfsSupport = true;
efiSupport = true;
efiInstallAsRemovable = true;
# devices = [ "/dev/disk/by-path/pci-0000:23:00.3-usb-0:1:1.0-scsi-0:0:0:0-part2" ];
# mirroredBoots = [
# { devices = [ "/dev/disk/by-id/ata-ST18000NE000-3G6101_ZVTCXVEB-part1" ]; path = "/boot1"; efiSysMountPoint = "/boot"; }
# { devices = [ "/dev/disk/by-id/ata-ST18000NE000-3G6101_ZVTCXWSC-part1" ]; path = "/boot2"; efiSysMountPoint = "/boot2"; }
# { devices = [ "/dev/disk/by-id/ata-ST18000NE000-3G6101_ZVTD10EH-part1" ]; path = "/boot3"; efiSysMountPoint = "/boot3"; }
# ];
};
boot.supportedFilesystems = [ "zfs" ];
networking.hostId = "c8985fc5"; # TODO: populate this when I get home
networking.hostName = "defiant"; # Define your hostname.
nixpkgs.config.allowUnfree = true;

View file

@ -0,0 +1,120 @@
{ lib, ... }:
let
bootDisk = devicePath: {
type = "disk";
device = devicePath;
content = {
type = "gpt";
partitions = {
boot = {
size = "1M";
type = "EF02"; # for grub MBR
};
ESP = {
size = "1G";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
};
};
root = {
size = "100%";
content = {
type = "filesystem";
format = "ext4";
mountpoint = "/";
};
};
};
};
};
zfsDisk = devicePath: {
type = "disk";
device = devicePath;
content = {
type = "gpt";
partitions = {
zfs = {
size = "100%";
content = {
type = "zfs";
pool = "zpool";
};
};
};
};
};
in {
disko.devices = {
disk = {
boot = bootDisk "/dev/sda"; # "/dev/disk/by-path/pci-0000:23:00.3-usb-0:1:1.0-scsi-0:0:0:0";
# hd_13_tb_a = zfsDisk "/dev/disk/by-id/ata-ST18000NE000-3G6101_ZVTCXVEB";
# hd_13_tb_b = zfsDisk "/dev/disk/by-id/ata-ST18000NE000-3G6101_ZVTCXWSC";
# hd_13_tb_c = zfsDisk "/dev/disk/by-id/ata-ST18000NE000-3G6101_ZVTD10EH";
# ssd_2_tb_a = zfsDisk "/dev/disk/by-id/XXX";
};
# zpool = {
# zpool = {
# type = "zpool";
# mode = {
# topology = {
# type = "topology";
# vdev = [
# {
# # should this only mirror for this inital config with 3 drives we will used raidz2 for future configs???
# mode = "mirror";
# members = [
# "hd_13_tb_a" "hd_13_tb_b" "hd_13_tb_c"
# ];
# }
# ];
# cache = [ ];
# # cache = [ "ssd_2_tb_a" ];
# };
# };
# options = {
# ashift = "12";
# };
# rootFsOptions = {
# encryption = "on";
# keyformat = "hex";
# keylocation = "prompt";
# compression = "lz4";
# xattr = "sa";
# acltype = "posixacl";
# "com.sun:auto-snapshot" = "false";
# };
# datasets = {
# "root" = {
# type = "zfs_fs";
# mountpoint = "/";
# };
# "nix" = {
# type = "zfs_fs";
# mountpoint = "/nix";
# };
# "home" = {
# type = "zfs_fs";
# mountpoint = "/home";
# options = {
# "com.sun:auto-snapshot" = "true";
# };
# };
# "var" = {
# type = "zfs_fs";
# mountpoint = "/var";
# };
# };
# };
# };
};
}

View file

@ -13,10 +13,10 @@
boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/dc6a9664-80f2-4988-afd7-fee5bd3ee2ca";
fsType = "ext4";
};
# fileSystems."/" =
# { device = "/dev/disk/by-uuid/dc6a9664-80f2-4988-afd7-fee5bd3ee2ca";
# fsType = "ext4";
# };
swapDevices = [ ];