diff options
Diffstat (limited to 'lass/1systems/hilum')
-rw-r--r-- | lass/1systems/hilum/config.nix | 33 | ||||
-rw-r--r-- | lass/1systems/hilum/disk.nix | 43 | ||||
-rwxr-xr-x | lass/1systems/hilum/flash-stick.sh | 43 | ||||
-rw-r--r-- | lass/1systems/hilum/physical.nix | 53 |
4 files changed, 0 insertions, 172 deletions
diff --git a/lass/1systems/hilum/config.nix b/lass/1systems/hilum/config.nix deleted file mode 100644 index 953b5d0d4..000000000 --- a/lass/1systems/hilum/config.nix +++ /dev/null @@ -1,33 +0,0 @@ -{ config, pkgs, ... }: -{ - imports = [ - <stockholm/lass> - - <stockholm/lass/2configs/retiolum.nix> - <stockholm/lass/2configs/network-manager.nix> - <stockholm/lass/2configs/syncthing.nix> - ]; - - krebs.build.host = config.krebs.hosts.hilum; - - boot.loader.grub = { - extraEntries = '' - submenu isos { - source /grub/autoiso.cfg - } - ''; - extraFiles."/grub/autoiso.cfg" = (pkgs.stdenv.mkDerivation { - name = "autoiso.cfg"; - src = pkgs.grub2.src; - phases = [ "unpackPhase" "installPhase" ]; - installPhase = '' - cp docs/autoiso.cfg $out - ''; - }); - }; - - services.logind.lidSwitch = "ignore"; - services.logind.lidSwitchDocked = "ignore"; - - boot.tmpOnTmpfs = true; -} diff --git a/lass/1systems/hilum/disk.nix b/lass/1systems/hilum/disk.nix deleted file mode 100644 index b5199d432..000000000 --- a/lass/1systems/hilum/disk.nix +++ /dev/null @@ -1,43 +0,0 @@ -{ lib, disk, keyFile, ... }: -{ - disk = { - main = { - type = "disk"; - device = disk; - content = { - type = "table"; - format = "gpt"; - partitions = [ - { - name = "boot"; - start = "0"; - end = "1M"; - flags = ["bios_grub"]; - } - { - name = "ESP"; - start = "1M"; - end = "50%"; - bootable = true; - content = { - type = "filesystem"; - format = "vfat"; - mountpoint = "/boot"; - }; - } - { - name = "root"; - start = "50%"; - end = "100%"; - content = { - type = "filesystem"; - format = "ext4"; - mountpoint = "/"; - }; - } - ]; - }; - }; - }; -} - diff --git a/lass/1systems/hilum/flash-stick.sh b/lass/1systems/hilum/flash-stick.sh deleted file mode 100755 index 9846ea087..000000000 --- a/lass/1systems/hilum/flash-stick.sh +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/sh -set -efux - -disk=$1 - -cd "$(dirname "$0")" -export NIXPKGS_ALLOW_UNFREE=1 -(umask 077; pass show admin/hilum/luks > /tmp/hilum.luks) -trap 'rm -f /tmp/hilum.luks' EXIT -echo "$disk" > /tmp/hilum-disk -trap 'rm -f /tmp/hilum-disk' EXIT - -stockholm_root=$(git rev-parse --show-toplevel) -ssh root@localhost -t -- $(nix-build \ - --no-out-link \ - -I nixpkgs=/var/src/nixpkgs \ - -I stockholm="$stockholm_root" \ - -I secrets="$stockholm_root"/lass/2configs/tests/dummy-secrets \ - -E "with import <nixpkgs> {}; (pkgs.nixos [ - { - luksPassFile = \"/tmp/hilum.luks\"; - mainDisk = \"$disk\"; - disko.rootMountPoint = \"/mnt/hilum\"; - } - ./physical.nix - ]).disko" -) -rm -f /tmp/hilum.luks -$(nix-build \ - --no-out-link \ - -I nixpkgs=/var/src/nixpkgs \ - "$stockholm_root"/lass/krops.nix -A populate \ - --argstr name hilum \ - --argstr target "root@localhost/mnt/hilum/var/src" \ - --arg force true -) -ssh root@localhost << SSH -set -efux -mkdir -p /mnt/hilum/etc -NIXOS_CONFIG=/mnt/hilum/var/src/nixos-config nixos-install --no-bootloader --no-root-password --root /mnt/hilum -I /var/src -nixos-enter --root /mnt/hilum -- nixos-rebuild -I /var/src switch --install-bootloader -umount -Rv /mnt/hilum -SSH diff --git a/lass/1systems/hilum/physical.nix b/lass/1systems/hilum/physical.nix deleted file mode 100644 index 9caf8e531..000000000 --- a/lass/1systems/hilum/physical.nix +++ /dev/null @@ -1,53 +0,0 @@ -{ config, lib, pkgs, ... }: - -{ - imports = [ - ./config.nix - <nixpkgs/nixos/modules/installer/scan/not-detected.nix> - { - # nice hack to carry around state passed impurely at the beginning - options.mainDisk = let - tryFile = path: default: - if lib.elem (builtins.baseNameOf path) (lib.attrNames (builtins.readDir (builtins.dirOf path))) then - builtins.readFile path - else - default - ; - in lib.mkOption { - type = lib.types.str; - default = tryFile "/etc/hilum-disk" (tryFile "/tmp/hilum-disk" "/dev/sdz"); - }; - config.environment.etc.hilum-disk.text = config.mainDisk; - } - { - options.luksPassFile = lib.mkOption { - type = lib.types.nullOr lib.types.str; - default = null; - }; - } - ]; - - disko.devices = import ./disk.nix { - inherit lib; - disk = config.mainDisk; - keyFile = config.luksPassFile; - }; - - boot.initrd.availableKernelModules = [ "ehci_pci" "ahci" "xhci_pci" "usb_storage" "sd_mod" "sdhci_pci" ]; - boot.initrd.kernelModules = [ "dm-snapshot" ]; - boot.kernelModules = [ "kvm-intel" ]; - boot.extraModulePackages = [ ]; - - boot.loader.grub.enable = true; - boot.loader.grub.efiSupport = true; - boot.loader.grub.device = config.mainDisk; - boot.loader.grub.efiInstallAsRemovable = true; - - swapDevices = [ ]; - - nix.maxJobs = lib.mkDefault 4; - powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; - - #weird bug with nixos-enter - services.logrotate.enable = false; -} |