2018-06-17 20:54:59 +00:00
|
|
|
{ config, ... }:
|
|
|
|
let
|
2018-11-05 15:22:39 +00:00
|
|
|
external-mac = "50:46:5d:9f:63:6b";
|
|
|
|
main-disk = "/dev/disk/by-id/ata-TOSHIBA_DT01ACA300_13H8863AS";
|
|
|
|
sec-disk = "/dev/disk/by-id/ata-TOSHIBA_DT01ACA300_23OJ2GJAS";
|
|
|
|
external-gw = "144.76.26.225";
|
2018-06-17 20:54:59 +00:00
|
|
|
# single partition, label "nixos"
|
|
|
|
# cd /var/src; curl https://github.com/nixos/nixpkgs/tarball/809cf38 -L | tar zx ; mv * nixpkgs && touch .populate
|
|
|
|
|
|
|
|
|
|
|
|
# static
|
2018-11-05 15:22:39 +00:00
|
|
|
external-ip = "144.76.26.247";
|
|
|
|
external-ip6 = "2a01:4f8:191:12f6::2";
|
2018-06-17 20:54:59 +00:00
|
|
|
external-gw6 = "fe80::1";
|
2018-11-05 15:22:39 +00:00
|
|
|
external-netmask = 27;
|
2018-06-17 20:54:59 +00:00
|
|
|
external-netmask6 = 64;
|
|
|
|
internal-ip = config.krebs.build.host.nets.retiolum.ip4.addr;
|
|
|
|
ext-if = "et0"; # gets renamed on the fly
|
|
|
|
in {
|
|
|
|
imports = [
|
|
|
|
];
|
|
|
|
makefu.server.primary-itf = ext-if;
|
|
|
|
services.udev.extraRules = ''
|
|
|
|
SUBSYSTEM=="net", ATTR{address}=="${external-mac}", NAME="${ext-if}"
|
|
|
|
'';
|
|
|
|
networking = {
|
|
|
|
interfaces."${ext-if}" = {
|
|
|
|
ipv4.addresses = [{
|
|
|
|
address = external-ip;
|
|
|
|
prefixLength = external-netmask;
|
|
|
|
}];
|
|
|
|
ipv6.addresses = [{
|
|
|
|
address = external-ip6;
|
|
|
|
prefixLength = external-netmask6;
|
|
|
|
}];
|
|
|
|
};
|
2019-01-03 22:57:24 +00:00
|
|
|
defaultGateway6 = { address = external-gw6; interface = ext-if; };
|
2018-06-17 20:54:59 +00:00
|
|
|
defaultGateway = external-gw;
|
|
|
|
};
|
|
|
|
boot.kernelParams = [ ];
|
2018-11-05 15:22:39 +00:00
|
|
|
boot.loader.grub.enable = true;
|
|
|
|
boot.loader.grub.version = 2;
|
|
|
|
boot.loader.grub.devices = [ main-disk ];
|
2019-06-17 05:57:26 +00:00
|
|
|
boot.initrd.kernelModules = [ "dm-raid" "dm_cache" "dm-thin-pool" ];
|
2018-11-05 15:22:39 +00:00
|
|
|
boot.initrd.availableKernelModules = [
|
|
|
|
"ata_piix" "vmw_pvscsi" "virtio_pci" "sd_mod" "ahci"
|
|
|
|
"xhci_pci" "ehci_pci" "ahci" "sd_mod"
|
|
|
|
];
|
2019-02-11 16:52:22 +00:00
|
|
|
boot.kernelModules = [ "dm-raid" "dm_cache" "dm-thin-pool" "kvm-intel" ];
|
2018-11-05 15:22:39 +00:00
|
|
|
hardware.enableRedistributableFirmware = true;
|
|
|
|
fileSystems."/" = {
|
2019-02-11 16:52:22 +00:00
|
|
|
device = "/dev/nixos/root";
|
2018-11-05 15:22:39 +00:00
|
|
|
fsType = "ext4";
|
|
|
|
};
|
|
|
|
fileSystems."/var/lib" = {
|
2019-02-11 16:52:22 +00:00
|
|
|
device = "/dev/nixos/lib";
|
2018-11-05 15:22:39 +00:00
|
|
|
fsType = "ext4";
|
|
|
|
};
|
2018-12-03 08:20:48 +00:00
|
|
|
fileSystems."/var/log" = {
|
2019-02-11 16:52:22 +00:00
|
|
|
device = "/dev/nixos/log";
|
2018-12-03 08:20:48 +00:00
|
|
|
fsType = "ext4";
|
|
|
|
};
|
2018-11-05 15:22:39 +00:00
|
|
|
fileSystems."/var/download" = {
|
2019-02-11 16:52:22 +00:00
|
|
|
device = "/dev/nixos/download";
|
2018-11-05 15:22:39 +00:00
|
|
|
fsType = "ext4";
|
|
|
|
};
|
2018-12-03 08:20:48 +00:00
|
|
|
fileSystems."/var/www/binaergewitter" = {
|
2019-02-11 16:52:22 +00:00
|
|
|
device = "/dev/nixos/binaergewitter";
|
2018-12-03 08:20:48 +00:00
|
|
|
fsType = "ext4";
|
2019-06-17 05:57:26 +00:00
|
|
|
options = [ "nofail" ];
|
2018-12-03 08:20:48 +00:00
|
|
|
};
|
2021-01-27 22:00:02 +00:00
|
|
|
fileSystems."/var/lib/nextcloud/data" = {
|
2019-09-25 13:11:14 +00:00
|
|
|
device = "/dev/nixos/nextcloud";
|
|
|
|
fsType = "ext4";
|
|
|
|
options = [ "nofail" ];
|
|
|
|
};
|
2018-11-05 15:22:39 +00:00
|
|
|
fileSystems."/var/lib/borgbackup" = {
|
2019-02-11 16:52:22 +00:00
|
|
|
device = "/dev/nixos/backup";
|
2018-11-05 15:22:39 +00:00
|
|
|
fsType = "ext4";
|
|
|
|
};
|
|
|
|
fileSystems."/boot" = {
|
|
|
|
device = "/dev/sda2";
|
|
|
|
fsType = "vfat";
|
|
|
|
};
|
|
|
|
# parted -s -a optimal "$disk" \
|
|
|
|
# mklabel gpt \
|
|
|
|
# mkpart no-fs 0 1024KiB \
|
|
|
|
# set 1 bios_grub on \
|
|
|
|
# mkpart ESP fat32 1025KiB 1024MiB set 2 boot on \
|
|
|
|
# mkpart primary 1025MiB 100%
|
|
|
|
# parted -s -a optimal "/dev/sdb" \
|
|
|
|
# mklabel gpt \
|
|
|
|
# mkpart primary 1M 100%
|
|
|
|
|
|
|
|
#mkfs.vfat /dev/sda2
|
|
|
|
#pvcreate /dev/sda3
|
|
|
|
#pvcreate /dev/sdb1
|
|
|
|
#vgcreate nixos /dev/sda3 /dev/sdb1
|
|
|
|
#lvcreate -L 120G -m 1 -n root nixos
|
|
|
|
#lvcreate -L 50G -m 1 -n lib nixos
|
|
|
|
#lvcreate -L 100G -n download nixos
|
|
|
|
#lvcreate -L 100G -n backup nixos
|
|
|
|
#mkfs.ext4 /dev/mapper/nixos-root
|
|
|
|
#mkfs.ext4 /dev/mapper/nixos-lib
|
|
|
|
#mkfs.ext4 /dev/mapper/nixos-download
|
|
|
|
#mkfs.ext4 /dev/mapper/nixos-borgbackup
|
|
|
|
#mount /dev/mapper/nixos-root /mnt
|
|
|
|
#mkdir /mnt/boot
|
|
|
|
#mount /dev/sda2 /mnt/boot
|
|
|
|
#mkdir -p /mnt/var/src
|
|
|
|
#touch /mnt/var/src/.populate
|
|
|
|
|
2018-06-17 20:54:59 +00:00
|
|
|
}
|