summaryrefslogtreecommitdiffstats
path: root/lass
diff options
context:
space:
mode:
Diffstat (limited to 'lass')
-rw-r--r--lass/1systems/helios/config.nix87
-rw-r--r--lass/1systems/helios/source.nix4
-rw-r--r--lass/1systems/mors/config.nix3
-rw-r--r--lass/2configs/baseX.nix6
-rw-r--r--lass/2configs/exim-smarthost.nix1
-rw-r--r--lass/2configs/git.nix17
-rw-r--r--lass/2configs/retiolum.nix10
-rw-r--r--lass/2configs/vim.nix7
-rw-r--r--lass/2configs/websites/lassulus.nix68
-rw-r--r--lass/2configs/xresources.nix4
-rw-r--r--lass/3modules/umts.nix6
-rw-r--r--lass/5pkgs/default.nix5
-rw-r--r--lass/5pkgs/dpass/default.nix12
-rw-r--r--lass/5pkgs/xmonad-lass.nix18
14 files changed, 213 insertions, 35 deletions
diff --git a/lass/1systems/helios/config.nix b/lass/1systems/helios/config.nix
new file mode 100644
index 000000000..37bdc0290
--- /dev/null
+++ b/lass/1systems/helios/config.nix
@@ -0,0 +1,87 @@
+with import <stockholm/lib>;
+{ config, lib, pkgs, ... }:
+
+{
+ imports = [
+ <stockholm/lass>
+ <stockholm/lass/2configs/baseX.nix>
+ <stockholm/lass/2configs/browsers.nix>
+ <stockholm/lass/2configs/mouse.nix>
+ <stockholm/lass/2configs/pass.nix>
+ <stockholm/lass/2configs/retiolum.nix>
+ <stockholm/lass/2configs/otp-ssh.nix>
+ <stockholm/lass/2configs/git.nix>
+ <stockholm/lass/2configs/fetchWallpaper.nix>
+ { # automatic hardware detection
+ boot.initrd.availableKernelModules = [ "xhci_pci" "nvme" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ];
+ boot.kernelModules = [ "kvm-intel" ];
+
+ fileSystems."/" =
+ { device = "/dev/pool/root";
+ fsType = "btrfs";
+ };
+
+ fileSystems."/boot" =
+ { device = "/dev/disk/by-uuid/1F60-17C6";
+ fsType = "vfat";
+ };
+
+ fileSystems."/home" =
+ { device = "/dev/pool/home";
+ fsType = "btrfs";
+ };
+
+ nix.maxJobs = lib.mkDefault 8;
+ }
+ { # crypto stuff
+ boot.initrd.luks = {
+ cryptoModules = [ "aes" "sha512" "sha1" "xts" ];
+ devices = [{
+ name = "luksroot";
+ device = "/dev/nvme0n1p3";
+ }];
+ };
+ }
+ {
+ services.xserver.dpi = 200;
+ fonts.fontconfig.dpi = 200;
+ lass.myFont = "-schumacher-clean-*-*-*-*-25-*-*-*-*-*-iso10646-1";
+ }
+ ];
+ krebs.build.host = config.krebs.hosts.helios;
+
+ krebs.git.rules = [
+ {
+ user = [ config.krebs.users.lass-helios ];
+ repo = [ config.krebs.git.repos.stockholm ];
+ perm = with git; push "refs/heads/*" [ fast-forward non-fast-forward create delete merge ];
+ }
+ ];
+
+ # Use the systemd-boot EFI boot loader.
+ boot.loader.systemd-boot.enable = true;
+ boot.loader.efi.canTouchEfiVariables = true;
+
+ networking.wireless.enable = true;
+ hardware.enableRedistributableFirmware = true;
+
+ environment.systemPackages = with pkgs; [
+ vim
+ rxvt_unicode
+ git
+ rsync
+ hashPassword
+ thunderbird
+ dpass
+ ];
+
+ users.users = {
+ root.openssh.authorizedKeys.keys = [
+ config.krebs.users.lass-helios.pubkey
+ ];
+ };
+
+ programs.ssh.startAgent = lib.mkForce true;
+
+ services.tlp.enable = true;
+}
diff --git a/lass/1systems/helios/source.nix b/lass/1systems/helios/source.nix
new file mode 100644
index 000000000..bfe4dca4c
--- /dev/null
+++ b/lass/1systems/helios/source.nix
@@ -0,0 +1,4 @@
+import <stockholm/lass/source.nix> {
+ name = "helios";
+ secure = true;
+}
diff --git a/lass/1systems/mors/config.nix b/lass/1systems/mors/config.nix
index 4d2f8b0f8..8b90cce77 100644
--- a/lass/1systems/mors/config.nix
+++ b/lass/1systems/mors/config.nix
@@ -38,7 +38,7 @@ with import <stockholm/lib>;
{
lass.umts = {
enable = true;
- modem = "/dev/serial/by-id/usb-Lenovo_F5521gw_C12AD95CB7B78F90-if09";
+ modem = "/dev/serial/by-id/usb-Lenovo_F5521gw_2C7D8D7C35FC7040-if09";
initstrings = ''
Init1 = AT+CFUN=1
Init2 = AT+CGDCONT=1,"IP","pinternet.interkom.de","",0,0
@@ -133,6 +133,7 @@ with import <stockholm/lib>;
iodine
macchanger
+ dpass
];
#TODO: fix this shit
diff --git a/lass/2configs/baseX.nix b/lass/2configs/baseX.nix
index 3a99e65a0..0e0273dcc 100644
--- a/lass/2configs/baseX.nix
+++ b/lass/2configs/baseX.nix
@@ -27,6 +27,12 @@ in {
lass ALL= (root) NOPASSWD:SETENV: ${pkgs.sshuttle}/bin/.sshuttle-wrapped
'';
}
+ { #font magic
+ options.lass.myFont = mkOption {
+ type = types.str;
+ default = "-schumacher-clean-*-*-*-*-*-*-*-*-*-*-iso10646-1";
+ };
+ }
];
users.extraUsers.mainUser.extraGroups = [ "audio" "video" ];
diff --git a/lass/2configs/exim-smarthost.nix b/lass/2configs/exim-smarthost.nix
index a70d58828..c9d7a369a 100644
--- a/lass/2configs/exim-smarthost.nix
+++ b/lass/2configs/exim-smarthost.nix
@@ -42,6 +42,7 @@ with import <stockholm/lib>;
{ from = "securityfocus@lassul.us"; to = lass.mail; }
{ from = "radio@lassul.us"; to = lass.mail; }
{ from = "btce@lassul.us"; to = lass.mail; }
+ { from = "raf@lassul.us"; to = lass.mail; }
];
system-aliases = [
{ from = "mailer-daemon"; to = "postmaster"; }
diff --git a/lass/2configs/git.nix b/lass/2configs/git.nix
index 7bce93ae1..3991acadc 100644
--- a/lass/2configs/git.nix
+++ b/lass/2configs/git.nix
@@ -14,7 +14,7 @@ let
root-desc = "keep calm and engage";
};
};
- repos = mapAttrs (_: s: removeAttrs s ["collaborators"]) repos;
+ repos = repos;
rules = rules;
};
@@ -87,8 +87,8 @@ let
public = true;
};
- make-restricted-repo = name: { collaborators ? [], announce ? false, hooks ? {}, ... }: {
- inherit collaborators name;
+ make-restricted-repo = name: { admins ? [], collaborators ? [], announce ? false, hooks ? {}, ... }: {
+ inherit admins collaborators name;
public = false;
hooks = optionalAttrs announce {
post-receive = pkgs.git-hooks.irc-announce {
@@ -111,15 +111,20 @@ let
repo = [ repo ];
perm = push "refs/*" [ non-fast-forward create delete merge ];
} ++
- optional repo.public {
- user = attrValues config.krebs.users;
+ optional (length (repo.admins or []) > 0) {
+ user = repo.admins;
repo = [ repo ];
- perm = fetch;
+ perm = push "refs/*" [ non-fast-forward create delete merge ];
} ++
optional (length (repo.collaborators or []) > 0) {
user = repo.collaborators;
repo = [ repo ];
perm = fetch;
+ } ++
+ optional repo.public {
+ user = attrValues config.krebs.users;
+ repo = [ repo ];
+ perm = fetch;
};
in out
diff --git a/lass/2configs/retiolum.nix b/lass/2configs/retiolum.nix
index e7779f53e..fb76c5735 100644
--- a/lass/2configs/retiolum.nix
+++ b/lass/2configs/retiolum.nix
@@ -1,12 +1,14 @@
-{ pkgs, ... }:
+{ config, pkgs, ... }:
{
krebs.iptables = {
tables = {
- filter.INPUT.rules = [
- { predicate = "-p tcp --dport tinc"; target = "ACCEPT"; }
- { predicate = "-p udp --dport tinc"; target = "ACCEPT"; }
+ filter.INPUT.rules = let
+ tincport = toString config.krebs.build.host.nets.retiolum.tinc.port;
+ in [
+ { predicate = "-p tcp --dport ${tincport}"; target = "ACCEPT"; }
+ { predicate = "-p udp --dport ${tincport}"; target = "ACCEPT"; }
];
};
};
diff --git a/lass/2configs/vim.nix b/lass/2configs/vim.nix
index 29800dbeb..7f36fcd90 100644
--- a/lass/2configs/vim.nix
+++ b/lass/2configs/vim.nix
@@ -106,9 +106,10 @@ let
pkgs.vimPlugins.undotree
(pkgs.vimUtils.buildVimPlugin {
name = "file-line-1.0";
- src = pkgs.fetchgit {
- url = git://github.com/bogado/file-line;
- rev = "refs/tags/1.0";
+ src = pkgs.fetchFromGitHub {
+ owner = "bogado";
+ repo = "file-line";
+ rev = "1.0";
sha256 = "0z47zq9rqh06ny0q8lpcdsraf3lyzn9xvb59nywnarf3nxrk6hx0";
};
})
diff --git a/lass/2configs/websites/lassulus.nix b/lass/2configs/websites/lassulus.nix
index 93b817c3b..17c39a5f4 100644
--- a/lass/2configs/websites/lassulus.nix
+++ b/lass/2configs/websites/lassulus.nix
@@ -6,22 +6,70 @@ let
genid
;
+ servephpBB = domains:
+ let
+ domain = head domains;
+
+ in {
+ services.nginx.virtualHosts."${domain}" = {
+ enableACME = true;
+ forceSSL = true;
+ serverAliases = domains;
+ extraConfig = ''
+ index index.php;
+ root /srv/http/${domain}/;
+ access_log /tmp/nginx_acc.log;
+ error_log /tmp/nginx_err.log;
+ error_page 404 /404.html;
+ error_page 500 502 503 504 /50x.html;
+ client_max_body_size 100m;
+ '';
+ locations."/".extraConfig = ''
+ try_files $uri $uri/ /index.php?$args;
+ '';
+ locations."~ \.php(?:$|/)".extraConfig = ''
+ fastcgi_split_path_info ^(.+\.php)(/.+)$;
+ include ${pkgs.nginx}/conf/fastcgi_params;
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ fastcgi_param PATH_INFO $fastcgi_path_info;
+ fastcgi_param HTTPS on;
+ fastcgi_param modHeadersAvailable true; #Avoid sending the security headers twice
+ fastcgi_pass unix:/srv/http/${domain}/phpfpm.pool;
+ fastcgi_intercept_errors on;
+ '';
+ #Directives to send expires headers and turn off 404 error logging.
+ locations."~* ^.+\.(xml|ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|css|rss|atom|js|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf)$".extraConfig = ''
+ access_log off;
+ log_not_found off;
+ expires max;
+ '';
+ };
+ services.phpfpm.poolConfigs."${domain}" = ''
+ listen = /srv/http/${domain}/phpfpm.pool
+ user = nginx
+ group = nginx
+ pm = dynamic
+ pm.max_children = 25
+ pm.start_servers = 5
+ pm.min_spare_servers = 3
+ pm.max_spare_servers = 20
+ listen.owner = nginx
+ listen.group = nginx
+ php_admin_value[error_log] = 'stderr'
+ php_admin_flag[log_errors] = on
+ catch_workers_output = yes
+ '';
+ };
+
in {
imports = [
./default.nix
../git.nix
+ (servephpBB [ "rote-allez-fraktion.de" ])
];
security.acme = {
certs."lassul.us" = {
- email = "lass@lassul.us";
- webroot = "/var/lib/acme/acme-challenges";
- plugins = [
- "account_key.json"
- "key.pem"
- "fullchain.pem"
- "full.pem"
- ];
allowKeysForGroup = true;
group = "lasscert";
};
@@ -71,13 +119,11 @@ in {
];
services.nginx.virtualHosts."lassul.us" = {
+ enableACME = true;
serverAliases = [ "lassul.us" ];
locations."/".extraConfig = ''
root /srv/http/lassul.us;
'';
- locations."/.well-known/acme-challenge".extraConfig = ''
- root /var/lib/acme/challenges/lassul.us/;
- '';
locations."= /retiolum-hosts.tar.bz2".extraConfig = ''
alias ${config.krebs.tinc.retiolum.hostsArchive};
'';
diff --git a/lass/2configs/xresources.nix b/lass/2configs/xresources.nix
index 2fbc31677..adbcd353d 100644
--- a/lass/2configs/xresources.nix
+++ b/lass/2configs/xresources.nix
@@ -8,8 +8,8 @@ let
URxvt*scrollBar: false
URxvt*urgentOnBell: true
URxvt*SaveLines: 4096
- URxvt*font: -*-clean-*-*-*-*-*-*-*-*-*-*-iso10646-1
- URxvt*boldFont: -*-clean-*-*-*-*-*-*-*-*-*-*-iso10646-1
+ URxvt*font: ${config.lass.myFont}
+ URxvt*boldFont: ${config.lass.myFont}
! ref https://github.com/muennich/urxvt-perls
URxvt.perl-lib: ${pkgs.urxvt_perls}/lib/urxvt/perl
diff --git a/lass/3modules/umts.nix b/lass/3modules/umts.nix
index c93c65ad2..207278440 100644
--- a/lass/3modules/umts.nix
+++ b/lass/3modules/umts.nix
@@ -61,6 +61,7 @@ let
'';
wvdial-defaults = ''
+ [Dialer Defaults]
Modem = ${cfg.modem}
${cfg.initstrings}
Modem Type = Analog Modem
@@ -70,6 +71,7 @@ let
Password = ${cfg.password}
Stupid Mode = 1
Idle Seconds = 0
+ PPPD Path = ${pkgs.ppp}/bin/pppd
'';
imp = {
@@ -77,6 +79,10 @@ let
umts = "sudo ${umts-bin}/bin/umts";
};
+ environment.systemPackages = [
+ pkgs.ppp
+ ];
+
security.sudo.extraConfig = ''
lass ALL= (root) NOPASSWD: ${umts-bin}/bin/umts
'';
diff --git a/lass/5pkgs/default.nix b/lass/5pkgs/default.nix
index 6e6ba56fa..46633ba1a 100644
--- a/lass/5pkgs/default.nix
+++ b/lass/5pkgs/default.nix
@@ -1,8 +1,9 @@
-{ pkgs, ... }@args:
+{ config, pkgs, ... }@args:
{
nixpkgs.config.packageOverrides = rec {
acronym = pkgs.callPackage ./acronym/default.nix {};
+ dpass = pkgs.callPackage ./dpass {};
ejabberd = pkgs.callPackage ./ejabberd {
erlang = pkgs.erlangR16;
};
@@ -20,7 +21,7 @@
rs = pkgs.callPackage ./rs/default.nix {};
urban = pkgs.callPackage ./urban/default.nix {};
xml2json = pkgs.callPackage ./xml2json/default.nix {};
- xmonad-lass = import ./xmonad-lass.nix { inherit pkgs; };
+ xmonad-lass = import ./xmonad-lass.nix { inherit config pkgs; };
yt-next = pkgs.callPackage ./yt-next/default.nix {};
};
}
diff --git a/lass/5pkgs/dpass/default.nix b/lass/5pkgs/dpass/default.nix
new file mode 100644
index 000000000..7e75d50c7
--- /dev/null
+++ b/lass/5pkgs/dpass/default.nix
@@ -0,0 +1,12 @@
+{ pass, writeOut, writeDash, ... }:
+
+writeOut "dsco-pass" {
+ "/bin/dpass".link = writeDash "dpass" ''
+ PASSWORD_STORE_DIR=$HOME/.dpasswordstore \
+ exec ${pass}/bin/pass $@
+ '';
+ "/bin/dpassmenu".link = writeDash "dpassmenu" ''
+ PASSWORD_STORE_DIR=$HOME/.dpasswordstore \
+ exec ${pass}/bin/passmenu $@
+ '';
+}
diff --git a/lass/5pkgs/xmonad-lass.nix b/lass/5pkgs/xmonad-lass.nix
index 67a1dc787..bf737dc5e 100644
--- a/lass/5pkgs/xmonad-lass.nix
+++ b/lass/5pkgs/xmonad-lass.nix
@@ -1,4 +1,4 @@
-{ pkgs, ... }:
+{ config, pkgs, ... }:
pkgs.writeHaskell "xmonad-lass" {
executables.xmonad = {
extra-depends = [
@@ -40,7 +40,7 @@ import XMonad.Hooks.UrgencyHook (SpawnUrgencyHook(..), withUrgencyHook)
import XMonad.Layout.FixedColumn (FixedColumn(..))
import XMonad.Layout.Minimize (minimize, minimizeWindow, MinimizeMsg(RestoreNextMinimizedWin))
import XMonad.Layout.NoBorders (smartBorders)
-import XMonad.Prompt (autoComplete, searchPredicate, XPConfig)
+import XMonad.Prompt (autoComplete, font, searchPredicate, XPConfig)
import XMonad.Prompt.Window (windowPromptGoto, windowPromptBringCopy)
import XMonad.Util.EZConfig (additionalKeysP)
import XMonad.Layout.SimpleFloat (simpleFloat)
@@ -51,7 +51,7 @@ urxvtcPath :: FilePath
urxvtcPath = "${pkgs.rxvt_unicode}/bin/urxvtc"
myFont :: String
-myFont = "-schumacher-*-*-*-*-*-*-*-*-*-*-*-iso10646-*"
+myFont = "${config.lass.myFont}"
main :: IO ()
main = getArgs >>= \case
@@ -99,6 +99,7 @@ myKeyMap =
, ("M4-C-p", spawn "${pkgs.scrot}/bin/scrot ~/public_html/scrot.png")
, ("M4-p", spawn "${pkgs.pass}/bin/passmenu --type")
, ("M4-o", spawn "${pkgs.brain}/bin/brainmenu --type")
+ , ("M4-i", spawn "${pkgs.dpass}/bin/dpassmenu --type")
, ("<XF86AudioRaiseVolume>", spawn "${pkgs.pulseaudioLight.out}/bin/pactl -- set-sink-volume @DEFAULT_SINK@ +4%")
, ("<XF86AudioLowerVolume>", spawn "${pkgs.pulseaudioLight.out}/bin/pactl -- set-sink-volume @DEFAULT_SINK@ -4%")
, ("<XF86MonBrightnessDown>", spawn "${pkgs.xorg.xbacklight}/bin/xbacklight -time 0 -dec 1%")
@@ -107,8 +108,8 @@ myKeyMap =
, ("M4-C-k", spawn "${pkgs.xorg.xkill}/bin/xkill")
, ("M4-a", focusUrgent)
- , ("M4-S-r", renameWorkspace def)
- , ("M4-S-a", addWorkspacePrompt def)
+ , ("M4-S-r", renameWorkspace myXPConfig)
+ , ("M4-S-a", addWorkspacePrompt myXPConfig)
, ("M4-S-<Backspace>", removeEmptyWorkspace)
, ("M4-S-c", kill1)
, ("M4-<Esc>", toggleWS)
@@ -141,8 +142,13 @@ forkFile :: FilePath -> [String] -> Maybe [(String, String)] -> X ()
forkFile path args env =
xfork (executeFile path False args env) >> return ()
+myXPConfig :: XPConfig
+myXPConfig = def
+ { font = myFont
+ }
+
autoXPConfig :: XPConfig
-autoXPConfig = def
+autoXPConfig = myXPConfig
{ autoComplete = Just 5000
}