summaryrefslogtreecommitdiffstats
path: root/tv
diff options
context:
space:
mode:
Diffstat (limited to 'tv')
-rw-r--r--tv/1systems/wu.nix8
-rw-r--r--tv/1systems/xu.nix1
-rw-r--r--tv/2configs/backup.nix42
-rw-r--r--tv/2configs/charybdis.nix4
-rw-r--r--tv/2configs/default.nix1
-rw-r--r--tv/2configs/pulse.nix8
-rw-r--r--tv/2configs/vim.nix34
-rw-r--r--tv/2configs/xserver/default.nix2
-rw-r--r--tv/3modules/consul.nix4
-rw-r--r--tv/3modules/ejabberd.nix4
10 files changed, 88 insertions, 20 deletions
diff --git a/tv/1systems/wu.nix b/tv/1systems/wu.nix
index cd3139754..54ceb7783 100644
--- a/tv/1systems/wu.nix
+++ b/tv/1systems/wu.nix
@@ -16,7 +16,6 @@ with lib;
environment.systemPackages = with pkgs; [
# stockholm
- genid
gnumake
hashPassword
lentil
@@ -234,7 +233,12 @@ with lib;
KERNEL=="hpet", GROUP="audio"
'';
- services.bitlbee.enable = true;
+ services.bitlbee = {
+ enable = true;
+ plugins = [
+ pkgs.bitlbee-facebook
+ ];
+ };
services.tor.client.enable = true;
services.tor.enable = true;
services.virtualboxHost.enable = true;
diff --git a/tv/1systems/xu.nix b/tv/1systems/xu.nix
index eac36fafb..1f3e010a4 100644
--- a/tv/1systems/xu.nix
+++ b/tv/1systems/xu.nix
@@ -19,7 +19,6 @@ with lib;
environment.systemPackages = with pkgs; [
# stockholm
- genid
gnumake
hashPassword
lentil
diff --git a/tv/2configs/backup.nix b/tv/2configs/backup.nix
new file mode 100644
index 000000000..51d3bb8a7
--- /dev/null
+++ b/tv/2configs/backup.nix
@@ -0,0 +1,42 @@
+{ config, lib, ... }:
+with lib;
+{
+ krebs.backup.plans = addNames {
+ xu-test-cd = {
+ method = "push";
+
+ src = { host = config.krebs.hosts.xu; path = "/tmp/xu-test"; };
+ dst = { host = config.krebs.hosts.cd; path = "/tmp/backups/xu-test"; };
+
+ #startAt = "0,6,12,18:00";
+ startAt = "minutely";
+ snapshots = {
+ minutely = { format = "%Y-%m-%dT%H:%M"; retain = 5; };
+ 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"; };
+ };
+ };
+ #xu-test-wu = {
+ # method = "push";
+ # dst = { user = tv; host = wu; path = "/krebs/backup/xu-test"; };
+ #};
+ cd-test-xu = {
+ method = "pull";
+ src = { host = config.krebs.hosts.cd; path = "/tmp/cd-test"; };
+ dst = { host = config.krebs.hosts.xu; path = "/tmp/backups/cd-test"; };
+ startAt = "minutely";
+ snapshots = {
+ minutely = { format = "%Y-%m-%dT%H:%M"; retain = 5; };
+ 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"; };
+ };
+ };
+
+ };
+}
diff --git a/tv/2configs/charybdis.nix b/tv/2configs/charybdis.nix
index 80c6f7c4a..f9ab3da68 100644
--- a/tv/2configs/charybdis.nix
+++ b/tv/2configs/charybdis.nix
@@ -72,9 +72,9 @@ let
};
};
- user = {
+ user = rec {
name = "charybdis";
- uid = 3748224544; # genid charybdis
+ uid = genid name;
};
configFile = toFile "charybdis-ircd.conf" ''
diff --git a/tv/2configs/default.nix b/tv/2configs/default.nix
index 3400c13b6..c300633bb 100644
--- a/tv/2configs/default.nix
+++ b/tv/2configs/default.nix
@@ -28,6 +28,7 @@ with lib;
imports = [
<secrets>
+ ./backup.nix
./vim.nix
{
# stockholm dependencies
diff --git a/tv/2configs/pulse.nix b/tv/2configs/pulse.nix
index 0ddc52789..3db3532d5 100644
--- a/tv/2configs/pulse.nix
+++ b/tv/2configs/pulse.nix
@@ -69,12 +69,10 @@ in
};
};
- users = let
- id = 3768151709; # genid pulse
- in {
- groups.pulse.gid = id;
+ users = {
+ groups.pulse.gid = config.users.users.pulse.uid;
users.pulse = {
- uid = id;
+ uid = genid "pulse";
group = "pulse";
extraGroups = [ "audio" ];
home = "${runDir}/home";
diff --git a/tv/2configs/vim.nix b/tv/2configs/vim.nix
index 0822fb5bf..0537fa7d8 100644
--- a/tv/2configs/vim.nix
+++ b/tv/2configs/vim.nix
@@ -4,7 +4,7 @@ with lib;
let
out = {
environment.systemPackages = [
- pkgs.vim
+ vim
];
# Nano really is just a stupid name for Vim.
@@ -22,14 +22,38 @@ let
"${pkgs.vimPlugins.undotree}/share/vim-plugins/undotree"
];
+ dirs = {
+ backupdir = "$HOME/.cache/vim/backup";
+ swapdir = "$HOME/.cache/vim/swap";
+ undodir = "$HOME/.cache/vim/undo";
+ };
+ files = {
+ viminfo = "$HOME/.cache/vim/info";
+ };
+
+ mkdirs = let
+ dirOf = s: let out = concatStringsSep "/" (init (splitString "/" s));
+ in assert out != ""; out;
+ alldirs = attrValues dirs ++ map dirOf (attrValues files);
+ in unique (sort lessThan alldirs);
+
+ vim = pkgs.writeScriptBin "vim" ''
+ #! ${pkgs.dash}/bin/dash
+ set -f
+ umask 0077
+ ${concatStringsSep "\n" (map (x: "mkdir -p ${x}") mkdirs)}
+ umask 0022
+ exec ${pkgs.vim}/bin/vim "$@"
+ '';
+
vimrc = pkgs.writeText "vimrc" ''
set nocompatible
set autoindent
set backspace=indent,eol,start
set backup
- set backupdir=$HOME/.vim/backup/
- set directory=$HOME/.vim/cache//
+ set backupdir=${dirs.backupdir}/
+ set directory=${dirs.swapdir}//
set hlsearch
set incsearch
set mouse=a
@@ -40,11 +64,11 @@ let
set showcmd
set showmatch
set ttimeoutlen=0
- set undodir=$HOME/.vim/undo
+ set undodir=${dirs.undodir}
set undofile
set undolevels=1000000
set undoreload=1000000
- set viminfo='20,<1000,s100,h,n$HOME/.vim/cache/info
+ set viminfo='20,<1000,s100,h,n${files.viminfo}
set visualbell
set wildignore+=*.o,*.class,*.hi,*.dyn_hi,*.dyn_o
set wildmenu
diff --git a/tv/2configs/xserver/default.nix b/tv/2configs/xserver/default.nix
index f56da7dcc..facde4e76 100644
--- a/tv/2configs/xserver/default.nix
+++ b/tv/2configs/xserver/default.nix
@@ -48,7 +48,7 @@ let
"slock"
];
- systemd.services.display-manager = mkForce {};
+ systemd.services.display-manager.enable = false;
services.xserver.enable = true;
diff --git a/tv/3modules/consul.nix b/tv/3modules/consul.nix
index ccdee07f5..5c955fdb5 100644
--- a/tv/3modules/consul.nix
+++ b/tv/3modules/consul.nix
@@ -109,9 +109,9 @@ let
};
};
- user = {
+ user = rec {
name = "consul";
- uid = 2999951406; # genid consul
+ uid = genid name;
};
in
diff --git a/tv/3modules/ejabberd.nix b/tv/3modules/ejabberd.nix
index 6b231fb56..581e10074 100644
--- a/tv/3modules/ejabberd.nix
+++ b/tv/3modules/ejabberd.nix
@@ -53,9 +53,9 @@ let
};
};
- user = {
+ user = rec {
name = "ejabberd";
- uid = 3499746127; # genid ejabberd
+ uid = genid name;
};
my-ejabberdctl = pkgs.writeScriptBin "ejabberdctl" ''