stockholm/lass/1systems/mors/config.nix

193 lines
5.5 KiB
Nix
Raw Normal View History

2015-07-16 13:52:17 +00:00
{ config, pkgs, ... }:
2016-10-20 18:54:38 +00:00
with import <stockholm/lib>;
2015-07-16 13:52:17 +00:00
{
imports = [
<stockholm/lass>
2017-07-23 19:10:50 +00:00
<stockholm/lass/2configs/mouse.nix>
<stockholm/lass/2configs/retiolum.nix>
<stockholm/lass/2configs/baseX.nix>
<stockholm/lass/2configs/exim-retiolum.nix>
<stockholm/lass/2configs/programs.nix>
<stockholm/lass/2configs/bitcoin.nix>
<stockholm/lass/2configs/browsers.nix>
<stockholm/lass/2configs/games.nix>
<stockholm/lass/2configs/pass.nix>
<stockholm/lass/2configs/elster.nix>
<stockholm/lass/2configs/steam.nix>
<stockholm/lass/2configs/wine.nix>
<stockholm/lass/2configs/git.nix>
<stockholm/lass/2configs/fetchWallpaper.nix>
<stockholm/lass/2configs/mail.nix>
2017-09-03 22:16:54 +00:00
<stockholm/krebs/2configs/ircd.nix>
<stockholm/lass/2configs/logf.nix>
<stockholm/lass/2configs/syncthing.nix>
<stockholm/lass/2configs/sync/sync.nix>
2019-04-17 18:00:06 +00:00
<stockholm/lass/2configs/sync/decsync.nix>
<stockholm/lass/2configs/sync/weechat.nix>
<stockholm/lass/2configs/sync/the_playlist.nix>
#<stockholm/lass/2configs/c-base.nix>
2017-11-12 12:01:59 +00:00
<stockholm/lass/2configs/br.nix>
2018-01-03 17:23:22 +00:00
<stockholm/lass/2configs/ableton.nix>
2018-02-13 16:13:18 +00:00
<stockholm/lass/2configs/dunst.nix>
2018-02-13 16:13:55 +00:00
<stockholm/lass/2configs/rtl-sdr.nix>
2018-08-14 12:15:14 +00:00
<stockholm/lass/2configs/print.nix>
2018-12-12 14:35:15 +00:00
<stockholm/lass/2configs/network-manager.nix>
2019-01-03 18:13:36 +00:00
<stockholm/lass/2configs/nfs-dl.nix>
<stockholm/lass/2configs/green-host.nix>
2021-01-24 16:00:29 +00:00
<stockholm/krebs/2configs/news-host.nix>
<stockholm/lass/2configs/ppp/x220-modem.nix>
<stockholm/lass/2configs/ppp/umts-stick.nix>
# <stockholm/lass/2configs/remote-builder/morpheus.nix>
# <stockholm/lass/2configs/remote-builder/prism.nix>
{
krebs.iptables.tables.filter.INPUT.rules = [
2018-05-04 18:30:19 +00:00
#risk of rain
{ predicate = "-p tcp --dport 11100"; target = "ACCEPT"; }
2018-09-08 20:54:29 +00:00
#quake3
{ predicate = "-p tcp --dport 27950:27965"; target = "ACCEPT"; }
{ predicate = "-p udp --dport 27950:27965"; target = "ACCEPT"; }
];
}
2019-04-07 16:44:57 +00:00
{
2020-04-08 10:33:08 +00:00
services.syncthing.declarative = {
devices.schasch.addresses = [ "schasch.r:22000" ];
2019-05-29 13:05:02 +00:00
folders = {
the_playlist = {
path = "/home/lass/tmp/the_playlist";
2020-04-08 10:33:08 +00:00
devices = [ "mors" "phone" "prism" "xerxes" ];
2019-05-29 13:05:02 +00:00
};
free_music = {
id = "mu9mn-zgvsw";
path = "/home/lass/tmp/free_music";
2020-04-08 10:33:08 +00:00
devices = [ "mors" "schasch" ];
2019-05-29 13:05:02 +00:00
};
};
2019-04-18 08:16:02 +00:00
};
2019-05-29 13:05:02 +00:00
krebs.permown = {
"/home/lass/tmp/free_music" = {
owner = "lass";
group = "syncthing";
umask = "0007";
};
"/home/lass/tmp/the_playlist" = {
owner = "lass";
group = "syncthing";
umask = "0007";
};
2019-04-18 08:16:02 +00:00
};
2019-04-07 16:44:57 +00:00
}
2016-08-29 08:58:46 +00:00
{
2016-12-26 13:18:08 +00:00
services.nginx = {
2016-08-29 08:58:46 +00:00
enable = true;
2016-12-26 13:18:08 +00:00
virtualHosts.default = {
default = true;
2016-12-26 13:18:08 +00:00
serverAliases = [
2016-12-22 22:23:59 +00:00
"localhost"
"${config.krebs.build.host.name}"
"${config.krebs.build.host.name}.r"
];
2016-12-26 13:18:08 +00:00
locations."~ ^/~(.+?)(/.*)?\$".extraConfig = ''
alias /home/$1/public_html$2;
'';
2016-12-22 22:23:59 +00:00
};
2016-08-29 08:58:46 +00:00
};
}
2016-10-20 19:05:56 +00:00
{
services.redis.enable = true;
}
2017-02-13 15:16:01 +00:00
{
environment.systemPackages = [
2017-06-18 12:00:05 +00:00
pkgs.ovh-zone
2018-09-09 18:49:22 +00:00
pkgs.bank
2018-10-04 10:36:23 +00:00
pkgs.adb-sync
2019-04-17 18:05:20 +00:00
pkgs.transgui
2017-02-13 15:16:01 +00:00
];
}
2017-04-16 21:35:02 +00:00
{
services.tor = {
enable = true;
client.enable = true;
};
}
2015-07-16 13:52:17 +00:00
];
2015-10-19 12:00:15 +00:00
krebs.build.host = config.krebs.hosts.mors;
2015-07-27 11:54:29 +00:00
2015-07-16 13:52:17 +00:00
environment.systemPackages = with pkgs; [
2016-03-15 13:12:13 +00:00
acronym
2017-06-20 17:46:37 +00:00
brain
2016-02-06 18:26:51 +00:00
cac-api
2015-10-03 12:37:34 +00:00
sshpass
2015-09-30 13:18:31 +00:00
get
hashPassword
2016-04-13 14:47:47 +00:00
urban
mk_sql_pair
2016-05-31 22:10:13 +00:00
remmina
2018-12-02 04:44:37 +00:00
transmission
2016-08-29 08:59:03 +00:00
2016-10-02 10:38:04 +00:00
macchanger
2017-11-12 12:02:21 +00:00
dnsutils
2018-04-27 17:16:12 +00:00
woeusb
l-gen-secrets
2018-04-05 15:44:34 +00:00
generate-secrets
2018-04-20 21:27:53 +00:00
(pkgs.writeDashBin "btc-coinbase" ''
${pkgs.curl}/bin/curl -Ss 'https://api.coinbase.com/v2/prices/spot?currency=EUR' | ${pkgs.jq}/bin/jq '.data.amount'
'')
(pkgs.writeDashBin "btc-wex" ''
${pkgs.curl}/bin/curl -Ss 'https://wex.nz/api/3/ticker/btc_eur' | ${pkgs.jq}/bin/jq '.btc_eur.avg'
'')
(pkgs.writeDashBin "btc-kraken" ''
${pkgs.curl}/bin/curl -Ss 'https://api.kraken.com/0/public/Ticker?pair=BTCEUR' | ${pkgs.jq}/bin/jq '.result.XXBTZEUR.a[0]'
'')
2019-04-17 15:41:51 +00:00
(pkgs.writeDashBin "krebsco.de" ''
TMPDIR=$(${pkgs.coreutils}/bin/mktemp -d)
${pkgs.brain}/bin/brain show krebs-secrets/ovh-secrets.json > "$TMPDIR"/ovh-secrets.json
OVH_ZONE_CONFIG="$TMPDIR"/ovh-secrets.json ${pkgs.krebszones}/bin/krebszones import
${pkgs.coreutils}/bin/rm -rf "$TMPDIR"
'')
(pkgs.writeDashBin "lassul.us" ''
TMPDIR=$(${pkgs.coreutils}/bin/mktemp -d)
${pkgs.pass}/bin/pass show admin/ovh/api.config > "$TMPDIR"/ovh-secrets.json
OVH_ZONE_CONFIG="$TMPDIR"/ovh-secrets.json ${pkgs.ovh-zone}/bin/ovh-zone import /etc/zones/lassul.us lassul.us
${pkgs.coreutils}/bin/rm -rf "$TMPDIR"
'')
2015-07-16 13:52:17 +00:00
];
#TODO: fix this shit
##fprint stuff
##sudo fprintd-enroll $USER to save fingerprints
#services.fprintd.enable = true;
#security.pam.services.sudo.fprintAuth = true;
users.extraGroups = {
loot = {
members = [
config.users.extraUsers.mainUser.name
"firefox"
"chromium"
"google"
"virtual"
];
};
};
2016-06-28 15:25:12 +00:00
krebs.repo-sync.timerConfig = {
OnCalendar = "00:37";
};
2017-10-09 11:19:27 +00:00
2018-12-24 14:49:45 +00:00
nixpkgs.config.android_sdk.accept_license = true;
2017-11-12 12:02:48 +00:00
programs.adb.enable = true;
2018-02-13 16:06:02 +00:00
users.users.mainUser.extraGroups = [ "adbusers" "docker" ];
virtualisation.docker.enable = true;
2018-04-20 21:28:39 +00:00
2018-05-16 15:29:32 +00:00
virtualisation.libvirtd.enable = true;
2018-07-03 18:35:11 +00:00
services.earlyoom = {
enable = true;
freeMemThreshold = 5;
};
2015-07-16 13:52:17 +00:00
}