about summary refs log tree commit diff
path: root/machines/aszlig/kzerza.nix
diff options
context:
space:
mode:
authoraszlig <aszlig@redmoonstudios.org>2015-03-18 01:37:41 +0100
committeraszlig <aszlig@redmoonstudios.org>2015-03-18 01:42:55 +0100
commit2b8256b060f1c2fd635e92749d167d9a57268212 (patch)
tree211ae22d25aaa9cecc6a7d261737f53335cc1e7b /machines/aszlig/kzerza.nix
parent174317d1489b72687df8559a9cc02ca068e2ba0c (diff)
machines: Move own machines into machines/aszlig.
Introduces callMachine in machines/default.nix, which returns an
attribute set containing the (input) configuration and also a build
attribute containing the output configuration and thus also the builds.

However, we still have references to ../../common-workstation.nix which
we need to refactor very soon.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
Diffstat (limited to 'machines/aszlig/kzerza.nix')
-rw-r--r--machines/aszlig/kzerza.nix64
1 files changed, 64 insertions, 0 deletions
diff --git a/machines/aszlig/kzerza.nix b/machines/aszlig/kzerza.nix
new file mode 100644
index 00000000..a0ca1e5d
--- /dev/null
+++ b/machines/aszlig/kzerza.nix
@@ -0,0 +1,64 @@
+{ pkgs, lib, ... }:
+
+with lib;
+
+let
+  rootUUID = "ad41f848-d14a-4a89-9d04-3e48bd73dc5c";
+  diskID = "usb-0000_Removable_Drive_23372707080836980013-0:0";
+in {
+  imports = singleton ../../common.nix;
+
+  services.xserver.enable = mkForce false;
+
+  boot = {
+    kernelParams = singleton "consoleblank=0";
+    initrd.kernelModules = [ "fbcon" "usb_storage" ];
+    loader.grub.device = "/dev/disk/by-id/${diskID}";
+  };
+
+  networking.hostName = "kzerza";
+
+  fileSystems."/".device = "/dev/disk/by-uuid/${rootUUID}";
+  fileSystems."/".fsType = "btrfs";
+  fileSystems."/".options = concatStringsSep "," [
+    "ssd"
+    "space_cache"
+    "compress-force=zlib"
+    "noatime"
+  ];
+
+  services.udev.extraRules = ''
+    SUBSYSTEM=="usb*|tty", ACTION=="add|change", ATTRS{idVendor}=="0403", \
+      ATTRS{idProduct}=="6001", OWNER="grandpa"
+  '';
+
+  fileSystems."/tmp".device = "none";
+  fileSystems."/tmp".fsType = "tmpfs";
+  fileSystems."/tmp".options = "nosuid,nodev,relatime";
+
+  users.extraGroups.grandpa.gid = 666;
+  users.extraUsers.grandpa = {
+    uid = 666;
+    description = "GrandPA User";
+    group = "grandpa";
+    createHome = true;
+  };
+
+  systemd.services.grandpa = {
+    description = "GrandPA Lighting Controller";
+    wantedBy = [ "multi-user.target" ];
+    preStart = "${pkgs.kbd}/bin/chvt 7";
+    serviceConfig = {
+      Type = "idle";
+      ExecStart = "${pkgs.grandpa}/bin/grandpa";
+      StandardInput = "tty";
+      StandardOutput = "tty";
+      TTYPath = "/dev/tty7";
+      TTYVTDisallocate = true;
+      User = "grandpa";
+      Group = "grandpa";
+      PrivateTmp = true;
+      PrivateNetwork = true;
+    };
+  };
+}