summaryrefslogtreecommitdiffstats
path: root/makefu/1systems/shack-autoinstall/config.nix
blob: d53c411c05c7548fce208e9192cd5f6e5355d1c0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
{ config, pkgs, lib, ... }:

with import <stockholm/lib>;
let
  disk = "/dev/sda";
in {
  imports = [
    <stockholm/makefu>
    <nixpkgs/nixos/modules/installer/cd-dvd/installation-cd-minimal.nix>
    <nixpkgs/nixos/modules/installer/cd-dvd/channel.nix>
    <stockholm/makefu/2configs/tools/core.nix>
  ];
  # TODO: NIX_PATH and nix.nixPath are being set by default.nix right now
  # cd ~/stockholm ; nix-build -A config.system.build.isoImage -I nixos-config=makefu/1systems/iso.nix -I secrets=/home/makefu/secrets/iso /var/src/nixpkgs/nixos
  krebs.build.host = config.krebs.hosts.iso;
  krebs.hidden-ssh.enable = true;

  environment.extraInit = ''
    EDITOR=vim
  '';
  # iso-specific
  boot.kernelParams = [ "copytoram" ];


  environment.systemPackages = [
    pkgs.parted
    (  pkgs.writeScriptBin "shack-install" ''
      #! /bin/sh
      echo "go ahead and try NIX_PATH=/root/.nix-defexpr/channels/ nixos-install"
    '')
  ];

  systemd.services.wpa_supplicant.wantedBy = lib.mkForce [ "multi-user.target" ];

  networking.wireless = {
    enable = true;
    networks.shack.psk = "welcome2shack";
  };


  services.openssh = {
    enable = true;
    hostKeys = [
      { bits = 8192; type = "ed25519"; path = "/etc/ssh/ssh_host_ed25519_key"; }
    ];
  };
  # enable ssh in the iso boot process
  systemd.services.sshd.wantedBy = lib.mkForce [ "multi-user.target" ];
}