pub-solar-os/modules/core/networking.nix
Benjamin Bädorf 043178172b
Improve help and screen recording keybindings in sway
This commit shuffles around some sway keybindings and improves the
screen recording experience by adding a small wrapper around `slurp` and
`wf-recorder` conveniently called `record-screen`.

* `$mod+F5` now reload the sway configuration,
* `$mod+Ctrl+r` starts a screen recording (to stop it, go to workspace 7
  and kill the process),
* `record-screen` and the firefox sharing indicator are both on
  workspace 7 now, making it the "trash" workspace,
* `$mod+F1` and `$mod+Shift+h` now open Firefox with the docs of our
repository availabe under `help.local`.
* To not infuriate `qMasterPassword` users, that is now available under
`$mod+Shift+m` instead of `$mod+F1`.
2022-08-14 18:03:32 +02:00

61 lines
1.5 KiB
Nix

{ config, pkgs, lib, ... }:
with lib;
let cfg = config.pub-solar.core;
in
{
options.pub-solar.core = {
binaryCaches = mkOption {
type = types.listOf types.str;
default = [ ];
description = "Binary caches to use.";
};
publicKeys = mkOption {
type = types.listOf types.str;
default = [ ];
description = "Public keys of binary caches.";
};
iwdConfig = mkOption {
type = with types; nullOr (attrsOf (attrsOf (oneOf [ bool int str ])));
default = null;
description = "Configuratoin of iNet Wireless Daemon.";
};
};
config = {
networking.networkmanager = {
# Enable networkmanager. REMEMBER to add yourself to group in order to use nm related stuff.
enable = true;
};
# Customized binary caches list (with fallback to official binary cache)
nix.binaryCaches = cfg.binaryCaches;
nix.binaryCachePublicKeys = cfg.publicKeys;
# These entries get added to /etc/hosts
networking.hosts = {
"127.0.0.1" = [ "cups.local" "help.local" "caddy.local" ];
};
# Caddy reverse proxy for local services like cups
services.caddy = {
enable = true;
globalConfig = ''
default_bind 127.0.0.1
auto_https off
'';
extraConfig = ''
cups.local:80 {
request_header Host localhost:631
reverse_proxy unix//run/cups/cups.sock
}
help.local:80 {
root * ${pkgs.psos-docs}/lib/html
file_server
}
'';
};
};
}