Merge remote-tracking branch 'lass/master'

This commit is contained in:
makefu 2019-01-21 21:49:10 +01:00
commit 8bb94c519f
No known key found for this signature in database
GPG Key ID: 36F7711F3FC0F225
7 changed files with 127 additions and 18 deletions

View File

@ -141,6 +141,29 @@ in {
};
};
};
idontcare = {
owner = config.krebs.users.Mic92;
nets = rec {
retiolum = {
addrs = [
config.krebs.hosts.idontcare.nets.retiolum.ip4.addr
config.krebs.hosts.idontcare.nets.retiolum.ip6.addr
];
ip4.addr = "10.243.29.177";
aliases = [ "idontcare.r" ];
tinc.pubkey = ''
-----BEGIN RSA PUBLIC KEY-----
MIIBCgKCAQEAxmmbQLVXcnCU9Vg9TCoJxfq/RyNfzaTj8XJsn4Kpo3CvQOwFzL6O
qZnbG55WjPjPumuFgtUdHA/G8mgtrTVaIRbVE9ck2l2wWFzMWxORzuvDbMh5xP8A
OW2Z2qjlH6O9GTBCzpYyHuyBWCjtiN4x9zEqxkIsBARKOylAoy3zQIiiQF0d72An
lqKFi9vYUU90zo9rP8BTzx2ZsEWb28xhHUlwf1+vgaOHI1jI99gnr12dVYl/i/Hb
O28gDUogfpP/5pWFAHJ+53ZscHo8/Y7imjiKgGXmOHywoXOsKQ67M6ROEU/0xPnw
jKmq2p7zTJk2mDhphjePi5idd5yKNX5Q3wIDAQAB
-----END RSA PUBLIC KEY-----
'';
};
};
};
justraute = {
owner = config.krebs.users.raute; # laptop
nets = {
@ -393,7 +416,7 @@ in {
pubkey = ssh-for "kmein";
};
Mic92 = {
mail = "joerg@higgsboson.tk";
mail = "joerg@thalheim.io";
pubkey = ssh-for "Mic92";
};
palo = {

View File

@ -13,24 +13,23 @@ in {
};
config = {
networking.extraHosts =
concatStringsSep
"\n"
(flatten
(mapAttrsToList
(hostname: host:
mapAttrsToList
(netname: net: let
networking.hosts =
filterAttrs
(_name: value: value != [])
(zipAttrsWith
(_: concatLists)
(concatMap
(host:
concatMap
(net: let
aliases = longs ++ shorts;
longs = filter check net.aliases;
shorts = let s = ".${config.krebs.dns.search-domain}"; in
map (removeSuffix s) (filter (hasSuffix s) longs);
in
optionals
(aliases != [])
(map (addr: "${addr} ${toString aliases}") net.addrs))
(filterAttrs (name: host: host.aliases != []) host.nets))
config.krebs.hosts));
map (addr: { ${addr} = aliases; }) net.addrs)
(attrValues host.nets))
(attrValues config.krebs.hosts)));
};
}

View File

@ -0,0 +1,63 @@
with import <stockholm/lib>;
{ config, pkgs, ... }: {
options.krebs.reaktor2 = mkOption {
default = {};
type = types.attrsOf (types.submodule (self: let
name = self.config._module.args.name;
in {
options = {
nick = mkOption {
default = name;
# TODO types.irc.nickname
type = types.str;
};
hostname = mkOption {
default = "irc.r";
type = types.hostname;
};
port = mkOption {
default = "6667";
# TODO type = types.service-name
};
plugins = mkOption {
default = [];
type = types.listOf types.attrs;
};
stateDir = mkOption {
default = "/var/lib/${self.config.systemd-service-name}";
readOnly = true;
type = types.absolute-pathname;
};
systemd-service-name = mkOption {
default = "reaktor2${optionalString (name != "default") "-${name}"}";
type = types.filename;
};
};
}));
};
config = {
systemd.services = flip mapAttrs' config.krebs.reaktor2 (_: cfg:
nameValuePair cfg.systemd-service-name {
after = [ "network.target" ];
wantedBy = [ "multi-user.target" ];
serviceConfig = {
User = cfg.systemd-service-name;
Group = "reaktor2";
DynamicUser = true;
StateDirectory = cfg.systemd-service-name;
ExecStart = let
configFile = pkgs.writeJSON configFileName configValue;
configFileName = "${cfg.systemd-service-name}.config.json";
configValue = recursiveUpdate {
logTime = false;
} (removeAttrs cfg ["_module"]);
in "${pkgs.reaktor2}/bin/reaktor ${configFile}";
Restart = "always";
RestartSec = "30";
};
}
);
};
}

View File

@ -22,6 +22,8 @@ foldl' mergeAttrs {}
};
});
reaktor2 = self.haskellPackages.reaktor2;
ReaktorPlugins = self.callPackage ./simple/Reaktor/plugins.nix {};
# https://github.com/proot-me/PRoot/issues/106

View File

@ -0,0 +1,23 @@
{ mkDerivation, aeson, attoparsec, base, blessings, bytestring
, containers, fetchgit, filepath, network, network-simple
, network-simple-tls, pcre-heavy, pcre-light, process, random
, stdenv, text, time, transformers, unix, unordered-containers
}:
mkDerivation {
pname = "reaktor2";
version = "0.0.0";
src = fetchgit {
url = "https://cgit.krebsco.de/reaktor2";
sha256 = "1q2rb78mzpyd8wxfmlbfdz7zq5smsrrvb4n874ap1p8f2bmmp0am";
rev = "ce276eee82ec0b8c4106beb4c51d6f9eb77335c4";
fetchSubmodules = true;
};
isLibrary = false;
isExecutable = true;
executableHaskellDepends = [
aeson attoparsec base blessings bytestring containers filepath
network network-simple network-simple-tls pcre-heavy pcre-light
process random text time transformers unix unordered-containers
];
license = stdenv.lib.licenses.mit;
}

View File

@ -1,7 +1,7 @@
{
"url": "https://github.com/NixOS/nixpkgs-channels",
"rev": "0396345b79436f54920f7eb651ab42acf2eb7973",
"date": "2018-12-30T21:22:33-05:00",
"sha256": "10wd0wsair6dlilgaviqw2p9spgcf8qg736bzs08jha0f4zfqjs4",
"rev": "97e0d53d669cd07f0750a42fd535524b3cdd46d1",
"date": "2019-01-15T00:11:44+01:00",
"sha256": "111xa7qn9142dar29cil4br2mvn8f1rbiy310lkhwl73126fq8dw",
"fetchSubmodules": false
}

View File

@ -74,7 +74,6 @@ in {
createHome = true;
useDefaultShell = true;
packages = with pkgs; [
ftb
minecraft
steam-run
dolphinEmu