diff options
-rw-r--r-- | krebs/2configs/default.nix | 1 | ||||
-rw-r--r-- | krebs/2configs/news.nix | 37 | ||||
-rw-r--r-- | krebs/3modules/announce-activation.nix | 60 | ||||
-rw-r--r-- | krebs/3modules/default.nix | 1 | ||||
-rw-r--r-- | krebs/3modules/nin/default.nix | 5 | ||||
-rw-r--r-- | krebs/3modules/rtorrent.nix | 23 | ||||
-rw-r--r-- | nin/1systems/onondaga/config.nix | 65 | ||||
-rw-r--r-- | nin/source.nix | 2 |
8 files changed, 107 insertions, 87 deletions
diff --git a/krebs/2configs/default.nix b/krebs/2configs/default.nix index e7ece87b6..c3400e171 100644 --- a/krebs/2configs/default.nix +++ b/krebs/2configs/default.nix @@ -5,6 +5,7 @@ with import <stockholm/lib>; imports = [ ./backup.nix ]; + krebs.announce-activation.enable = true; krebs.enable = true; krebs.tinc.retiolum.enable = true; diff --git a/krebs/2configs/news.nix b/krebs/2configs/news.nix index d9176c328..5ff4ce3f2 100644 --- a/krebs/2configs/news.nix +++ b/krebs/2configs/news.nix @@ -20,10 +20,10 @@ in { augustl|http://augustl.com/atom.xml|#news bbc|http://feeds.bbci.co.uk/news/rss.xml|#news bdt_aktuelle_themen|http://www.bundestag.de/blueprint/servlet/service/de/14154/asFeed/index.rss|#news - bdt_drucksachen|http://www.bundestag.de/dip21rss/bundestag_drucksachen.rss|#news #bundestag - bdt_plenarproto|http://www.bundestag.de/rss_feeds/plenarprotokolle.rss|#news #bundestag + bdt_drucksachen|http://www.bundestag.de/dip21rss/bundestag_drucksachen.rss|#news + bdt_plenarproto|http://www.bundestag.de/rss_feeds/plenarprotokolle.rss|#news bdt_pressemitteilungen|http://www.bundestag.de/blueprint/servlet/service/de/273112/asFeed/index.rss|#news - bitcoinpakistan|https://bitcoinspakistan.com/feed/|#news #financial + bitcoinpakistan|https://bitcoinspakistan.com/feed/|#news cancer|http://feeds.feedburner.com/ncinewsreleases?format=xml|#news carta|http://feeds2.feedburner.com/carta-standard-rss|#news catholic_news|http://feeds.feedburner.com/catholicnewsagency/dailynews|#news @@ -33,12 +33,11 @@ in { cbc_tech|http://rss.cbc.ca/lineup/technology.xml|#news cbc_top|http://rss.cbc.ca/lineup/topstories.xml|#news ccc|http://www.ccc.de/rss/updates.rdf|#news - chan_b|https://boards.4chan.org/b/index.rss|#brainfuck - chan_biz|https://boards.4chan.org/biz/index.rss|#news #brainfuck - chan_g|https://boards.4chan.org/g/index.rss|#news - chan_int|https://boards.4chan.org/int/index.rss|#news #brainfuck - chan_sci|https://boards.4chan.org/sci/index.rss|#news - chan_x|https://boards.4chan.org/x/index.rss|#news + chan_biz|http://boards.4chan.org/biz/index.rss|#news + chan_g|http://boards.4chan.org/g/index.rss|#news + chan_int|http://boards.4chan.org/int/index.rss|#news + chan_sci|http://boards.4chan.org/sci/index.rss|#news + chan_x|http://boards.4chan.org/x/index.rss|#news c|http://www.tempolimit-lichtgeschwindigkeit.de/news.xml|#news cryptogon|http://www.cryptogon.com/?feed=rss2|#news csm|http://rss.csmonitor.com/feeds/csm|#news @@ -68,15 +67,15 @@ in { geheimorganisation|http://geheimorganisation.org/feed/|#news GerForPol|http://www.german-foreign-policy.com/de/news/rss-2.0|#news gmanet|http://www.gmanetwork.com/news/rss/news|#news - golem|https://rss.golem.de/rss.php|#news + golem|http://rss.golem.de/rss.php|#news google|http://news.google.com/?output=rss|#news greenpeace|http://feeds.feedburner.com/GreenpeaceNews|#news guardian_uk|http://feeds.theguardian.com/theguardian/uk-news/rss|#news gulli|http://ticker.gulli.com/rss/|#news hackernews|https://news.ycombinator.com/rss|#news - handelsblatt|http://www.handelsblatt.com/contentexport/feed/schlagzeilen|#news #financial + handelsblatt|http://www.handelsblatt.com/contentexport/feed/schlagzeilen|#news heise|https://www.heise.de/newsticker/heise-atom.xml|#news - hindu_business|http://www.thehindubusinessline.com/?service=rss|#news #financial + hindu_business|http://www.thehindubusinessline.com/?service=rss|#news hindu|http://www.thehindu.com/?service=rss|#news ign|http://feeds.ign.com/ign/all|#news independent|http://www.independent.com/rss/headlines/|#news @@ -94,7 +93,7 @@ in { mongrel2_master|https://github.com/zedshaw/mongrel2/commits/master.atom|#news nds|http://www.nachdenkseiten.de/?feed=atom|#news netzpolitik|https://netzpolitik.org/feed/|#news - newsbtc|http://newsbtc.com/feed/|#news #financial + newsbtc|http://newsbtc.com/feed/|#news nnewsg|http://www.net-news-global.net/rss/rssfeed.xml|#news npr_busi|http://www.npr.org/rss/rss.php?id=1006|#news npr_headlines|http://www.npr.org/rss/rss.php?id=1001|#news @@ -105,21 +104,21 @@ in { painload|https://github.com/krebscode/painload/commits/master.atom|#news phys|http://phys.org/rss-feed/|#news piraten|https://www.piratenpartei.de/feed/|#news - polizei_berlin|http://www.berlin.de/polizei/presse-fahndung/_rss_presse.xml|#news #bullerei - presse_polizei|http://www.presseportal.de/rss/polizei.rss2|#news #bullerei + polizei_berlin|http://www.berlin.de/polizei/presse-fahndung/_rss_presse.xml|#news + presse_polizei|http://www.presseportal.de/rss/polizei.rss2|#news presseportal|http://www.presseportal.de/rss/presseportal.rss2|#news prisonplanet|http://prisonplanet.com/feed.rss|#news rawstory|http://www.rawstory.com/rs/feed/|#news - reddit_4chan|http://www.reddit.com/r/4chan/new/.rss|#news #brainfuck + reddit_4chan|http://www.reddit.com/r/4chan/new/.rss|#news reddit_anticonsum|http://www.reddit.com/r/Anticonsumption/new/.rss|#news - reddit_btc|http://www.reddit.com/r/Bitcoin/new/.rss|#news #financial + reddit_btc|http://www.reddit.com/r/Bitcoin/new/.rss|#news reddit_consp|http://reddit.com/r/conspiracy/.rss|#news reddit_haskell|http://www.reddit.com/r/haskell/.rss|#news reddit_nix|http://www.reddit.com/r/nixos/.rss|#news reddit_prog|http://www.reddit.com/r/programming/new/.rss|#news reddit_sci|http://www.reddit.com/r/science/.rss|#news reddit_tech|http://www.reddit.com/r/technology/.rss|#news - reddit_tpp|http://www.reddit.com/r/twitchplayspokemon/.rss|#news #tpp + reddit_tpp|http://www.reddit.com/r/twitchplayspokemon/.rss|#news reddit_world|http://www.reddit.com/r/worldnews/.rss|#news r-ethereum|http://www.reddit.com/r/ethereum/.rss|#news reuters|http://feeds.reuters.com/Reuters/worldNews|#news @@ -145,7 +144,7 @@ in { stern|http://www.stern.de/feed/standard/all/|#news stz|http://www.stuttgarter-zeitung.de/rss/topthemen.rss.feed|#news sz_politik|http://rss.sueddeutsche.de/rss/Politik|#news - sz_wirtschaft|http://rss.sueddeutsche.de/rss/Wirtschaft|#news #financial + sz_wirtschaft|http://rss.sueddeutsche.de/rss/Wirtschaft|#news sz_wissen|http://rss.sueddeutsche.de/rss/Wissen|#news tagesschau|http://www.tagesschau.de/newsticker.rdf|#news taz|http://taz.de/Themen-des-Tages/!p15;rss/|#news diff --git a/krebs/3modules/announce-activation.nix b/krebs/3modules/announce-activation.nix new file mode 100644 index 000000000..5a3a788c2 --- /dev/null +++ b/krebs/3modules/announce-activation.nix @@ -0,0 +1,60 @@ +with import <stockholm/lib>; +{ config, pkgs, ... }: let + cfg = config.krebs.announce-activation; + announce-activation = pkgs.writeDash "announce-activation" '' + set -efu + message=$(${cfg.get-message}) + exec ${pkgs.irc-announce}/bin/irc-announce \ + ${shell.escape cfg.irc.server} \ + ${shell.escape (toString cfg.irc.port)} \ + ${shell.escape cfg.irc.nick} \ + ${shell.escape cfg.irc.channel} \ + "$message" + ''; + default-get-message = pkgs.writeDash "announce-activation-get-message" '' + set -efu + PATH=${makeBinPath [ + pkgs.coreutils + pkgs.gawk + pkgs.gnused + pkgs.nix + ]} + profile=/nix/var/nix/profiles/system + gen_info=$(nix-env -p "$profile" --list-generations | tail -1) + gen_no=$(echo "$gen_info" | awk '{print$1}') + pretty_name=$(sed -n '/^PRETTY_NAME=/{s/.*="//;s/"$//;p}' /etc/os-release) + echo "activating generation $gen_no $pretty_name" + ''; +in { + options.krebs.announce-activation = { + enable = mkEnableOption "announce-activation"; + get-message = mkOption { + default = default-get-message; + type = types.package; + }; + irc = { + # TODO rename channel to target? + channel = mkOption { + default = "#retiolum"; + type = types.str; # TODO types.irc-channel + }; + nick = mkOption { + default = config.krebs.build.host.name; + type = types.label; + }; + port = mkOption { + default = 6667; + type = types.int; + }; + server = mkOption { + default = "ni.r"; + type = types.hostname; + }; + }; + }; + config = mkIf cfg.enable { + system.activationScripts.announce-activation = '' + ${announce-activation} + ''; + }; +} diff --git a/krebs/3modules/default.nix b/krebs/3modules/default.nix index abb3d37eb..42df3f053 100644 --- a/krebs/3modules/default.nix +++ b/krebs/3modules/default.nix @@ -6,6 +6,7 @@ let out = { imports = [ + ./announce-activation.nix ./apt-cacher-ng.nix ./backup.nix ./bepasty-server.nix diff --git a/krebs/3modules/nin/default.nix b/krebs/3modules/nin/default.nix index d5d13cd1a..aab568352 100644 --- a/krebs/3modules/nin/default.nix +++ b/krebs/3modules/nin/default.nix @@ -3,7 +3,10 @@ with import <stockholm/lib>; { - hosts = mapAttrs (_: setAttr "owner" config.krebs.users.nin) { + hosts = mapAttrs (_: recursiveUpdate { + owner = config.krebs.users.nin; + ci = true; + }) { hiawatha = { cores = 2; nets = { diff --git a/krebs/3modules/rtorrent.nix b/krebs/3modules/rtorrent.nix index d85518993..472accef9 100644 --- a/krebs/3modules/rtorrent.nix +++ b/krebs/3modules/rtorrent.nix @@ -1,4 +1,4 @@ -{ config, lib, pkgs, ... }: +{ config, lib, pkgs, options, ... }: with import <stockholm/lib>; let @@ -73,6 +73,15 @@ let # authentication also applies to rtorrent.rutorrent enable = mkEnableOption "rtorrent nginx web RPC"; + addr = mkOption { + type = types.addr4; + default = "0.0.0.0"; + description = '' + the address to listen on + default is 0.0.0.0 + ''; + }; + port = mkOption { type = types.nullOr types.int; description ='' @@ -290,7 +299,7 @@ let services.nginx.enable = mkDefault true; services.nginx.virtualHosts.rtorrent = { default = mkDefault true; - inherit (webcfg) basicAuth port; + inherit (webcfg) basicAuth; root = optionalString rucfg.enable webdir; locations = { @@ -310,7 +319,15 @@ let include ${pkgs.nginx}/conf/fastcgi.conf; ''; } ); - }; + # workaround because upstream nginx api changed + # TODO remove when nobody uses 17.03 anymore + } // (if hasAttr "port" (head options.services.nginx.virtualHosts.type.getSubModules).submodule.options then { + port = webcfg.port; + } else { + listen = [ + { inherit (webcfg) addr port; } + ]; + }); }; rutorrent-imp = { diff --git a/nin/1systems/onondaga/config.nix b/nin/1systems/onondaga/config.nix index 242d67c26..3cd0773ae 100644 --- a/nin/1systems/onondaga/config.nix +++ b/nin/1systems/onondaga/config.nix @@ -7,7 +7,6 @@ { imports = [ <stockholm/nin> - <nixpkgs/nixos/modules/profiles/qemu-guest.nix> <stockholm/nin/2configs/retiolum.nix> <stockholm/nin/2configs/weechat.nix> <stockholm/nin/2configs/git.nix> @@ -15,70 +14,10 @@ krebs.build.host = config.krebs.hosts.onondaga; - boot.loader.grub.enable = true; - boot.loader.grub.version = 2; - # boot.loader.grub.efiSupport = true; - # boot.loader.grub.efiInstallAsRemovable = true; - # boot.loader.efi.efiSysMountPoint = "/boot/efi"; - # Define on which hard drive you want to install Grub. - boot.loader.grub.device = "/dev/sda"; + boot.isContainer = true; + networking.useDHCP = false; - # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. - - # Select internationalisation properties. - # i18n = { - # consoleFont = "Lat2-Terminus16"; - # consoleKeyMap = "us"; - # defaultLocale = "en_US.UTF-8"; - # }; - - # Set your time zone. time.timeZone = "Europe/Amsterdam"; - # List packages installed in system profile. To search by name, run: - # $ nix-env -qaP | grep wget - # environment.systemPackages = with pkgs; [ - # wget - # ]; - - # List services that you want to enable: - - # Enable the OpenSSH daemon. services.openssh.enable = true; - - # Enable CUPS to print documents. - # services.printing.enable = true; - - # Enable the X11 windowing system. - # services.xserver.enable = true; - # services.xserver.layout = "us"; - # services.xserver.xkbOptions = "eurosign:e"; - - # Enable the KDE Desktop Environment. - # services.xserver.displayManager.kdm.enable = true; - # services.xserver.desktopManager.kde4.enable = true; - - # Define a user account. Don't forget to set a password with ‘passwd’. - # users.extraUsers.guest = { - # isNormalUser = true; - # uid = 1000; - # }; - - # The NixOS release to be compatible with for stateful data such as databases. - system.stateVersion = "16.09"; - - boot.initrd.availableKernelModules = [ "ata_piix" "uhci_hcd" "ehci_pci" "sd_mod" "sr_mod" ]; - - fileSystems."/" = - { device = "/dev/disk/by-uuid/7238cc6e-4bea-4e52-9408-32d8aa05abff"; - fsType = "ext4"; - }; - - fileSystems."/boot" = - { device = "/dev/disk/by-uuid/5e923175-854b-4bcf-97c8-f3a91806fa22"; - fsType = "ext2"; - }; - - nix.maxJobs = lib.mkDefault 1; - } diff --git a/nin/source.nix b/nin/source.nix index 5dd4311f2..183c71bae 100644 --- a/nin/source.nix +++ b/nin/source.nix @@ -14,6 +14,6 @@ in stockholm.file = toString <stockholm>; nixpkgs.git = { url = https://github.com/nixos/nixpkgs; - ref = "01c3847"; + ref = "799435b"; }; } |