Compare commits
7 Commits
setup-bikk
...
misc-extra
Author | SHA1 | Date | |
---|---|---|---|
1fbee584a2
|
|||
fe4dd21acb | |||
0336744124 | |||
b4d6e00622 | |||
7c6d4d31c7 | |||
9f46be1ca1 | |||
545583cf04 |
@@ -3,6 +3,7 @@ keys:
|
|||||||
- &user_danio age17tagmpwqjk3mdy45rfesrfey6h863x8wfq38wh33tkrlrywxducs0k6tpq
|
- &user_danio age17tagmpwqjk3mdy45rfesrfey6h863x8wfq38wh33tkrlrywxducs0k6tpq
|
||||||
- &user_felixalb age1mrnldl334l2nszuta6ywvewng0fswv2dz9l5g4qcwe3nj4yxf92qjskdx6
|
- &user_felixalb age1mrnldl334l2nszuta6ywvewng0fswv2dz9l5g4qcwe3nj4yxf92qjskdx6
|
||||||
- &user_oysteikt F7D37890228A907440E1FD4846B9228E814A2AAC
|
- &user_oysteikt F7D37890228A907440E1FD4846B9228E814A2AAC
|
||||||
|
- &user_eirikwit age1ju7rd26llahz3g8tz7cy5ld52swj8gsmg0flrmrxngc0nj0avq3ssh0sn5
|
||||||
|
|
||||||
# Hosts
|
# Hosts
|
||||||
- &host_jokum age1gp8ye4g2mmw3may5xg0zsy7mm04glfz3788mmdx9cvcsdxs9hg0s0cc9kt
|
- &host_jokum age1gp8ye4g2mmw3may5xg0zsy7mm04glfz3788mmdx9cvcsdxs9hg0s0cc9kt
|
||||||
@@ -18,6 +19,7 @@ creation_rules:
|
|||||||
- *host_jokum
|
- *host_jokum
|
||||||
- *user_danio
|
- *user_danio
|
||||||
- *user_felixalb
|
- *user_felixalb
|
||||||
|
- *user_eirikwit
|
||||||
pgp:
|
pgp:
|
||||||
- *user_oysteikt
|
- *user_oysteikt
|
||||||
|
|
||||||
|
1
base.nix
1
base.nix
@@ -73,7 +73,6 @@
|
|||||||
|
|
||||||
# Trusted users on the nix builder machines
|
# Trusted users on the nix builder machines
|
||||||
users.groups."nix-builder-users".name = "nix-builder-users";
|
users.groups."nix-builder-users".name = "nix-builder-users";
|
||||||
users.motd = builtins.readFile ./misc/motd;
|
|
||||||
|
|
||||||
services.openssh = {
|
services.openssh = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
57
flake.lock
generated
57
flake.lock
generated
@@ -7,11 +7,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1702569759,
|
"lastModified": 1710169806,
|
||||||
"narHash": "sha256-Ze3AdEEsVZBRJ4wn13EZpV1Uubkzi59TkC4j2G9xoFI=",
|
"narHash": "sha256-HeWFrRuHpnAiPmIr26OKl2g142HuGerwoO/XtW53pcI=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "disko",
|
"repo": "disko",
|
||||||
"rev": "98ab91109716871f50ea8cb0e0ac7cc1e1e14714",
|
"rev": "fe064a639319ed61cdf12b8f6eded9523abcc498",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -62,14 +62,16 @@
|
|||||||
},
|
},
|
||||||
"matrix-next": {
|
"matrix-next": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs-lib": "nixpkgs-lib"
|
"nixpkgs": [
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1701507532,
|
"lastModified": 1710311999,
|
||||||
"narHash": "sha256-Zzv8OFB7iilzDGe6z2t/j8qRtR23TN3N8LssGsvRWEA=",
|
"narHash": "sha256-s0pT1NyrMgeolUojXXcnXQDymN7m80GTF7itCv0ZH20=",
|
||||||
"owner": "dali99",
|
"owner": "dali99",
|
||||||
"repo": "nixos-matrix-modules",
|
"repo": "nixos-matrix-modules",
|
||||||
"rev": "046194cdadc50d81255a9c57789381ed1153e2b1",
|
"rev": "6c9b67974b839740e2a738958512c7a704481157",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -80,11 +82,11 @@
|
|||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1702601832,
|
"lastModified": 1710248792,
|
||||||
"narHash": "sha256-z+GyetKtwj7ZVZrRcI73N8Xy1B3JGAqDyPniBFRpIgo=",
|
"narHash": "sha256-yFyWw4na+nJgtXwhHs2SJSy5Lcw94/FcMbBOorlGdfI=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "dff64d4ba6e9dc3f0a4ef8737f372a528d5bc8d1",
|
"rev": "efbb274f364c918b9937574de879b5874b5833cc",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -93,44 +95,29 @@
|
|||||||
"type": "indirect"
|
"type": "indirect"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs-lib": {
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1673743903,
|
|
||||||
"narHash": "sha256-sloY6KYyVOozJ1CkbgJPpZ99TKIjIvM+04V48C04sMQ=",
|
|
||||||
"owner": "nix-community",
|
|
||||||
"repo": "nixpkgs.lib",
|
|
||||||
"rev": "7555e2dfcbac1533f047021f1744ac8871150f9f",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "nix-community",
|
|
||||||
"repo": "nixpkgs.lib",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"nixpkgs-stable": {
|
"nixpkgs-stable": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1702148972,
|
"lastModified": 1710033658,
|
||||||
"narHash": "sha256-h2jODFP6n+ABrUWcGRSVPRFfLOkM9TJ2pO+h+9JcaL0=",
|
"narHash": "sha256-yiZiVKP5Ya813iYLho2+CcFuuHpaqKc/CoxOlANKcqM=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "b8f33c044e51de6dde3ad80a9676945e0e4e3227",
|
"rev": "b17375d3bb7c79ffc52f3538028b2ec06eb79ef8",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"ref": "release-23.05",
|
"ref": "release-23.11",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs-unstable": {
|
"nixpkgs-unstable": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1702635820,
|
"lastModified": 1710247538,
|
||||||
"narHash": "sha256-rClms9NTmSL/WIN5VmEccVhUExMkjCrRNswxU9QGNNo=",
|
"narHash": "sha256-Mm3aCwfAdYgG2zKf5SLRBktPH0swXN1yEetAMn05KAA=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "02357adddd0889782362d999628de9d309d202dc",
|
"rev": "21adc4f16a8ab151fec83b9d9368cd62d9de86bc",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -179,11 +166,11 @@
|
|||||||
"nixpkgs-stable": "nixpkgs-stable"
|
"nixpkgs-stable": "nixpkgs-stable"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1702177193,
|
"lastModified": 1710195194,
|
||||||
"narHash": "sha256-J2409SyXROoUHYXVy9h4Pj0VU8ReLuy/mzBc9iK4DBg=",
|
"narHash": "sha256-KFxCJp0T6TJOz1IOKlpRdpsCr9xsvlVuWY/VCiAFnTE=",
|
||||||
"owner": "Mic92",
|
"owner": "Mic92",
|
||||||
"repo": "sops-nix",
|
"repo": "sops-nix",
|
||||||
"rev": "d806e546f96c88cd9f7d91c1c19ebc99ba6277d9",
|
"rev": "e52d8117b330f690382f1d16d81ae43daeb4b880",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@@ -15,6 +15,7 @@
|
|||||||
pvv-calendar-bot.inputs.nixpkgs.follows = "nixpkgs";
|
pvv-calendar-bot.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
|
||||||
matrix-next.url = "github:dali99/nixos-matrix-modules";
|
matrix-next.url = "github:dali99/nixos-matrix-modules";
|
||||||
|
matrix-next.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
|
||||||
grzegorz.url = "github:Programvareverkstedet/grzegorz";
|
grzegorz.url = "github:Programvareverkstedet/grzegorz";
|
||||||
grzegorz.inputs.nixpkgs.follows = "nixpkgs-unstable";
|
grzegorz.inputs.nixpkgs.follows = "nixpkgs-unstable";
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
{ config, values, pkgs, ... }:
|
{ config, values, pkgs, lib, ... }:
|
||||||
let
|
let
|
||||||
cfg = config.services.gitea;
|
cfg = config.services.gitea;
|
||||||
domain = "git.pvv.ntnu.no";
|
domain = "git.pvv.ntnu.no";
|
||||||
@@ -32,12 +32,18 @@ in {
|
|||||||
};
|
};
|
||||||
|
|
||||||
settings = {
|
settings = {
|
||||||
|
dump = {
|
||||||
|
enable = true;
|
||||||
|
interval = "monthly";
|
||||||
|
};
|
||||||
|
|
||||||
server = {
|
server = {
|
||||||
DOMAIN = domain;
|
DOMAIN = domain;
|
||||||
ROOT_URL = "https://${domain}/";
|
ROOT_URL = "https://${domain}/";
|
||||||
PROTOCOL = "http+unix";
|
PROTOCOL = "http+unix";
|
||||||
SSH_PORT = sshPort;
|
SSH_PORT = sshPort;
|
||||||
START_SSH_SERVER = true;
|
START_SSH_SERVER = true;
|
||||||
|
LFS_START_SERVER = true;
|
||||||
};
|
};
|
||||||
indexer.REPO_INDEXER_ENABLED = true;
|
indexer.REPO_INDEXER_ENABLED = true;
|
||||||
service.DISABLE_REGISTRATION = true;
|
service.DISABLE_REGISTRATION = true;
|
||||||
@@ -49,6 +55,35 @@ in {
|
|||||||
};
|
};
|
||||||
actions.ENABLED = true;
|
actions.ENABLED = true;
|
||||||
"ui.meta".DESCRIPTION = "Bokstavelig talt programvareverkstedet";
|
"ui.meta".DESCRIPTION = "Bokstavelig talt programvareverkstedet";
|
||||||
|
"ui.svg".RENDER = true;
|
||||||
|
|
||||||
|
markup = {
|
||||||
|
asciidoc = {
|
||||||
|
ENABLED = true;
|
||||||
|
NEED_POSTPROCESS = true;
|
||||||
|
FILE_EXTENSIONS = ".adoc,.asciidoc";
|
||||||
|
RENDER_COMMAND = "${lib.getExe pkgs.asciidoctor} --embedded --safe-mode=secure --out-file=- -";
|
||||||
|
IS_INPUT_FILE = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
html = {
|
||||||
|
ENABLED = true;
|
||||||
|
FILE_EXTENSIONS = ".html,.htm";
|
||||||
|
RENDER_COMMAND = "cat";
|
||||||
|
# Input is not a standard input but a file
|
||||||
|
IS_INPUT_FILE = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
sanitizer.html.1 = {
|
||||||
|
ELEMENT = "div";
|
||||||
|
ALLOW_ATTR = "class";
|
||||||
|
};
|
||||||
|
|
||||||
|
sanitizer.html.2 = {
|
||||||
|
ELEMENT = "a";
|
||||||
|
ALLOW_ATTR = "class";
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -51,6 +51,7 @@ def add_user(username, name):
|
|||||||
existing_users[username] = user
|
existing_users[username] = user
|
||||||
|
|
||||||
else:
|
else:
|
||||||
|
user["visibility"] = existing_users[username]["visibility"]
|
||||||
r = requests.patch(GITEA_API_URL + f'/admin/users/{username}',
|
r = requests.patch(GITEA_API_URL + f'/admin/users/{username}',
|
||||||
json=user,
|
json=user,
|
||||||
headers={'Authorization': 'token ' + API_TOKEN})
|
headers={'Authorization': 'token ' + API_TOKEN})
|
||||||
|
@@ -24,21 +24,26 @@ in {
|
|||||||
features = {
|
features = {
|
||||||
feature_latex_maths = true;
|
feature_latex_maths = true;
|
||||||
feature_pinning = true;
|
feature_pinning = true;
|
||||||
|
feature_render_reaction_images = true;
|
||||||
feature_state_counters = true;
|
feature_state_counters = true;
|
||||||
feature_custom_status = false;
|
# element call group calls
|
||||||
|
feature_group_calls = true;
|
||||||
};
|
};
|
||||||
default_theme = "dark";
|
default_theme = "dark";
|
||||||
|
# Servers in this list should provide some sort of valuable scoping
|
||||||
|
# matrix.org is not useful compared to matrixrooms.info,
|
||||||
|
# because it has so many general members, rooms of all topics are on it.
|
||||||
|
# Something matrixrooms.info is already providing.
|
||||||
room_directory.servers = [
|
room_directory.servers = [
|
||||||
"pvv.ntnu.no"
|
"pvv.ntnu.no"
|
||||||
"matrix.omegav.no"
|
"matrixrooms.info" # Searches all public room directories
|
||||||
"matrix.org"
|
"matrix.omegav.no" # Friends
|
||||||
"libera.chat"
|
"gitter.im" # gitter rooms
|
||||||
"gitter.im"
|
"mozilla.org" # mozilla and friends
|
||||||
"mozilla.org"
|
"kde.org" # KDE rooms
|
||||||
"kde.org"
|
"fosdem.org" # FOSDEM
|
||||||
"t2bot.io"
|
"dodsorf.as" # PVV Member
|
||||||
"fosdem.org"
|
"nani.wtf" # PVV Member
|
||||||
"dodsorf.as"
|
|
||||||
];
|
];
|
||||||
enable_presence_by_hs_url = {
|
enable_presence_by_hs_url = {
|
||||||
"https://matrix.org" = false;
|
"https://matrix.org" = false;
|
||||||
|
44
hosts/bikkje/configuration.nix
Normal file
44
hosts/bikkje/configuration.nix
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
{ 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;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
};
|
@@ -1,125 +0,0 @@
|
|||||||
{ config, pkgs, values, lib, ... }:
|
|
||||||
{
|
|
||||||
containers.bikkje = {
|
|
||||||
autoStart = true;
|
|
||||||
interfaces = [ "enp4s0f0" ];
|
|
||||||
|
|
||||||
config = { config, pkgs, ... }: {
|
|
||||||
imports = [
|
|
||||||
../../../modules/home-areas.nix
|
|
||||||
./services/kerberos
|
|
||||||
];
|
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [
|
|
||||||
zsh
|
|
||||||
bash
|
|
||||||
fish
|
|
||||||
tcsh
|
|
||||||
|
|
||||||
alpine
|
|
||||||
mutt
|
|
||||||
mutt-ics
|
|
||||||
mutt-wizard
|
|
||||||
notmuch
|
|
||||||
mailutils
|
|
||||||
procmail
|
|
||||||
|
|
||||||
irssi
|
|
||||||
weechat
|
|
||||||
weechatScripts.edit
|
|
||||||
|
|
||||||
coreutils-full
|
|
||||||
diffutils
|
|
||||||
findutils
|
|
||||||
ripgrep
|
|
||||||
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
|
|
||||||
(python3.withPackages (ps: with ps; [
|
|
||||||
numpy
|
|
||||||
sympy
|
|
||||||
scipy
|
|
||||||
requests
|
|
||||||
imageio
|
|
||||||
pillow
|
|
||||||
httpx
|
|
||||||
pycryptodome
|
|
||||||
pandas
|
|
||||||
matplotlib
|
|
||||||
]))
|
|
||||||
ruby
|
|
||||||
tcl
|
|
||||||
];
|
|
||||||
|
|
||||||
services.openssh = {
|
|
||||||
enable = true;
|
|
||||||
ports = [ 22 80 443 ];
|
|
||||||
openFirewall = true;
|
|
||||||
extraConfig = ''
|
|
||||||
PubkeyAcceptedAlgorithms=+ssh-rsa
|
|
||||||
'';
|
|
||||||
|
|
||||||
settings = {
|
|
||||||
GatewayPorts = "yes";
|
|
||||||
PermitRootLogin = "yes";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
users.motd = builtins.readFile ../../../misc/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.enable = true;
|
|
||||||
systemd.network.networks."30-enp4s0f0" = values.defaultNetworkConfig // {
|
|
||||||
matchConfig.Name = "enp4s0f0";
|
|
||||||
address = with values.hosts.bikkje; [ (ipv4 + "/25") (ipv6 + "/64") ];
|
|
||||||
};
|
|
||||||
|
|
||||||
system.stateVersion = "23.11";
|
|
||||||
services.resolved.enable = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
# TODO
|
|
||||||
# - Kerberos Authentication
|
|
||||||
# - Mail Transfer Agent
|
|
||||||
}
|
|
@@ -1,27 +0,0 @@
|
|||||||
{ config, pkgs, lib, ... }:
|
|
||||||
{
|
|
||||||
#######################
|
|
||||||
# TODO: remove these once nixos 24.05 gets released
|
|
||||||
#######################
|
|
||||||
imports = [
|
|
||||||
./krb5.nix
|
|
||||||
./pam.nix
|
|
||||||
];
|
|
||||||
disabledModules = [
|
|
||||||
"config/krb5/default.nix"
|
|
||||||
"security/pam.nix"
|
|
||||||
];
|
|
||||||
#######################
|
|
||||||
|
|
||||||
security.krb5 = {
|
|
||||||
enable = true;
|
|
||||||
settings = {
|
|
||||||
libdefaults = {
|
|
||||||
default_realm = "PVV.NTNU.NO";
|
|
||||||
dns_lookup_realm = "yes";
|
|
||||||
dns_lookup_kdc = "yes";
|
|
||||||
};
|
|
||||||
realms."PVV.NTNU.NO".admin_server = "kdc.pvv.ntnu.no";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
@@ -1,88 +0,0 @@
|
|||||||
{ pkgs, lib, ... }:
|
|
||||||
|
|
||||||
# Based on
|
|
||||||
# - https://web.mit.edu/kerberos/krb5-1.12/doc/admin/conf_files/krb5_conf.html
|
|
||||||
# - https://manpages.debian.org/unstable/heimdal-docs/krb5.conf.5heimdal.en.html
|
|
||||||
|
|
||||||
let
|
|
||||||
inherit (lib) boolToString concatMapStringsSep concatStringsSep filter
|
|
||||||
isAttrs isBool isList mapAttrsToList mdDoc mkOption singleton splitString;
|
|
||||||
inherit (lib.types) attrsOf bool coercedTo either int listOf oneOf path
|
|
||||||
str submodule;
|
|
||||||
in
|
|
||||||
{ }: {
|
|
||||||
type = let
|
|
||||||
section = attrsOf relation;
|
|
||||||
relation = either (attrsOf value) value;
|
|
||||||
value = either (listOf atom) atom;
|
|
||||||
atom = oneOf [int str bool];
|
|
||||||
in submodule {
|
|
||||||
freeformType = attrsOf section;
|
|
||||||
options = {
|
|
||||||
include = mkOption {
|
|
||||||
default = [ ];
|
|
||||||
description = mdDoc ''
|
|
||||||
Files to include in the Kerberos configuration.
|
|
||||||
'';
|
|
||||||
type = coercedTo path singleton (listOf path);
|
|
||||||
};
|
|
||||||
includedir = mkOption {
|
|
||||||
default = [ ];
|
|
||||||
description = mdDoc ''
|
|
||||||
Directories containing files to include in the Kerberos configuration.
|
|
||||||
'';
|
|
||||||
type = coercedTo path singleton (listOf path);
|
|
||||||
};
|
|
||||||
module = mkOption {
|
|
||||||
default = [ ];
|
|
||||||
description = mdDoc ''
|
|
||||||
Modules to obtain Kerberos configuration from.
|
|
||||||
'';
|
|
||||||
type = coercedTo path singleton (listOf path);
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
generate = let
|
|
||||||
indent = str: concatMapStringsSep "\n" (line: " " + line) (splitString "\n" str);
|
|
||||||
|
|
||||||
formatToplevel = args @ {
|
|
||||||
include ? [ ],
|
|
||||||
includedir ? [ ],
|
|
||||||
module ? [ ],
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
sections = removeAttrs args [ "include" "includedir" "module" ];
|
|
||||||
in concatStringsSep "\n" (filter (x: x != "") [
|
|
||||||
(concatStringsSep "\n" (mapAttrsToList formatSection sections))
|
|
||||||
(concatMapStringsSep "\n" (m: "module ${m}") module)
|
|
||||||
(concatMapStringsSep "\n" (i: "include ${i}") include)
|
|
||||||
(concatMapStringsSep "\n" (i: "includedir ${i}") includedir)
|
|
||||||
]);
|
|
||||||
|
|
||||||
formatSection = name: section: ''
|
|
||||||
[${name}]
|
|
||||||
${indent (concatStringsSep "\n" (mapAttrsToList formatRelation section))}
|
|
||||||
'';
|
|
||||||
|
|
||||||
formatRelation = name: relation:
|
|
||||||
if isAttrs relation
|
|
||||||
then ''
|
|
||||||
${name} = {
|
|
||||||
${indent (concatStringsSep "\n" (mapAttrsToList formatValue relation))}
|
|
||||||
}''
|
|
||||||
else formatValue name relation;
|
|
||||||
|
|
||||||
formatValue = name: value:
|
|
||||||
if isList value
|
|
||||||
then concatMapStringsSep "\n" (formatAtom name) value
|
|
||||||
else formatAtom name value;
|
|
||||||
|
|
||||||
formatAtom = name: atom: let
|
|
||||||
v = if isBool atom then boolToString atom else toString atom;
|
|
||||||
in "${name} = ${v}";
|
|
||||||
in
|
|
||||||
name: value: pkgs.writeText name ''
|
|
||||||
${formatToplevel value}
|
|
||||||
'';
|
|
||||||
}
|
|
@@ -1,90 +0,0 @@
|
|||||||
{ config, lib, pkgs, ... }:
|
|
||||||
let
|
|
||||||
inherit (lib) mdDoc mkIf mkOption mkPackageOption mkRemovedOptionModule;
|
|
||||||
inherit (lib.types) bool;
|
|
||||||
|
|
||||||
mkRemovedOptionModule' = name: reason: mkRemovedOptionModule ["krb5" name] reason;
|
|
||||||
mkRemovedOptionModuleCfg = name: mkRemovedOptionModule' name ''
|
|
||||||
The option `krb5.${name}' has been removed. Use
|
|
||||||
`security.krb5.settings.${name}' for structured configuration.
|
|
||||||
'';
|
|
||||||
|
|
||||||
cfg = config.security.krb5;
|
|
||||||
format = import ./krb5-conf-format.nix { inherit pkgs lib; } { };
|
|
||||||
in {
|
|
||||||
imports = [
|
|
||||||
(mkRemovedOptionModuleCfg "libdefaults")
|
|
||||||
(mkRemovedOptionModuleCfg "realms")
|
|
||||||
(mkRemovedOptionModuleCfg "domain_realm")
|
|
||||||
(mkRemovedOptionModuleCfg "capaths")
|
|
||||||
(mkRemovedOptionModuleCfg "appdefaults")
|
|
||||||
(mkRemovedOptionModuleCfg "plugins")
|
|
||||||
(mkRemovedOptionModuleCfg "config")
|
|
||||||
(mkRemovedOptionModuleCfg "extraConfig")
|
|
||||||
(mkRemovedOptionModule' "kerberos" ''
|
|
||||||
The option `krb5.kerberos' has been moved to `security.krb5.package'.
|
|
||||||
'')
|
|
||||||
];
|
|
||||||
|
|
||||||
options = {
|
|
||||||
security.krb5 = {
|
|
||||||
enable = mkOption {
|
|
||||||
default = false;
|
|
||||||
description = mdDoc "Enable and configure Kerberos utilities";
|
|
||||||
type = bool;
|
|
||||||
};
|
|
||||||
|
|
||||||
package = mkPackageOption pkgs "krb5" {
|
|
||||||
example = "heimdal";
|
|
||||||
};
|
|
||||||
|
|
||||||
settings = mkOption {
|
|
||||||
default = { };
|
|
||||||
type = format.type;
|
|
||||||
description = mdDoc ''
|
|
||||||
Structured contents of the {file}`krb5.conf` file. See
|
|
||||||
{manpage}`krb5.conf(5)` for details about configuration.
|
|
||||||
'';
|
|
||||||
example = {
|
|
||||||
include = [ "/run/secrets/secret-krb5.conf" ];
|
|
||||||
includedir = [ "/run/secrets/secret-krb5.conf.d" ];
|
|
||||||
|
|
||||||
libdefaults = {
|
|
||||||
default_realm = "ATHENA.MIT.EDU";
|
|
||||||
};
|
|
||||||
|
|
||||||
realms = {
|
|
||||||
"ATHENA.MIT.EDU" = {
|
|
||||||
admin_server = "athena.mit.edu";
|
|
||||||
kdc = [
|
|
||||||
"athena01.mit.edu"
|
|
||||||
"athena02.mit.edu"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
domain_realm = {
|
|
||||||
"mit.edu" = "ATHENA.MIT.EDU";
|
|
||||||
};
|
|
||||||
|
|
||||||
logging = {
|
|
||||||
kdc = "SYSLOG:NOTICE";
|
|
||||||
admin_server = "SYSLOG:NOTICE";
|
|
||||||
default = "SYSLOG:NOTICE";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
|
||||||
environment = {
|
|
||||||
systemPackages = [ cfg.package ];
|
|
||||||
etc."krb5.conf".source = format.generate "krb5.conf" cfg.settings;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
meta.maintainers = builtins.attrValues {
|
|
||||||
inherit (lib.maintainers) dblsaiko h7x4;
|
|
||||||
};
|
|
||||||
}
|
|
File diff suppressed because it is too large
Load Diff
@@ -4,8 +4,6 @@
|
|||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
../../base.nix
|
../../base.nix
|
||||||
../../misc/metrics-exporters.nix
|
../../misc/metrics-exporters.nix
|
||||||
|
|
||||||
./bikkje
|
|
||||||
];
|
];
|
||||||
|
|
||||||
# buskerud does not support efi?
|
# buskerud does not support efi?
|
||||||
|
16
misc/motd
16
misc/motd
@@ -1,16 +0,0 @@
|
|||||||
███████████ █████ █████ █████ █████
|
|
||||||
░░███░░░░░███░░███ ░░███ ░░███ ░░███
|
|
||||||
░███ ░███ ░███ ░███ ░███ ░███
|
|
||||||
░██████████ ░███ ░███ ░███ ░███
|
|
||||||
░███░░░░░░ ░░███ ███ ░░███ ███
|
|
||||||
░███ ░░░█████░ ░░░█████░
|
|
||||||
█████ ░░███ ░░███
|
|
||||||
░░░░░ ░░░ ░░░
|
|
||||||
|
|
||||||
================= 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/
|
|
||||||
===============================================================================
|
|
@@ -1,20 +0,0 @@
|
|||||||
{ pkgs, lib, ... }:
|
|
||||||
{
|
|
||||||
fileSystems = let
|
|
||||||
# See microbel:/etc/exports
|
|
||||||
homeMounts = (lib.listToAttrs (map
|
|
||||||
(l: lib.nameValuePair "/home/pvv/${l}" "homepvv${l}.pvv.ntnu.no:/export/home/pvv/${l}")
|
|
||||||
[ "a" "b" "c" "d" "h" "i" "j" "k" "l" "m" "z" ]));
|
|
||||||
in { }
|
|
||||||
//
|
|
||||||
(lib.mapAttrs (_: device: {
|
|
||||||
inherit device;
|
|
||||||
fsType = "nfs";
|
|
||||||
options = [
|
|
||||||
"nfsvers=3"
|
|
||||||
"proto=tcp"
|
|
||||||
"nofail"
|
|
||||||
"_netdev"
|
|
||||||
];
|
|
||||||
}) homeMounts);
|
|
||||||
}
|
|
@@ -56,10 +56,6 @@ in rec {
|
|||||||
ipv4 = pvv-ipv4 204;
|
ipv4 = pvv-ipv4 204;
|
||||||
ipv6 = pvv-ipv6 "1:4f"; # Wtf øystein og daniel why
|
ipv6 = pvv-ipv6 "1:4f"; # Wtf øystein og daniel why
|
||||||
};
|
};
|
||||||
bikkje = {
|
|
||||||
ipv4 = pvv-ipv4 216;
|
|
||||||
ipv6 = pvv-ipv6 216;
|
|
||||||
};
|
|
||||||
buskerud = {
|
buskerud = {
|
||||||
ipv4 = pvv-ipv4 231;
|
ipv4 = pvv-ipv4 231;
|
||||||
ipv6 = pvv-ipv6 231;
|
ipv6 = pvv-ipv6 231;
|
||||||
|
Reference in New Issue
Block a user