about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--nixos/default.nix9
-rw-r--r--nixos/modules/default.nix1
-rw-r--r--nixos/modules/ec2.nix9
-rw-r--r--nixos/selenium/configuration.nix18
-rw-r--r--nixos/selenium/hardware-configuration.nix5
5 files changed, 42 insertions, 0 deletions
diff --git a/nixos/default.nix b/nixos/default.nix
index 31d1a61..95eee0f 100644
--- a/nixos/default.nix
+++ b/nixos/default.nix
@@ -20,4 +20,13 @@
       ./modules/security.nix
     ];
   };
+
+  selenium = self.lib.mkSystem {
+    name = "selenium";
+    nixpkgs = unstable-small;
+    extraModules = [
+      ./modules/security.nix
+      ./modules/ec2.nix
+    ];
+  };
 }
diff --git a/nixos/modules/default.nix b/nixos/modules/default.nix
index 4469650..c5d40e2 100644
--- a/nixos/modules/default.nix
+++ b/nixos/modules/default.nix
@@ -3,4 +3,5 @@
   flake = import ./flake.nix;
   nix = import ./nix.nix;
   security = import ./security.nix;
+  ec2 = import ./ec2.nix;
 }
diff --git a/nixos/modules/ec2.nix b/nixos/modules/ec2.nix
new file mode 100644
index 0000000..45f3cd8
--- /dev/null
+++ b/nixos/modules/ec2.nix
@@ -0,0 +1,9 @@
+{ modulesPath, config, lib, ... }:
+
+{
+  # AWS EC2-specific tweaks
+  imports = [
+    "${modulesPath}/virtualisation/amazon-image.nix"
+  ];
+  ec2.hvm = true;
+}
diff --git a/nixos/selenium/configuration.nix b/nixos/selenium/configuration.nix
new file mode 100644
index 0000000..e099f02
--- /dev/null
+++ b/nixos/selenium/configuration.nix
@@ -0,0 +1,18 @@
+{ config, pkgs, lib, ... }:
+
+{
+  imports = [ ];
+
+  users.users.worker = {
+    isNormalUser = true;
+    extraGroups = [ "wheel" ];
+    openssh.authorizedKeys.keys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAic4niJKrBKyTzTbpldaEiU30vS9/jkZl3yZRnu6d9O zach@zachel.io" ];
+  };
+
+  # This value determines the NixOS release with which your system is to be
+  # compatible, in order to avoid breaking some software such as database
+  # servers. You should change this only after NixOS release notes say you
+  # should.
+  system.stateVersion = "22.05"; # Did you read the comment?
+
+}
diff --git a/nixos/selenium/hardware-configuration.nix b/nixos/selenium/hardware-configuration.nix
new file mode 100644
index 0000000..0b508ec
--- /dev/null
+++ b/nixos/selenium/hardware-configuration.nix
@@ -0,0 +1,5 @@
+{ config, lib, pkgs, ... }:
+
+{
+  nix.settings.max-jobs = lib.mkDefault 4;
+}