From 3fcbe6c5458d5866c4234695b00b500d26de0af0 Mon Sep 17 00:00:00 2001 From: Profpatsch Date: Mon, 25 Apr 2016 01:21:37 +0200 Subject: machines/labnet: generic labtop config Draws out the general config for all Labtops in its own module and creates a structure to specify the setting which are different. --- machines/labnet/labtop.nix | 134 ++++++++++++++------------------------------- 1 file changed, 42 insertions(+), 92 deletions(-) (limited to 'machines/labnet') diff --git a/machines/labnet/labtop.nix b/machines/labnet/labtop.nix index a206f93c..7cc90db7 100644 --- a/machines/labnet/labtop.nix +++ b/machines/labnet/labtop.nix @@ -1,105 +1,55 @@ -{ pkgs, lib, ... }: - +{ lib }: let - modulesPath = "${import ../../nixpkgs-path.nix}/nixos/modules"; - -in { - imports = [ "${modulesPath}/installer/scan/not-detected.nix" ]; - - boot.loader.grub.device = "/dev/disk/by-id/ata-HITACHI_HTS722010K9SA00_080711DP0270DPGLVMPC"; - - boot.kernelModules = [ "kvm-intel" ]; - boot.initrd.availableKernelModules = [ - "uhci_hcd" "ehci_pci" "ata_piix" "firewire_ohci" "usb_storage" - ]; - - i18n = { - consoleFont = "lat9w-16"; - consoleKeyMap = "us"; - defaultLocale = "de_DE.UTF-8"; - }; + compose = f: g: x: f (g x); + callMachine = import ../../lib/call-machine.nix; + mkLabtop = hostname: config: { + vuizvui.user.openlab.labtops.enable = true; + networking.hostName = hostname; + } // config; + mkLabtops = lib.mapAttrs (name: cfg: callMachine (mkLabtop name cfg) {}); - fileSystems."/" = { - device = "/dev/disk/by-uuid/754fd3e3-2e04-4028-9363-0c6bb4c54367"; - fsType = "ext4"; - }; + labtop = { + boot.loader.grub.device = "/dev/disk/by-id/ata-HITACHI_HTS722010K9SA00_080711DP0270DPGLVMPC"; - vuizvui.hardware.thinkpad.enable = true; + boot.kernelModules = [ "kvm-intel" ]; + boot.initrd.availableKernelModules = [ + "uhci_hcd" "ehci_pci" "ata_piix" "firewire_ohci" "usb_storage" + ]; - hardware.trackpoint.enable = false; + fileSystems."/" = { + device = "/dev/disk/by-uuid/754fd3e3-2e04-4028-9363-0c6bb4c54367"; + fsType = "ext4"; + }; - environment.systemPackages = with pkgs; [ - #repetierhost <- TODO - ack - antimony - blender - filezilla - firefox - fish - freecad - gcc - gnome3.gedit - gimp - git - gmpc - inkscape - ino - (libreoffice.overrideDerivation (lib.const { doCheck = false; })) - netcat-openbsd - openscad - printrun - python3 - screen - slic3r - tmux - vim - vlc - wget - ]; + vuizvui.hardware.thinkpad.enable = true; - services.xserver = { - enable = true; - layout = "us"; - xkbOptions = "eurosign:e"; + hardware.trackpoint.enable = false; - displayManager.auto.enable = true; - displayManager.auto.user = "openlab"; - desktopManager.gnome3.enable = true; - synaptics.enable = true; - synaptics.minSpeed = "0.5"; - synaptics.accelFactor = "0.01"; - }; + networking.enableIntel3945ABGFirmware = true; - services.openssh.enable = true; - - networking.networkmanager.enable = true; - networking.enableIntel3945ABGFirmware = true; - networking.hostName = "labtop"; - networking.firewall = { - allowedTCPPorts = [ 1337 2342 ]; - allowedTCPPortRanges = [ { from = 8000; to = 8005; } ]; - allowPing = true; }; - nix.maxJobs = 2; - - users.mutableUsers = false; - users.users.openlab = { - uid = 1000; - isNormalUser = true; - password = "openlab"; - extraGroups = [ "wheel" "networkmanager" "dialout"]; - openssh.authorizedKeys.keys = lib.singleton (lib.concatStrings [ - "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDJhthfk38lzDvoI7lPqRneI0yBpZEhLD" - "GRBpcXzpPSu+V0YlgrDix5fHhBl+EKfw4aeQNvQNuAky3pDtX+BDK1b7idbz9ZMCExy2a1" - "kBKDVJz/onLSQxiiZMuHlAljVj9iU4uoTOxX3vB85Ok9aZtMP1rByRIWR9e81/km4HdfZT" - "CjFVRLWfvo0s29H7l0fnbG9bb2E6kydlvjnXJnZFXX+KUM16X11lK53ilPdPJdm87VtxeS" - "KZ7GOiBz6q7FHzEd2Zc3CnzgupQiXGSblXrlN22IY3IWfm5S/8RTeQbMLVoH0TncgCeenX" - "H7FU/sXD79ypqQV/WaVVDYMOirsnh/ philip@nyx" - ]); + labhanns = { + nixpkgs.system = "i686-linux"; + boot.loader.grub.device = "/dev/sda"; + + fileSystems."/" = { + device = "/dev/sda"; + fsType = "ext4"; + }; + + networking.wireless = { + interfaces = [ "wlp2s0" ]; + }; + environment.etc."wpa_supplicant.conf".text = '' + network={ + ssid="Labor 2.0" + #psk="nerdhoehle2" + psk=5d925de5243d3a77a86e803ff6ac1f02ce7e1606f23bdb3d8ca60d90f26e8684 + } + ''; }; - # fix for emacs - programs.bash.promptInit = "PS=\"# \""; -} +in + mkLabtops { inherit labtop labhanns; } -- cgit 1.4.1