diff options
Diffstat (limited to 'tv/2configs')
41 files changed, 92 insertions, 131 deletions
diff --git a/tv/2configs/backup.nix b/tv/2configs/backup.nix index a5e0cf4..c8ab73b 100644 --- a/tv/2configs/backup.nix +++ b/tv/2configs/backup.nix @@ -1,6 +1,5 @@ -{ config, lib, ... }: -with import <stockholm/lib>; -{ +with import ./lib; +{ config, pkgs, ... }: { krebs.backup.plans = { } // mapAttrs (_: recursiveUpdate { snapshots = { diff --git a/tv/2configs/bash/default.nix b/tv/2configs/bash/default.nix index 92e2499..e38566b 100644 --- a/tv/2configs/bash/default.nix +++ b/tv/2configs/bash/default.nix @@ -1,8 +1,5 @@ -{ config, lib, pkgs, ... }: - -with import <stockholm/lib>; - -{ +with import ./lib; +{ config, pkgs, ... }: { programs.bash = { interactiveShellInit = /* sh */ '' HISTCONTROL='erasedups:ignorespace' @@ -17,8 +14,20 @@ with import <stockholm/lib>; case $UID in ${shell.escape (toString config.krebs.users.tv.uid)}) - if test ''${SHLVL-1} = 1; then - case ''${XMONAD_SPAWN_WORKSPACE-} in + if test ''${SHLVL-1} = 1 && test -n "''${DISPLAY-}"; then + _CURRENT_DESKTOP_NAME=''${_CURRENT_DESKTOP_NAME-$( + ${pkgs.xorg.xprop}/bin/xprop -notype -root \ + 32i _NET_CURRENT_DESKTOP \ + 8s _NET_DESKTOP_NAMES \ + | + ${pkgs.gnused}/bin/sed -r 's/.* = //;s/"//g;s/, /\a/g' | + { + read -r _NET_CURRENT_DESKTOP + IFS=$'\a' read -ra _NET_DESKTOP_NAMES + echo "''${_NET_DESKTOP_NAMES[$_NET_CURRENT_DESKTOP]}" + } + )} + case $_CURRENT_DESKTOP_NAME in stockholm) cd ~/stockholm ;; diff --git a/tv/2configs/bash/lib b/tv/2configs/bash/lib new file mode 120000 index 0000000..dc598c5 --- /dev/null +++ b/tv/2configs/bash/lib @@ -0,0 +1 @@ +../lib
\ No newline at end of file diff --git a/tv/2configs/binary-cache/default.nix b/tv/2configs/binary-cache/default.nix index 58791f4..66d7407 100644 --- a/tv/2configs/binary-cache/default.nix +++ b/tv/2configs/binary-cache/default.nix @@ -1,4 +1,4 @@ -{ config, lib, pkgs, ... }: with import <stockholm/lib>; +{ config, lib, pkgs, ... }: with import ./lib; { environment.etc."binary-cache.pubkey".text = config.krebs.build.host.binary-cache.pubkey; diff --git a/tv/2configs/binary-cache/lib b/tv/2configs/binary-cache/lib new file mode 120000 index 0000000..dc598c5 --- /dev/null +++ b/tv/2configs/binary-cache/lib @@ -0,0 +1 @@ +../lib
\ No newline at end of file diff --git a/tv/2configs/br.nix b/tv/2configs/br.nix index e6a46e9..4a8db2e 100644 --- a/tv/2configs/br.nix +++ b/tv/2configs/br.nix @@ -1,4 +1,4 @@ -with import <stockholm/lib>; +with import ./lib; { config, pkgs, ... }: { imports = [ diff --git a/tv/2configs/default.nix b/tv/2configs/default.nix index f3ce2da..9babb92 100644 --- a/tv/2configs/default.nix +++ b/tv/2configs/default.nix @@ -1,6 +1,5 @@ -with import <stockholm/lib>; +with import ./lib; { config, pkgs, ... }: { - boot.tmpOnTmpfs = true; krebs.enable = true; @@ -38,7 +37,7 @@ with import <stockholm/lib>; { i18n.defaultLocale = mkDefault "C.UTF-8"; security.sudo.extraConfig = '' - Defaults env_keep+="SSH_CLIENT XMONAD_SPAWN_WORKSPACE" + Defaults env_keep+="SSH_CLIENT _CURRENT_DESKTOP_NAME" Defaults mailto="${config.krebs.users.tv.mail}" Defaults !lecture ''; @@ -46,14 +45,15 @@ with import <stockholm/lib>; } { - # TODO check if both are required: - nix.sandboxPaths = [ "/etc/protocols" pkgs.iana-etc.outPath ]; - - nix.requireSignedBinaryCaches = true; - - nix.binaryCaches = ["https://cache.nixos.org"]; + nix.extraOptions = '' + auto-optimise-store = true + ''; - nix.useSandbox = true; + # TODO check if both are required: + nix.settings.extra-sandbox-paths = [ + "/etc/protocols" + pkgs.iana-etc.outPath + ]; } { nixpkgs.config.allowUnfree = false; diff --git a/tv/2configs/exim-retiolum.nix b/tv/2configs/exim-retiolum.nix index 3d4ada4..fefc6dd 100644 --- a/tv/2configs/exim-retiolum.nix +++ b/tv/2configs/exim-retiolum.nix @@ -1,8 +1,5 @@ -{ config, lib, pkgs, ... }: - -with import <stockholm/lib>; - -{ +with import ./lib; +{ config, pkgs, ... }: { environment.systemPackages = [ pkgs.eximlog ]; diff --git a/tv/2configs/exim-smarthost.nix b/tv/2configs/exim-smarthost.nix index 4a0dcf6..e905536 100644 --- a/tv/2configs/exim-smarthost.nix +++ b/tv/2configs/exim-smarthost.nix @@ -1,8 +1,5 @@ -{ config, lib, pkgs, ... }: - -with import <stockholm/lib>; - -{ +with import ./lib; +{ config, pkgs, ... }: { environment.systemPackages = [ pkgs.eximlog ]; diff --git a/tv/2configs/gitconfig.nix b/tv/2configs/gitconfig.nix index 771a4b2..fb9b78e 100644 --- a/tv/2configs/gitconfig.nix +++ b/tv/2configs/gitconfig.nix @@ -1,8 +1,5 @@ -{ config, pkgs, ... }: - -with import <stockholm/lib>; - -{ +with import ./lib; +{ config, pkgs, ... }: { environment.etc.gitconfig.text = '' [alias] patch = !${pkgs.git}/bin/git --no-pager diff --no-color diff --git a/tv/2configs/gitrepos.nix b/tv/2configs/gitrepos.nix index 50444c1..d8e7755 100644 --- a/tv/2configs/gitrepos.nix +++ b/tv/2configs/gitrepos.nix @@ -1,8 +1,5 @@ -{ config, lib, pkgs, ... }: - -with import <stockholm/lib>; - -let { +with import ./lib; +{ config, pkgs, ... }: let { body = { @@ -134,7 +131,6 @@ let { web-routes-wai-custom = {}; xintmap = {}; xmonad-aeson = {}; - xmonad-stockholm = {}; xmonad-web = {}; } // mapAttrs (_: recursiveUpdate { cgit.section = "4. museum"; }) { cac-api = { @@ -165,6 +161,7 @@ let { soundcloud = { cgit.desc = "SoundCloud command line interface"; }; + xmonad-stockholm = {}; }); restricted-repos = mapAttrs make-restricted-repo ( diff --git a/tv/2configs/htop.nix b/tv/2configs/htop.nix index e78caeb..0937298 100644 --- a/tv/2configs/htop.nix +++ b/tv/2configs/htop.nix @@ -1,8 +1,5 @@ -{ pkgs, ... }: - -with import <stockholm/lib>; - -{ +with import ./lib; +{ pkgs, ... }: { nixpkgs.config.packageOverrides = super: { htop = pkgs.symlinkJoin { name = "htop"; diff --git a/tv/2configs/hw/AO753.nix b/tv/2configs/hw/AO753.nix index dd6fcfe..b998fcf 100644 --- a/tv/2configs/hw/AO753.nix +++ b/tv/2configs/hw/AO753.nix @@ -1,8 +1,5 @@ -{ config, lib, pkgs, ... }: - -with import <stockholm/lib>; - -{ +with import ./lib; +{ config, pkgs, ... }: { imports = [ ../smartd.nix diff --git a/tv/2configs/hw/lib b/tv/2configs/hw/lib new file mode 120000 index 0000000..dc598c5 --- /dev/null +++ b/tv/2configs/hw/lib @@ -0,0 +1 @@ +../lib
\ No newline at end of file diff --git a/tv/2configs/hw/w110er.nix b/tv/2configs/hw/w110er.nix index 09dd9a4..bf749a9 100644 --- a/tv/2configs/hw/w110er.nix +++ b/tv/2configs/hw/w110er.nix @@ -1,6 +1,5 @@ -{ pkgs, ... }: let - lib = import <stockholm/lib>; -in { +with import ./lib; +{ pkgs, ... }: { imports = [ ../smartd.nix { diff --git a/tv/2configs/hw/x220.nix b/tv/2configs/hw/x220.nix index 8c68cde..ee3c7dc 100644 --- a/tv/2configs/hw/x220.nix +++ b/tv/2configs/hw/x220.nix @@ -1,7 +1,5 @@ -{ config, pkgs, ... }: let - lib = import <stockholm/lib>; -in -{ +with import ./lib; +{ config, pkgs, ... }: { imports = [ ../smartd.nix { @@ -28,8 +26,8 @@ in } { - nix.buildCores = 2; - nix.maxJobs = 2; + nix.settings.cores = 2; + nix.settings.max-jobs = 2; } (if lib.versionAtLeast (lib.versions.majorMinor lib.version) "21.11" then { nix.daemonCPUSchedPolicy = "batch"; @@ -61,6 +59,9 @@ in emulateWheel = true; }; + # Conflicts with TLP, but gets enabled by DEs. + services.power-profiles-daemon.enable = false; + services.tlp.enable = true; services.tlp.settings = { START_CHARGE_THRESH_BAT0 = 80; diff --git a/tv/2configs/imgur.nix b/tv/2configs/imgur.nix index ba84fd2..e221227 100644 --- a/tv/2configs/imgur.nix +++ b/tv/2configs/imgur.nix @@ -1,6 +1,5 @@ -with import <stockholm/lib>; +with import ./lib; { config, pkgs, ... }: { - services.nginx.virtualHosts."ni.r" = { locations."/image" = { extraConfig = /* nginx */ '' @@ -18,8 +17,6 @@ with import <stockholm/lib>; krebs.htgen.imgur = { port = 7771; - script = /* sh */ '' - (. ${pkgs.htgen-imgur}/bin/htgen-imgur) - ''; + scriptFile = "${pkgs.htgen-imgur}/bin/htgen-imgur"; }; } diff --git a/tv/2configs/lib b/tv/2configs/lib new file mode 120000 index 0000000..dc598c5 --- /dev/null +++ b/tv/2configs/lib @@ -0,0 +1 @@ +../lib
\ No newline at end of file diff --git a/tv/2configs/nginx/default.nix b/tv/2configs/nginx/default.nix index efea3a8..6844df9 100644 --- a/tv/2configs/nginx/default.nix +++ b/tv/2configs/nginx/default.nix @@ -1,8 +1,5 @@ -{ config, lib, ... }: - -with import <stockholm/lib>; - -{ +with import ./lib; +{ config, ... }: { services.nginx = { enableReload = true; diff --git a/tv/2configs/nginx/krebs-pages.nix b/tv/2configs/nginx/krebs-pages.nix deleted file mode 100644 index 4dd643d..0000000 --- a/tv/2configs/nginx/krebs-pages.nix +++ /dev/null @@ -1,13 +0,0 @@ -{ config, pkgs, ... }: -{ - services.nginx = { - virtualHosts.krebs-pages = { - serverAliases = [ - "krebs.${config.krebs.build.host.name}.r" - ]; - extraConfig = '' - root ${pkgs.krebs-pages}; - ''; - }; - }; -} diff --git a/tv/2configs/nginx/lib b/tv/2configs/nginx/lib new file mode 120000 index 0000000..dc598c5 --- /dev/null +++ b/tv/2configs/nginx/lib @@ -0,0 +1 @@ +../lib
\ No newline at end of file diff --git a/tv/2configs/nginx/public_html.nix b/tv/2configs/nginx/public_html.nix index 43d7189..c2403cd 100644 --- a/tv/2configs/nginx/public_html.nix +++ b/tv/2configs/nginx/public_html.nix @@ -1,8 +1,5 @@ -{ config, lib, ... }: - -with import <stockholm/lib>; - -{ +with import ./lib; +{ config, ... }: { services.nginx = { enable = true; virtualHosts.default = { diff --git a/tv/2configs/pki/default.nix b/tv/2configs/pki/default.nix index 51a5c71..415755b 100644 --- a/tv/2configs/pki/default.nix +++ b/tv/2configs/pki/default.nix @@ -1,4 +1,4 @@ -with import <stockholm/lib>; +with import ./lib; { config, pkgs, ... }: let certFile = config.environment.etc."ssl/certs/ca-certificates.crt".source; diff --git a/tv/2configs/pki/lib b/tv/2configs/pki/lib new file mode 120000 index 0000000..dc598c5 --- /dev/null +++ b/tv/2configs/pki/lib @@ -0,0 +1 @@ +../lib
\ No newline at end of file diff --git a/tv/2configs/ppp.nix b/tv/2configs/ppp.nix index c801401..24d2831 100644 --- a/tv/2configs/ppp.nix +++ b/tv/2configs/ppp.nix @@ -1,5 +1,5 @@ +with import ./lib; { config, pkgs, ... }: let - lib = import <stockholm/lib>; cfg = { pin = "@${toString <secrets/o2.pin>}"; ttys.ppp = "/dev/ttyACM0"; diff --git a/tv/2configs/pulse.nix b/tv/2configs/pulse.nix index 513a0eb..7a07e81 100644 --- a/tv/2configs/pulse.nix +++ b/tv/2configs/pulse.nix @@ -1,7 +1,5 @@ -{ config, lib, pkgs, ... }: - -with import <stockholm/lib>; -let +with import ./lib; +{ config, pkgs, ... }: let pkg = pkgs.pulseaudio; runDir = "/run/pulse"; diff --git a/tv/2configs/repo-sync/lib b/tv/2configs/repo-sync/lib new file mode 120000 index 0000000..dc598c5 --- /dev/null +++ b/tv/2configs/repo-sync/lib @@ -0,0 +1 @@ +../lib
\ No newline at end of file diff --git a/tv/2configs/repo-sync/wiki.nix b/tv/2configs/repo-sync/wiki.nix index 9134399..515e731 100644 --- a/tv/2configs/repo-sync/wiki.nix +++ b/tv/2configs/repo-sync/wiki.nix @@ -1,6 +1,5 @@ -{ config, pkgs, ... }: let - lib = import <stockholm/lib>; -in { +with import ./lib; +{ config, pkgs, ... }: { krebs.repo-sync.enable = true; krebs.repo-sync.repos.wiki.branches.hotdog = { origin.url = "http://cgit.hotdog.r/wiki"; diff --git a/tv/2configs/retiolum.nix b/tv/2configs/retiolum.nix index 3c3b2ad..de77de3 100644 --- a/tv/2configs/retiolum.nix +++ b/tv/2configs/retiolum.nix @@ -1,8 +1,5 @@ -{ config, lib, pkgs, ... }: - -with import <stockholm/lib>; - -{ +with import ./lib; +{ config, pkgs, ... }: { krebs.tinc.retiolum = { enable = true; connectTo = filter (ne config.krebs.build.host.name) [ diff --git a/tv/2configs/ssh.nix b/tv/2configs/ssh.nix index 84d2473..ad82881 100644 --- a/tv/2configs/ssh.nix +++ b/tv/2configs/ssh.nix @@ -1,8 +1,5 @@ -{ config, pkgs, ... }: - -with import <stockholm/lib>; - -{ +with import ./lib; +{ config, pkgs, ... }: { # Override NixOS's "Allow DSA keys for now." environment.etc."ssh/ssh_config".text = mkForce '' AddressFamily ${if config.networking.enableIPv6 then "any" else "inet"} diff --git a/tv/2configs/sshd.nix b/tv/2configs/sshd.nix index 79af5b0..4da8c82 100644 --- a/tv/2configs/sshd.nix +++ b/tv/2configs/sshd.nix @@ -1,4 +1,4 @@ -with import <stockholm/lib>; +with import ./lib; { config, ... }: let cfg.host = config.krebs.build.host; in { diff --git a/tv/2configs/urlwatch.nix b/tv/2configs/urlwatch.nix index 619b044..7ba364f 100644 --- a/tv/2configs/urlwatch.nix +++ b/tv/2configs/urlwatch.nix @@ -1,4 +1,4 @@ -with import <stockholm/lib>; +with import ./lib; { config, pkgs, ... }: let exec = filename: args: url: { inherit url; diff --git a/tv/2configs/vim.nix b/tv/2configs/vim.nix index fed74c9..b8819ee 100644 --- a/tv/2configs/vim.nix +++ b/tv/2configs/vim.nix @@ -1,7 +1,5 @@ -{ config, lib, pkgs, ... }: - -with import <stockholm/lib>; -let { +with import ./lib; +{ config, pkgs, ... }: let { body = { environment.systemPackages = [ vim-wrapper @@ -13,7 +11,7 @@ let { environment.variables.VIMINIT = ":so /etc/vimrc"; }; - extra-runtimepath = concatMapStringsSep "," (pkg: "${pkg.rtp}") [ + extra-runtimepath = pkgs.tv.vim.makeRuntimePath [ pkgs.tv.vimPlugins.elixir pkgs.tv.vimPlugins.file-line pkgs.tv.vimPlugins.fzf @@ -79,6 +77,7 @@ let { set showmatch set timeoutlen=0 set ttimeoutlen=0 + set ttymouse=sgr set undodir=${dirs.undodir} set undofile set undolevels=1000000 diff --git a/tv/2configs/xdg.nix b/tv/2configs/xdg.nix index 18bac9b..b7c14af 100644 --- a/tv/2configs/xdg.nix +++ b/tv/2configs/xdg.nix @@ -1,8 +1,5 @@ -{ config, lib, pkgs, ... }: - -with import <stockholm/lib>; - -{ +with import ./lib; +{ config, pkgs, ... }: { environment.variables.XDG_RUNTIME_DIR = "/run/xdg/$LOGNAME"; systemd.tmpfiles.rules = let diff --git a/tv/2configs/xp-332.nix b/tv/2configs/xp-332.nix index a97fb36..51fd1ae 100644 --- a/tv/2configs/xp-332.nix +++ b/tv/2configs/xp-332.nix @@ -1,4 +1,4 @@ -with import <stockholm/lib>; +with import ./lib; { config, pkgs, ... }: { environment.etc."utsushi.conf".text = '' diff --git a/tv/2configs/xserver/Xmodmap.nix b/tv/2configs/xserver/Xmodmap.nix index 8e8e3df..8e555e9 100644 --- a/tv/2configs/xserver/Xmodmap.nix +++ b/tv/2configs/xserver/Xmodmap.nix @@ -1,6 +1,6 @@ { config, pkgs, ... }: -with import <stockholm/lib>; +with import ./lib; pkgs.writeText "Xmodmap" '' !keycode 66 = Caps_Lock diff --git a/tv/2configs/xserver/default.nix b/tv/2configs/xserver/default.nix index 8bedb0e..f534b55 100644 --- a/tv/2configs/xserver/default.nix +++ b/tv/2configs/xserver/default.nix @@ -1,6 +1,5 @@ -{ config, pkgs, ... }@args: -with import <stockholm/lib>; -let +with import ./lib; +{ config, pkgs, ... }@args: let cfg = { cacheDir = cfg.dataDir; configDir = "/var/empty"; diff --git a/tv/2configs/xserver/lib b/tv/2configs/xserver/lib new file mode 120000 index 0000000..dc598c5 --- /dev/null +++ b/tv/2configs/xserver/lib @@ -0,0 +1 @@ +../lib
\ No newline at end of file diff --git a/tv/2configs/xserver/sxiv.nix b/tv/2configs/xserver/sxiv.nix index 10e450d..eb862f8 100644 --- a/tv/2configs/xserver/sxiv.nix +++ b/tv/2configs/xserver/sxiv.nix @@ -1,4 +1,4 @@ -with import <stockholm/lib>; +with import ./lib; { config, pkgs, ... }: let cfg.user = config.krebs.build.user; in { diff --git a/tv/2configs/xserver/urxvt.nix b/tv/2configs/xserver/urxvt.nix index 2d504e1..3502c63 100644 --- a/tv/2configs/xserver/urxvt.nix +++ b/tv/2configs/xserver/urxvt.nix @@ -1,4 +1,4 @@ -with import <stockholm/lib>; +with import ./lib; { config, pkgs, ... }: let cfg.user = config.krebs.build.user; in { diff --git a/tv/2configs/xserver/xserver.conf.nix b/tv/2configs/xserver/xserver.conf.nix index 99038e5..3fdfebf 100644 --- a/tv/2configs/xserver/xserver.conf.nix +++ b/tv/2configs/xserver/xserver.conf.nix @@ -1,6 +1,5 @@ -{ config, lib, pkgs, ... }: - -with import <stockholm/lib>; +with import ./lib; +{ config, pkgs, ... }: let cfg = config.services.xserver; |