2020-10-28 20:29:41 +01:00
|
|
|
{ config, pkgs, lib, ... }:
|
2021-10-12 11:51:55 +02:00
|
|
|
let
|
|
|
|
|
inherit (import <niveum/lib>) retiolumAddresses;
|
|
|
|
|
in
|
2020-10-31 20:52:10 +01:00
|
|
|
{
|
2020-10-28 20:29:41 +01:00
|
|
|
imports = [
|
|
|
|
|
./hardware-configuration.nix
|
2021-02-07 16:08:11 +01:00
|
|
|
<home-manager/nixos>
|
2021-09-17 11:12:23 +02:00
|
|
|
<niveum/configs/wpa_supplicant.nix>
|
2020-10-28 20:29:41 +01:00
|
|
|
<niveum/configs/keyboard.nix>
|
|
|
|
|
<niveum/modules/retiolum.nix>
|
|
|
|
|
<niveum/configs/spacetime.nix>
|
2021-06-28 08:23:25 +02:00
|
|
|
<niveum/configs/tuna.nix>
|
2020-10-28 21:43:33 +01:00
|
|
|
<niveum/configs/sshd.nix>
|
2020-10-31 20:52:10 +01:00
|
|
|
<niveum/configs/version.nix>
|
2021-07-06 22:51:20 +02:00
|
|
|
<niveum/configs/printing.nix>
|
|
|
|
|
<niveum/configs/traadfri.nix>
|
2021-10-10 12:42:47 +02:00
|
|
|
<niveum/configs/bvg.nix>
|
2021-09-18 14:24:32 +02:00
|
|
|
<niveum/configs/moodle-dl/meinhark.nix>
|
2021-09-18 23:54:12 +02:00
|
|
|
<niveum/configs/monitoring/push.nix>
|
2021-07-06 22:55:48 +02:00
|
|
|
{
|
2021-07-08 07:52:03 +02:00
|
|
|
nixpkgs.config.allowUnfree = true;
|
2021-07-06 22:55:48 +02:00
|
|
|
}
|
2020-10-28 20:29:41 +01:00
|
|
|
{
|
2020-10-28 21:43:33 +01:00
|
|
|
sound.enable = true;
|
2021-03-23 20:28:08 +01:00
|
|
|
|
|
|
|
|
hardware.pulseaudio = {
|
|
|
|
|
enable = true;
|
|
|
|
|
systemWide = true;
|
2021-03-24 20:25:48 +01:00
|
|
|
tcp = {
|
|
|
|
|
enable = true;
|
|
|
|
|
anonymousClients.allowedIpRanges = [ "127.0.0.1" "10.243.2.0/24" "192.168.0.0/16" ];
|
|
|
|
|
};
|
|
|
|
|
zeroconf.publish.enable = true;
|
2021-03-23 20:28:08 +01:00
|
|
|
};
|
|
|
|
|
networking.firewall.allowedTCPPorts = [ 4713 ];
|
2020-10-28 21:43:33 +01:00
|
|
|
}
|
2021-01-20 07:47:13 +01:00
|
|
|
{
|
2021-01-23 17:12:08 +01:00
|
|
|
environment.systemPackages =
|
|
|
|
|
let
|
|
|
|
|
worldradio = pkgs.callPackage <niveum/packages/worldradio.nix> {};
|
|
|
|
|
in [
|
2021-01-20 07:47:13 +01:00
|
|
|
(pkgs.writers.writeDashBin "mpv" ''
|
|
|
|
|
${pkgs.mpv}/bin/mpv --no-video "$@"
|
|
|
|
|
'')
|
2021-01-23 17:12:08 +01:00
|
|
|
(pkgs.writers.writeDashBin "worldradio" ''
|
|
|
|
|
shuf ${worldradio} | ${pkgs.findutils}/bin/xargs ${pkgs.mpv}/bin/mpv --no-video
|
|
|
|
|
'')
|
2021-01-20 07:47:13 +01:00
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
{
|
2021-01-27 09:19:21 +01:00
|
|
|
users.extraUsers.kiosk = {
|
|
|
|
|
isNormalUser = true;
|
|
|
|
|
password = "";
|
|
|
|
|
extraGroups = [ "audio" ];
|
|
|
|
|
};
|
|
|
|
|
services.cage = {
|
|
|
|
|
enable = true;
|
|
|
|
|
user = config.users.extraUsers.kiosk.name;
|
|
|
|
|
extraArguments = [ "-s" ]; # allow vt switching
|
|
|
|
|
program =
|
2021-10-10 12:42:47 +02:00
|
|
|
let startUrls = [ "https://open.spotify.com" "http://localhost:${toString config.services.tuna.webPort}" "http://bvg.kmein.r" ];
|
2021-01-27 09:19:21 +01:00
|
|
|
in pkgs.writers.writeDash "kiosk-browser" ''
|
|
|
|
|
while true; do
|
|
|
|
|
${pkgs.chromium}/bin/chromium \
|
|
|
|
|
--no-first-run --no-message-box --noerrdialogs \
|
|
|
|
|
--default-browser --no-default-browser-check \
|
2021-06-26 09:01:07 +02:00
|
|
|
--start-maximized ${lib.escapeShellArgs startUrls}
|
2021-01-27 09:19:21 +01:00
|
|
|
sleep 0.5
|
|
|
|
|
done
|
|
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
systemd.services.cage-tty1.environment.XKB_DEFAULT_LAYOUT = "de";
|
|
|
|
|
programs.chromium = {
|
|
|
|
|
enable = true;
|
|
|
|
|
extensions = [
|
|
|
|
|
"cjpalhdlnbpafiamejdnhcphjbkeiagm" # uBlock Origin
|
|
|
|
|
];
|
|
|
|
|
};
|
2021-02-07 16:08:11 +01:00
|
|
|
}
|
|
|
|
|
{
|
2021-01-20 07:47:13 +01:00
|
|
|
environment.systemPackages = [ pkgs.tmux ];
|
|
|
|
|
systemd.services.turntables = {
|
|
|
|
|
description = "music controller session";
|
|
|
|
|
after = [ "network.target" ];
|
|
|
|
|
wantedBy = [ "multi-user.target" ];
|
|
|
|
|
path = [ pkgs.alacritty.terminfo ];
|
|
|
|
|
script = ''
|
2021-01-26 23:04:22 +01:00
|
|
|
${pkgs.tmux}/bin/tmux -2 new-session -d -s turntables ${pkgs.alsaUtils}/bin/alsamixer \; new-window
|
2021-01-20 07:47:13 +01:00
|
|
|
'';
|
|
|
|
|
preStop = "${pkgs.tmux}/bin/tmux kill-session -t turntables";
|
|
|
|
|
serviceConfig = {
|
|
|
|
|
User = "root";
|
|
|
|
|
RemainAfterExit = true;
|
|
|
|
|
Type = "oneshot";
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
}
|
2020-10-28 20:29:41 +01:00
|
|
|
];
|
|
|
|
|
|
|
|
|
|
nix.nixPath = [ "/var/src" ];
|
|
|
|
|
|
|
|
|
|
services.logind = {
|
|
|
|
|
lidSwitch = "ignore";
|
|
|
|
|
lidSwitchDocked = "ignore";
|
|
|
|
|
lidSwitchExternalPower = "ignore";
|
2019-06-17 19:11:31 +02:00
|
|
|
};
|
|
|
|
|
|
2020-10-28 20:29:41 +01:00
|
|
|
services.illum.enable = true;
|
|
|
|
|
|
|
|
|
|
environment.systemPackages = with pkgs; [ git vim htop ];
|
|
|
|
|
|
2019-09-24 16:46:43 +02:00
|
|
|
boot.loader.systemd-boot = {
|
|
|
|
|
enable = true;
|
|
|
|
|
configurationLimit = 5;
|
|
|
|
|
};
|
|
|
|
|
|
2019-01-30 17:08:07 +01:00
|
|
|
boot.loader.efi.canTouchEfiVariables = true;
|
|
|
|
|
|
2020-10-28 21:56:14 +01:00
|
|
|
networking.hostName = "zaatar";
|
2021-06-16 21:59:33 +02:00
|
|
|
networking.wireless.interfaces = [ "wlp2s0" ];
|
2019-01-30 17:08:07 +01:00
|
|
|
|
2021-10-12 11:51:55 +02:00
|
|
|
networking.retiolum = retiolumAddresses.zaatar;
|
2020-01-24 08:57:39 +01:00
|
|
|
|
2020-10-28 20:29:41 +01:00
|
|
|
system.stateVersion = "20.09";
|
2019-01-30 17:08:07 +01:00
|
|
|
}
|