summaryrefslogtreecommitdiffstats
path: root/makefu/2configs
diff options
context:
space:
mode:
Diffstat (limited to 'makefu/2configs')
-rw-r--r--makefu/2configs/backup.nix30
-rw-r--r--makefu/2configs/default.nix22
-rw-r--r--makefu/2configs/nginx/update.connector.one.nix26
-rw-r--r--makefu/2configs/omo-share.nix (renamed from makefu/2configs/nginx/omo-share.nix)34
-rw-r--r--makefu/2configs/unstable-sources.nix2
5 files changed, 99 insertions, 15 deletions
diff --git a/makefu/2configs/backup.nix b/makefu/2configs/backup.nix
new file mode 100644
index 000000000..ed6d1f4a7
--- /dev/null
+++ b/makefu/2configs/backup.nix
@@ -0,0 +1,30 @@
+{ config, lib, ... }:
+with lib;
+let
+ startAt = "0,6,12,18:00";
+ defaultBackupServer = config.krebs.hosts.omo;
+ defaultBackupDir = "/home/backup";
+ defaultPull = host: src: {
+ method = "pull";
+ src = {
+ inherit host;
+ path = src;
+ };
+ dst = {
+ host = defaultBackupServer;
+ path = defaultBackupDir + src;
+ };
+ startAt = "0,6,12,18:00";
+ snapshots = {
+ hourly = { format = "%Y-%m-%dT%H"; retain = 4; };
+ daily = { format = "%Y-%m-%d"; retain = 7; };
+ weekly = { format = "%YW%W"; retain = 4; };
+ monthly = { format = "%Y-%m"; retain = 12; };
+ yearly = { format = "%Y"; };
+ };
+ };
+in {
+ krebs.backup.plans = addNames {
+ wry-to-omo_var-www = defaultPull wry "/var/www";
+ };
+}
diff --git a/makefu/2configs/default.nix b/makefu/2configs/default.nix
index ec1100582..a98393e2b 100644
--- a/makefu/2configs/default.nix
+++ b/makefu/2configs/default.nix
@@ -20,24 +20,18 @@ with lib;
build = {
target = mkDefault "root@${config.krebs.build.host.name}";
user = config.krebs.users.makefu;
- source = {
- git.nixpkgs = {
- #url = https://github.com/NixOS/nixpkgs;
+ source = {
+ upstream-nixpkgs = {
url = mkDefault https://github.com/nixos/nixpkgs;
rev = mkDefault "93d8671e2c6d1d25f126ed30e5e6f16764330119"; # unstable @ 2015-01-03, tested on filepimp
- target-path = "/var/src/nixpkgs";
};
+ secrets = "/home/makefu/secrets/${config.krebs.build.host.name}/";
+ stockholm = "/home/makefu/stockholm";
- dir.secrets = {
- host = config.krebs.hosts.pornocauster;
- path = "/home/makefu/secrets/${config.krebs.build.host.name}/";
- };
-
- dir.stockholm = {
- host = config.krebs.hosts.pornocauster;
- path = "/home/makefu/stockholm" ;
- target-path = "/var/src/stockholm";
- };
+ # Defaults for all stockholm users?
+ nixos-config = "symlink:stockholm/${config.krebs.build.user.name}/1systems/${config.krebs.build.host.name}.nix";
+ nixpkgs = symlink:stockholm/nixpkgs;
+ stockholm-user = "symlink:stockholm/${config.krebs.build.user.name}";
};
};
};
diff --git a/makefu/2configs/nginx/update.connector.one.nix b/makefu/2configs/nginx/update.connector.one.nix
new file mode 100644
index 000000000..eb39a1668
--- /dev/null
+++ b/makefu/2configs/nginx/update.connector.one.nix
@@ -0,0 +1,26 @@
+{ config, lib, pkgs, ... }:
+
+with lib;
+let
+ hostname = config.krebs.build.host.name;
+ external-ip = head config.krebs.build.host.nets.internet.addrs4;
+in {
+ krebs.nginx = {
+ enable = mkDefault true;
+ servers = {
+ omo-share = {
+ listen = [ "${external-ip}:80" ];
+ server-names = [
+ "update.connector.one"
+ "firmware.connector.one"
+ ];
+ locations = singleton (nameValuePair "/" ''
+ autoindex on;
+ root /var/www/update.connector.one;
+ sendfile on;
+ gzip on;
+ '');
+ };
+ };
+ };
+}
diff --git a/makefu/2configs/nginx/omo-share.nix b/makefu/2configs/omo-share.nix
index ce85e0442..1e0975e1d 100644
--- a/makefu/2configs/nginx/omo-share.nix
+++ b/makefu/2configs/omo-share.nix
@@ -31,4 +31,38 @@ in {
};
};
};
+
+ # samba share /media/crypt1/share
+ users.users.smbguest = {
+ name = "smbguest";
+ uid = config.ids.uids.smbguest;
+ description = "smb guest user";
+ home = "/var/empty";
+ };
+ services.samba = {
+ enable = true;
+ shares = {
+ winshare = {
+ path = "/media/crypt1/share";
+ "read only" = "no";
+ browseable = "yes";
+ "guest ok" = "yes";
+ };
+ usenet = {
+ path = "/media/crypt0/usenet/dst";
+ "read only" = "yes";
+ browseable = "yes";
+ "guest ok" = "yes";
+ };
+ };
+ extraConfig = ''
+ guest account = smbguest
+ map to guest = bad user
+ # disable printing
+ load printers = no
+ printing = bsd
+ printcap name = /dev/null
+ disable spoolss = yes
+ '';
+ };
}
diff --git a/makefu/2configs/unstable-sources.nix b/makefu/2configs/unstable-sources.nix
index 7a9a8a81c..a34377683 100644
--- a/makefu/2configs/unstable-sources.nix
+++ b/makefu/2configs/unstable-sources.nix
@@ -1,7 +1,7 @@
_:
{
- krebs.build.source.git.nixpkgs = {
+ krebs.build.source.nixpkgs = {
url = https://github.com/makefu/nixpkgs;
rev = "15b5bbfbd1c8a55e7d9e05dd9058dc102fac04fe"; # cherry-picked collectd
};