summaryrefslogtreecommitdiffstats
path: root/makefu/1systems/nextgum/hardware-config.nix
diff options
context:
space:
mode:
authorjeschli <jeschli@gmail.com>2018-07-09 14:31:18 +0200
committerjeschli <jeschli@gmail.com>2018-07-09 14:31:18 +0200
commitd1c6baf00e98a0229fc7fd96874623efc8417b05 (patch)
treeeaba9481ed208af1086690a9c07ca948b047389a /makefu/1systems/nextgum/hardware-config.nix
parentb439342e7533e3f695db8a46576c54d180f56a58 (diff)
parentd6df7ae483b984b90bdc8d4540301ef394885a98 (diff)
Merge remote-tracking branch 'origin/staging/jeschli'
Diffstat (limited to 'makefu/1systems/nextgum/hardware-config.nix')
-rw-r--r--makefu/1systems/nextgum/hardware-config.nix80
1 files changed, 80 insertions, 0 deletions
diff --git a/makefu/1systems/nextgum/hardware-config.nix b/makefu/1systems/nextgum/hardware-config.nix
new file mode 100644
index 000000000..36fea6544
--- /dev/null
+++ b/makefu/1systems/nextgum/hardware-config.nix
@@ -0,0 +1,80 @@
+{ config, ... }:
+let
+ 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";
+ # single partition, label "nixos"
+ # cd /var/src; curl https://github.com/nixos/nixpkgs/tarball/809cf38 -L | tar zx ; mv * nixpkgs && touch .populate
+
+
+ # static
+ external-ip = "144.76.26.247";
+ external-ip6 = "2a01:4f8:191:12f6::2";
+ external-gw6 = "fe80::1";
+ external-netmask = 27;
+ 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;
+ }];
+ };
+ defaultGateway6 = external-gw6;
+ defaultGateway = external-gw;
+ };
+ boot.kernelParams = [ ];
+ boot.loader.grub.enable = true;
+ boot.loader.grub.version = 2;
+ boot.loader.grub.devices = [ main-disk ];
+ boot.initrd.availableKernelModules = [
+ "ata_piix" "vmw_pvscsi" "virtio_pci" "sd_mod" "ahci"
+ "xhci_pci" "ehci_pci" "ahci" "sd_mod"
+ ];
+ boot.kernelModules = [ "kvm-intel" ];
+ hardware.enableRedistributableFirmware = true;
+ fileSystems."/" = {
+ device = "/dev/mapper/nixos-root";
+ 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 -n root nixos
+ #mkfs.ext4 /dev/mapper/nixos-root
+ #mount /dev/mapper/nixos-root /mnt
+ #mkdir /mnt/boot
+ #mount /dev/sda2 /mnt/boot
+ #mkdir -p /mnt/var/src
+ #touch /mnt/var/src/.populate
+
+}