From c994b9e74a2b37dd9e9ef55565098c1e1fbce463 Mon Sep 17 00:00:00 2001 From: Profpatsch Date: Tue, 5 Jun 2018 18:21:56 +0200 Subject: machines: rename labnet to openlab MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The namespace was kind of hard to remember, so let’s just call it openlab. --- doc/install.xml | 10 +++--- machines/default.nix | 4 +-- machines/labnet/buffer.patch | 13 -------- machines/labnet/hannswurscht.nix | 70 --------------------------------------- machines/labnet/manual-setup.md | 24 -------------- machines/openlab/buffer.patch | 13 ++++++++ machines/openlab/hannswurscht.nix | 70 +++++++++++++++++++++++++++++++++++++++ machines/openlab/manual-setup.md | 24 ++++++++++++++ 8 files changed, 114 insertions(+), 114 deletions(-) delete mode 100644 machines/labnet/buffer.patch delete mode 100644 machines/labnet/hannswurscht.nix delete mode 100644 machines/labnet/manual-setup.md create mode 100644 machines/openlab/buffer.patch create mode 100644 machines/openlab/hannswurscht.nix create mode 100644 machines/openlab/manual-setup.md diff --git a/doc/install.xml b/doc/install.xml index b181dac7..c66a365e 100644 --- a/doc/install.xml +++ b/doc/install.xml @@ -21,8 +21,8 @@ - So let's say you want to install the machine labtop which - has the channel attribute channels.machines.labnet.labtops.labtop + So let's say you want to install the machine hannswurscht which + has the channel attribute channels.machines.openlab.hannswurscht @@ -33,7 +33,7 @@ nix-channel --add vuizvui + xlink:href="&hydra.channelbase;/channels.machines.openlab.hannswurscht"/> vuizvui nix-channel --remove nixos # otherwise it will interfere with the rebuild nix-channel --update @@ -55,10 +55,10 @@ nix-channel --update /etc/nixos/configuration.nix: - (import <vuizvui/machines>).labnet.labtop.config + (import <vuizvui/machines>).openlab.hannswurscht.config - Of course you need to replace labnet.labtop with the + Of course you need to replace openlab.hannswurscht with the attribute of your machine. diff --git a/machines/default.nix b/machines/default.nix index a9168d84..d15a43f1 100644 --- a/machines/default.nix +++ b/machines/default.nix @@ -17,8 +17,8 @@ with import ../lib; skunkworks = callMachine devhell/skunkworks.nix {}; titan = callMachine devhell/titan.nix {}; }; - labnet.labtops = { - hannswurscht = callMachine ./labnet/hannswurscht.nix {}; + openlab = { + hannswurscht = callMachine ./openlab/hannswurscht.nix {}; }; profpatsch = { katara = callMachine ./profpatsch/katara.nix {}; diff --git a/machines/labnet/buffer.patch b/machines/labnet/buffer.patch deleted file mode 100644 index 379b3174..00000000 --- a/machines/labnet/buffer.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/src/modules/alsa/alsa-sink.c b/src/modules/alsa/alsa-sink.c -index 2fdebe0..7042ccc 100644 ---- a/src/modules/alsa/alsa-sink.c -+++ b/src/modules/alsa/alsa-sink.c -@@ -63,7 +63,7 @@ - #define DEFAULT_DEVICE "default" - - #define DEFAULT_TSCHED_BUFFER_USEC (2*PA_USEC_PER_SEC) /* 2s -- Overall buffer size */ --#define DEFAULT_TSCHED_WATERMARK_USEC (20*PA_USEC_PER_MSEC) /* 20ms -- Fill up when only this much is left in the buffer */ -+#define DEFAULT_TSCHED_WATERMARK_USEC (500*PA_USEC_PER_MSEC) /* 500ms -- Fill up when only this much is left in the buffer */ - - #define TSCHED_WATERMARK_INC_STEP_USEC (10*PA_USEC_PER_MSEC) /* 10ms -- On underrun, increase watermark by this */ - #define TSCHED_WATERMARK_DEC_STEP_USEC (5*PA_USEC_PER_MSEC) /* 5ms -- When everything's great, decrease watermark by this */ diff --git a/machines/labnet/hannswurscht.nix b/machines/labnet/hannswurscht.nix deleted file mode 100644 index 4ef21bac..00000000 --- a/machines/labnet/hannswurscht.nix +++ /dev/null @@ -1,70 +0,0 @@ -{ pkgs, ... }: - -let - musicDir = "/data/music"; - webserverRootDir = "/var/www"; - -in { - vuizvui.user.openlab.base.enable = true; - - nixpkgs.system = "i686-linux"; - - users.users.openlab.extraGroups = [ "audio" ]; - services.mingetty.autologinUser = "openlab"; - - hardware.pulseaudio = { - enable = true; - systemWide = true; - package = pkgs.pulseaudioFull; - zeroconf.discovery.enable = false; - zeroconf.publish.enable = true; - tcp.enable = true; - tcp.anonymousClients.allowedIpRanges = [ "172.16.0.0/16" "127.0.0.1" ]; - }; - - hardware.bluetooth = { - enable = true; - extraConfig = '' - [General] - Enable=Source,Sink,Media,Socket - ''; - }; - - hardware.sane.enable = true; - services.saned = { - enable = true; - extraConfig = '' - 172.16.0.0/16 - ''; - }; - - # TODO: haskell module broken - # vuizvui.user.openlab.stackenblocken = { - # enable = true; - # volume = 35; - # }; - vuizvui.user.openlab.speedtest = { - enable = true; - outputPath = "${webserverRootDir}/speedtest.yaml"; - }; - - services.nginx = { - enable = true; - virtualHosts."hannswurscht.openlab.lan" = { - default = true; - root = webserverRootDir; - }; - }; - - # machine mostly runs headless with the screen shut - services.logind.extraConfig = "HandleLidSwitch=ignore"; - - fileSystems = { - "${musicDir}" = { - device = "ftp.openlab.lan:/data/upload/music"; - fsType = "nfs"; - label = "lab-ftp"; - options = [ "nolock" "x-systemd.automount"]; - }; - }; -} diff --git a/machines/labnet/manual-setup.md b/machines/labnet/manual-setup.md deleted file mode 100644 index 6e7f1d20..00000000 --- a/machines/labnet/manual-setup.md +++ /dev/null @@ -1,24 +0,0 @@ -# Manual setup for labtops - -## Poor man’s setup - -### Intro - -- download newest nixos setup -- write to USB stick -- boot live system - -### Install vanilla nixos - -- use parted to setup msdos table (mktable) & full-disk partition (mkpart 0% 100%) -- mkfs.ext4 -L /dev/sda1 -- mount /dev/disk/by-label/labtop /mnt -- nixos-generate-config --root mnt, comment out a few things in /mnt/etc/nixos/configuration.nix -- nixos-install -- set temporary root password (123456), will be overwritten by vuizvui -- reboot - -### Install vuizvui - -- boot, login as root -- follow “installing a machine” documentation from vuizvui wiki diff --git a/machines/openlab/buffer.patch b/machines/openlab/buffer.patch new file mode 100644 index 00000000..379b3174 --- /dev/null +++ b/machines/openlab/buffer.patch @@ -0,0 +1,13 @@ +diff --git a/src/modules/alsa/alsa-sink.c b/src/modules/alsa/alsa-sink.c +index 2fdebe0..7042ccc 100644 +--- a/src/modules/alsa/alsa-sink.c ++++ b/src/modules/alsa/alsa-sink.c +@@ -63,7 +63,7 @@ + #define DEFAULT_DEVICE "default" + + #define DEFAULT_TSCHED_BUFFER_USEC (2*PA_USEC_PER_SEC) /* 2s -- Overall buffer size */ +-#define DEFAULT_TSCHED_WATERMARK_USEC (20*PA_USEC_PER_MSEC) /* 20ms -- Fill up when only this much is left in the buffer */ ++#define DEFAULT_TSCHED_WATERMARK_USEC (500*PA_USEC_PER_MSEC) /* 500ms -- Fill up when only this much is left in the buffer */ + + #define TSCHED_WATERMARK_INC_STEP_USEC (10*PA_USEC_PER_MSEC) /* 10ms -- On underrun, increase watermark by this */ + #define TSCHED_WATERMARK_DEC_STEP_USEC (5*PA_USEC_PER_MSEC) /* 5ms -- When everything's great, decrease watermark by this */ diff --git a/machines/openlab/hannswurscht.nix b/machines/openlab/hannswurscht.nix new file mode 100644 index 00000000..4ef21bac --- /dev/null +++ b/machines/openlab/hannswurscht.nix @@ -0,0 +1,70 @@ +{ pkgs, ... }: + +let + musicDir = "/data/music"; + webserverRootDir = "/var/www"; + +in { + vuizvui.user.openlab.base.enable = true; + + nixpkgs.system = "i686-linux"; + + users.users.openlab.extraGroups = [ "audio" ]; + services.mingetty.autologinUser = "openlab"; + + hardware.pulseaudio = { + enable = true; + systemWide = true; + package = pkgs.pulseaudioFull; + zeroconf.discovery.enable = false; + zeroconf.publish.enable = true; + tcp.enable = true; + tcp.anonymousClients.allowedIpRanges = [ "172.16.0.0/16" "127.0.0.1" ]; + }; + + hardware.bluetooth = { + enable = true; + extraConfig = '' + [General] + Enable=Source,Sink,Media,Socket + ''; + }; + + hardware.sane.enable = true; + services.saned = { + enable = true; + extraConfig = '' + 172.16.0.0/16 + ''; + }; + + # TODO: haskell module broken + # vuizvui.user.openlab.stackenblocken = { + # enable = true; + # volume = 35; + # }; + vuizvui.user.openlab.speedtest = { + enable = true; + outputPath = "${webserverRootDir}/speedtest.yaml"; + }; + + services.nginx = { + enable = true; + virtualHosts."hannswurscht.openlab.lan" = { + default = true; + root = webserverRootDir; + }; + }; + + # machine mostly runs headless with the screen shut + services.logind.extraConfig = "HandleLidSwitch=ignore"; + + fileSystems = { + "${musicDir}" = { + device = "ftp.openlab.lan:/data/upload/music"; + fsType = "nfs"; + label = "lab-ftp"; + options = [ "nolock" "x-systemd.automount"]; + }; + }; +} diff --git a/machines/openlab/manual-setup.md b/machines/openlab/manual-setup.md new file mode 100644 index 00000000..6e7f1d20 --- /dev/null +++ b/machines/openlab/manual-setup.md @@ -0,0 +1,24 @@ +# Manual setup for labtops + +## Poor man’s setup + +### Intro + +- download newest nixos setup +- write to USB stick +- boot live system + +### Install vanilla nixos + +- use parted to setup msdos table (mktable) & full-disk partition (mkpart 0% 100%) +- mkfs.ext4 -L /dev/sda1 +- mount /dev/disk/by-label/labtop /mnt +- nixos-generate-config --root mnt, comment out a few things in /mnt/etc/nixos/configuration.nix +- nixos-install +- set temporary root password (123456), will be overwritten by vuizvui +- reboot + +### Install vuizvui + +- boot, login as root +- follow “installing a machine” documentation from vuizvui wiki -- cgit 1.4.1