about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--machines/labnet/labtops.nix2
-rw-r--r--modules/module-list.nix1
-rw-r--r--modules/user/openlab/base.nix74
-rw-r--r--modules/user/openlab/labtops.nix57
4 files changed, 80 insertions, 54 deletions
diff --git a/machines/labnet/labtops.nix b/machines/labnet/labtops.nix
index 52643cce..cc524fbd 100644
--- a/machines/labnet/labtops.nix
+++ b/machines/labnet/labtops.nix
@@ -1,5 +1,6 @@
 {
   labtop = {
+    vuizvui.user.openlab.labtops.enable = true;
     boot.kernelModules = [ "kvm-intel" ];
     boot.initrd.availableKernelModules = [
       "uhci_hcd" "ehci_pci" "ata_piix" "firewire_ohci" "usb_storage"
@@ -14,6 +15,7 @@
   };
 
   hannswurscht = {
+    vuizvui.user.openlab.base.enable = true;
     nixpkgs.system = "i686-linux";
   };
 }
diff --git a/modules/module-list.nix b/modules/module-list.nix
index f48d40f5..e9b3eb05 100644
--- a/modules/module-list.nix
+++ b/modules/module-list.nix
@@ -26,6 +26,7 @@
   ./user/aszlig/services/slim
   ./user/aszlig/services/vlock
   ./user/aszlig/system/kernel.nix
+  ./user/openlab/base.nix
   ./user/openlab/labtops.nix
   ./user/profpatsch/programs/scanning.nix
 ]
diff --git a/modules/user/openlab/base.nix b/modules/user/openlab/base.nix
new file mode 100644
index 00000000..70d8ee5c
--- /dev/null
+++ b/modules/user/openlab/base.nix
@@ -0,0 +1,74 @@
+{ config, pkgs, lib, ... }:
+
+with lib;
+
+let
+  cfg = config.vuizvui.user.openlab.base;
+
+in
+{
+
+  options.vuizvui.user.openlab.base.enable =
+    mkEnableOption "the base OpenLab configuration";
+
+
+  config = mkIf cfg.enable {
+    boot.loader.grub.device = mkDefault "/dev/sda";
+
+    fileSystems."/" = mkDefault {
+      device = "/dev/disk/by-label/labtop";
+      fsType = "ext4";
+    };
+
+    i18n = {
+      consoleFont = "lat9w-16";
+      consoleKeyMap = "us";
+      defaultLocale = "de_DE.UTF-8";
+    };
+
+    hardware.enableAllFirmware = true;
+
+    # TODO: filesystems 
+
+    environment.systemPackages = with pkgs; let
+      base = [
+        ack
+        fish
+        git
+        netcat-openbsd
+        python3
+        tmux
+        screen
+        vim
+        wget
+      ];
+      in base;
+
+      
+    services.openssh.enable = true;
+
+    networking.firewall.enable = false;
+    networking.wireless = {
+      enable = true;
+      networks."Labor 2.0".psk = "nerdhoehle2";
+    };
+
+    users.mutableUsers = false;
+    users.users.openlab = {
+      uid = 1000;
+      isNormalUser = true;
+      password = "openlab";
+      extraGroups = [ "wheel" ];
+      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"
+      ]);
+    };
+  };
+
+}
\ No newline at end of file
diff --git a/modules/user/openlab/labtops.nix b/modules/user/openlab/labtops.nix
index cfacf700..72f9d504 100644
--- a/modules/user/openlab/labtops.nix
+++ b/modules/user/openlab/labtops.nix
@@ -10,39 +10,15 @@ in
 
   options.vuizvui.user.openlab.labtops = {
     enable = mkEnableOption "basic shared functionality of labtops";
-
   };
 
 
-
   config = mkIf cfg.enable {
-    boot.loader.grub.device = mkDefault "/dev/sda";
-    fileSystems."/" = mkDefault {
-      device = "/dev/disk/by-label/labtop";
-      fsType = "ext4";
-    };
 
-    i18n = {
-      consoleFont = "lat9w-16";
-      consoleKeyMap = "us";
-      defaultLocale = "de_DE.UTF-8";
-    };
-
-    # TODO: filesystems 
+    vuizvui.user.openlab.base.enable = true;
 
     # TODO: a way to modularly specify usage patterns (e.g. 3d-printing, arduino &c.)
     environment.systemPackages = with pkgs; let
-      base = [
-        ack
-        fish
-        git
-        netcat-openbsd
-        python3
-        tmux
-        screen
-        vim
-        wget
-      ];
       baseGUI = [
         filezilla
         chromium
@@ -72,7 +48,7 @@ in
         ino
         arduino
       ];
-      in base ++ baseGUI ++ image ++ three-d ++ three-d-printing ++ arduinoPkgs;
+      in baseGUI ++ image ++ three-d ++ three-d-printing ++ arduinoPkgs;
 
     services.xserver = {
       enable = true;
@@ -89,34 +65,7 @@ in
       };
     };
 
-    services.openssh.enable = true;
-
-    networking.firewall.enable = false;
-    networking.wireless = {
-      enable = true;
-      networks."Labor 2.0".psk = "nerdhoehle2";
-    };
-
-    # TODO: an argument that tells about hardware capability
-    nix.maxJobs = 2;
-    hardware.enableAllFirmware = true;
-
-    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"
-      ]);
-    };
+    users.users.openlab.extraGroups = [ "dialout" ];
 
     # fix for emacs
     programs.bash.promptInit = "PS=\"# \"";