2 { pkgs, lib, config, ... }:
4 systemConfig = { pkgs, ... }: {
5 # passwordless ssh server
8 permitRootLogin = "yes";
9 extraConfig = "PermitEmptyPasswords yes";
15 extraUsers."build" = {
18 extraGroups = [ "wheel" ];
21 users.root.password = "";
24 security.sudo.wheelNeedsPassword = false;
25 nix.settings.trusted-users = [ "root" "build" ];
26 documentation.nixos.enable = false;
28 # builds.sr.ht-image-specific network settings
31 dhcpcd.enable = false;
32 defaultGateway.address = "10.0.2.2";
33 usePredictableInterfaceNames = false; # so that we just get eth0 and not some weird id
34 interfaces."eth0".ipv4.addresses = [{
35 address = "10.0.2.15";
43 # Google as a fallback :(
46 firewall.allowedTCPPorts = [ 22 ]; # allow ssh
49 environment.systemPackages = [
56 qemuConfig = { pkgs, ... }: {
57 imports = [ systemConfig ];
58 fileSystems."/".device = "/dev/disk/by-label/nixos";
59 boot.initrd.availableKernelModules = [
79 config = (import (pkgs.path + "/nixos/lib/eval-config.nix") {
80 inherit pkgs system; modules = [ qemuConfig ];
83 import (pkgs.path + "/nixos/lib/make-disk-image.nix") {
84 inherit pkgs lib config;
86 format = "qcow2-compressed";
88 { source = pkgs.writeText "gitconfig" ''
93 target = "/home/build/.gitconfig";