diff options
author | aszlig <aszlig@redmoonstudios.org> | 2014-07-26 07:58:13 +0200 |
---|---|---|
committer | aszlig <aszlig@redmoonstudios.org> | 2014-07-26 07:58:13 +0200 |
commit | c62aa2c212f39da7a3a1abe8d56ea41fa2286e18 (patch) | |
tree | 916dba5f7d92b7a0034ebfb0bcebdcd65c7b24f0 /machines/kzerza.nix | |
parent | fb1ddce32989fdea137f2b225ae4c24d2badf3a4 (diff) |
network: Add new machine "kzerza".
This is another USB flash drive that is used for booting directly into GrandPA, currently in use at Rockfabrik Augsburg. Signed-off-by: aszlig <aszlig@redmoonstudios.org>
Diffstat (limited to 'machines/kzerza.nix')
-rw-r--r-- | machines/kzerza.nix | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/machines/kzerza.nix b/machines/kzerza.nix new file mode 100644 index 00000000..4c7946cf --- /dev/null +++ b/machines/kzerza.nix @@ -0,0 +1,65 @@ +{ 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"; + kernelPackages = pkgs.linuxPackages_3_12; + 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; + }; + }; +} |