Merge remote-tracking branch 'lass/master'
This commit is contained in:
commit
8bb94c519f
25
krebs/3modules/external/default.nix
vendored
25
krebs/3modules/external/default.nix
vendored
|
@ -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 = {
|
justraute = {
|
||||||
owner = config.krebs.users.raute; # laptop
|
owner = config.krebs.users.raute; # laptop
|
||||||
nets = {
|
nets = {
|
||||||
|
@ -393,7 +416,7 @@ in {
|
||||||
pubkey = ssh-for "kmein";
|
pubkey = ssh-for "kmein";
|
||||||
};
|
};
|
||||||
Mic92 = {
|
Mic92 = {
|
||||||
mail = "joerg@higgsboson.tk";
|
mail = "joerg@thalheim.io";
|
||||||
pubkey = ssh-for "Mic92";
|
pubkey = ssh-for "Mic92";
|
||||||
};
|
};
|
||||||
palo = {
|
palo = {
|
||||||
|
|
|
@ -13,24 +13,23 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
networking.extraHosts =
|
networking.hosts =
|
||||||
concatStringsSep
|
filterAttrs
|
||||||
"\n"
|
(_name: value: value != [])
|
||||||
(flatten
|
(zipAttrsWith
|
||||||
(mapAttrsToList
|
(_: concatLists)
|
||||||
(hostname: host:
|
(concatMap
|
||||||
mapAttrsToList
|
(host:
|
||||||
(netname: net: let
|
concatMap
|
||||||
|
(net: let
|
||||||
aliases = longs ++ shorts;
|
aliases = longs ++ shorts;
|
||||||
longs = filter check net.aliases;
|
longs = filter check net.aliases;
|
||||||
shorts = let s = ".${config.krebs.dns.search-domain}"; in
|
shorts = let s = ".${config.krebs.dns.search-domain}"; in
|
||||||
map (removeSuffix s) (filter (hasSuffix s) longs);
|
map (removeSuffix s) (filter (hasSuffix s) longs);
|
||||||
in
|
in
|
||||||
optionals
|
map (addr: { ${addr} = aliases; }) net.addrs)
|
||||||
(aliases != [])
|
(attrValues host.nets))
|
||||||
(map (addr: "${addr} ${toString aliases}") net.addrs))
|
(attrValues config.krebs.hosts)));
|
||||||
(filterAttrs (name: host: host.aliases != []) host.nets))
|
|
||||||
config.krebs.hosts));
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
63
krebs/3modules/reaktor2.nix
Normal file
63
krebs/3modules/reaktor2.nix
Normal 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";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
);
|
||||||
|
};
|
||||||
|
}
|
|
@ -22,6 +22,8 @@ foldl' mergeAttrs {}
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
|
reaktor2 = self.haskellPackages.reaktor2;
|
||||||
|
|
||||||
ReaktorPlugins = self.callPackage ./simple/Reaktor/plugins.nix {};
|
ReaktorPlugins = self.callPackage ./simple/Reaktor/plugins.nix {};
|
||||||
|
|
||||||
# https://github.com/proot-me/PRoot/issues/106
|
# https://github.com/proot-me/PRoot/issues/106
|
||||||
|
|
23
krebs/5pkgs/haskell/reaktor2.nix
Normal file
23
krebs/5pkgs/haskell/reaktor2.nix
Normal 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;
|
||||||
|
}
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"url": "https://github.com/NixOS/nixpkgs-channels",
|
"url": "https://github.com/NixOS/nixpkgs-channels",
|
||||||
"rev": "0396345b79436f54920f7eb651ab42acf2eb7973",
|
"rev": "97e0d53d669cd07f0750a42fd535524b3cdd46d1",
|
||||||
"date": "2018-12-30T21:22:33-05:00",
|
"date": "2019-01-15T00:11:44+01:00",
|
||||||
"sha256": "10wd0wsair6dlilgaviqw2p9spgcf8qg736bzs08jha0f4zfqjs4",
|
"sha256": "111xa7qn9142dar29cil4br2mvn8f1rbiy310lkhwl73126fq8dw",
|
||||||
"fetchSubmodules": false
|
"fetchSubmodules": false
|
||||||
}
|
}
|
||||||
|
|
|
@ -74,7 +74,6 @@ in {
|
||||||
createHome = true;
|
createHome = true;
|
||||||
useDefaultShell = true;
|
useDefaultShell = true;
|
||||||
packages = with pkgs; [
|
packages = with pkgs; [
|
||||||
ftb
|
|
||||||
minecraft
|
minecraft
|
||||||
steam-run
|
steam-run
|
||||||
dolphinEmu
|
dolphinEmu
|
||||||
|
|
Loading…
Reference in a new issue