WIP: configure bikkje as login server #24

Draft
felixalb wants to merge 5 commits from setup-bikkje-login into main
5 changed files with 126 additions and 44 deletions
Showing only changes of commit 5e30f30ac2 - Show all commits

View File

@ -1,44 +0,0 @@
{ config, pkgs, values, ... }:
{
networking.nat = {
enable = true;
internalInterfaces = ["ve-+"];
externalInterface = "ens3";
# Lazy IPv6 connectivity for the container
enableIPv6 = true;
};
containers.bikkje = {
autoStart = true;
config = { config, pkgs, ... }: {
#import packages
packages = with pkgs; [
alpine
mutt
mutt-ics
mutt-wizard
weechat
weechatScripts.edit
hexchat
irssi
pidgin
];
networking = {
firewall = {
enable = true;
# Allow SSH and HTTP and ports for email and irc
allowedTCPPorts = [ 80 22 194 994 6665 6666 6667 6668 6669 6697 995 993 25 465 587 110 143 993 995 ];
allowedUDPPorts = [ 80 22 194 994 6665 6666 6667 6668 6669 6697 995 993 25 465 587 110 143 993 995 ];
};
# Use systemd-resolved inside the container
# Workaround for bug https://github.com/NixOS/nixpkgs/issues/162686
useHostResolvConf = mkForce false;
};
system.stateVersion = "23.11";
services.resolved.enable = true;
};
};
};

104
hosts/buskerud/bikkje.nix Normal file
View File

@ -0,0 +1,104 @@
{ config, pkgs, values, lib, ... }:
{
containers.bikkje = {
autoStart = true;
interfaces = [ "enp14s0f1" ];
config = { config, pkgs, ... }: {
environment.systemPackages = with pkgs; [
zsh
bash
fish
tcsh
alpine
mutt
mutt-ics
mutt-wizard
notmuch
mailutils
procmail
irssi
weechat
weechatScripts.edit
coreutils-full
cvs
gawk
git
gnupg
gnused
groff
less
p7zip
rcs
screen
tmux
tree
unzip
zip
emacs
helix
joe
micro
nano
neovim
autossh
inetutils
lynx
mosh
rsync
w3m
clang
gcc
guile
lua
perl
php
python3
#(with python3Packages; [
# numpy
# requests
#])
ruby
tcl
];
services.openssh = {
enable = true;
ports = [ 22 80 443 ];
openFirewall = true;
extraConfig = ''
PubkeyAcceptedAlgorithms=+ssh-rsa
'';
settings.GatewayPorts = "yes";
banner = builtins.readFile ../../motd;
};
networking = {
firewall.enable = true;
# Use systemd-resolved inside the container
# Workaround for bug https://github.com/NixOS/nixpkgs/issues/162686
useHostResolvConf = lib.mkForce false;
hostName = "bikkje";
};
systemd.network.networks."30-enp14s0f1" = values.defaultNetworkConfig // {
matchConfig.Name = "enp14s0f1";
address = with values.hosts.bikkje; [ (ipv4 + "/25") (ipv6 + "/64") ];
};
system.stateVersion = "23.11";
services.resolved.enable = true;
};
};
# TODO
# - Kerberos Authentication
# - Home directory mounts
# - Mail Transfer Agent
}

View File

@ -4,6 +4,8 @@
./hardware-configuration.nix
../../base.nix
../../misc/metrics-exporters.nix
./bikkje.nix
];
# buskerud does not support efi?

16
motd Normal file
View File

@ -0,0 +1,16 @@
███████████ █████ █████ █████ █████
░░███░░░░░███░░███ ░░███ ░░███ ░░███
░███ ░███ ░███ ░███ ░███ ░███
░██████████ ░███ ░███ ░███ ░███
░███░░░░░░ ░░███ ███ ░░███ ███
░███ ░░░█████░ ░░░█████░
█████ ░░███ ░░███
░░░░░ ░░░ ░░░
================= EN ==================|================== NB =================
Welcome to a PVV machine, life is good.|Velkommen til en PVV-maskin,
|livet er deilig.
If you are confused, try pvv.ntnu.no or|Hvis du er forvirret prøv pvv.ntnu.no
our discord server. |eller vår discord-server.
More info at pvv.ntnu.no/kontakt/ |Mer info på pvv.ntnu.no/kontakt/
===============================================================================

View File

@ -56,6 +56,10 @@ in rec {
ipv4 = pvv-ipv4 204;
ipv6 = pvv-ipv6 "1:4f"; # Wtf øystein og daniel why
};
bikkje = {
ipv4 = pvv-ipv4 216;
ipv6 = pvv-ipv6 216;
};
buskerud = {
ipv4 = pvv-ipv4 231;
ipv6 = pvv-ipv6 231;