diff options
author | Alan Pearce | 2019-10-02 16:55:35 +0200 |
---|---|---|
committer | Alan Pearce | 2019-10-02 16:55:35 +0200 |
commit | 340b2c244c0b7c331f6633edf9a69f1381916ad2 (patch) | |
tree | 2f430f20fbe01191c6b4a455bf792facef3f4fe7 /system/modules/satoshipay.nix | |
parent | ec7f1357d16ff2f4aa7430a2940a0b9519018595 (diff) | |
parent | 5016c7440ad771fd990e1aa142fc4de0bdc382bd (diff) | |
download | nixfiles-340b2c244c0b7c331f6633edf9a69f1381916ad2.tar.lz nixfiles-340b2c244c0b7c331f6633edf9a69f1381916ad2.tar.zst nixfiles-340b2c244c0b7c331f6633edf9a69f1381916ad2.zip |
Add 'system/' from commit '5016c7440ad771fd990e1aa142fc4de0bdc382bd'
git-subtree-dir: system git-subtree-mainline: ec7f1357d16ff2f4aa7430a2940a0b9519018595 git-subtree-split: 5016c7440ad771fd990e1aa142fc4de0bdc382bd
Diffstat (limited to 'system/modules/satoshipay.nix')
-rw-r--r-- | system/modules/satoshipay.nix | 96 |
1 files changed, 96 insertions, 0 deletions
diff --git a/system/modules/satoshipay.nix b/system/modules/satoshipay.nix new file mode 100644 index 00000000..4b648740 --- /dev/null +++ b/system/modules/satoshipay.nix @@ -0,0 +1,96 @@ +{ config, pkgs, fetchurl, lib, ... }: + +{ virtualisation = { + docker = let + daemonConfig = { + ipv6 = true; + fixed-cidr-v6 = "fd69:2074:9fcd:b0fd::/64"; + features = { + buildkit = true; + }; + }; + in { + enable = true; + enableOnBoot = false; + liveRestore = false; + + extraOptions = "--config-file=${pkgs.writeText "daemon.json" (builtins.toJSON daemonConfig)}"; + + autoPrune = { + enable = true; + }; + }; + }; + + nixpkgs.config.allowUnfree = true; + + environment.variables = { + KUBECTX_IGNORE_FZF = "1"; + }; + environment.systemPackages = with pkgs; [ + caddy + openssl + mongodb-tools + pgadmin + pgcli + s3cmd + sops + unstable.mkcert + unstable.google-cloud-sdk + unstable.docker_compose + unstable.kubernetes + unstable.kubectx + unstable.redis-desktop-manager + unstable.kubernetes-helm + unstable.helmfile + unstable.robo3t + unstable.slack + ]; + + services.mongodb = { + enable = true; + replSetName = "rs0"; + dbpath = "/tmp/mongodb"; + }; + systemd.services.mongodb.wantedBy = lib.mkForce []; + systemd.timers.mongodb = { + description = "Delayed startup of MongoDB"; + wantedBy = [ "timers.target" ]; + timerConfig = { + OnActiveSec = "1 min"; + }; + }; + systemd.services.mongodb-init = { + description = "Init mongodb replicaset"; + requires = [ "mongodb.service" ]; + script = "${pkgs.mongodb}/bin/mongo --eval 'rs.initiate()'"; + }; + systemd.timers.mongodb-init = { + wantedBy = [ "timers.target" ]; + timerConfig = { + OnActiveSec = "2 min"; + }; + }; + + services.redis = { + enable = true; + }; + systemd.services.redis.wantedBy = lib.mkForce []; + systemd.timers.redis = { + description = "Delayed startup of Redis"; + wantedBy = [ "timers.target" ]; + timerConfig = { + OnActiveSec = "1 min"; + }; + }; + + + services.printing.drivers = with pkgs; [ + ]; + + networking.domain = "satoshipay.io"; + + networking.extraHosts = '' + 127.0.0.1 blogger.local wallet.satoshipay.local api.satoshipay.local ws.satoshipay.local + ''; +} |