Merge branch 'main' into teutat3s

This commit is contained in:
teutat3s 2022-10-02 04:09:22 +02:00
commit 9457435388
Signed by: teutat3s
GPG key ID: 4FA1D3FA524F22C1
3 changed files with 37 additions and 22 deletions

View file

@ -19,7 +19,7 @@ in
config = { config = {
boot = { boot = {
# Enable plymouth for better experience of booting # Enable plymouth for better experience of booting
plymouth.enable = true; plymouth.enable = mkIf (!cfg.lite) (lib.mkDefault true);
# Mount / luks device in initrd # Mount / luks device in initrd
# Allow fstrim to work on it. # Allow fstrim to work on it.

View file

@ -29,12 +29,12 @@ in
config = { config = {
pub-solar = { pub-solar = {
audio.enable = lib.mkIf (!cfg.lite) true; audio.enable = lib.mkIf (!cfg.lite) (lib.mkDefault true);
crypto.enable = lib.mkIf (!cfg.lite) true; crypto.enable = lib.mkIf (!cfg.lite) (lib.mkDefault true);
devops.enable = lib.mkIf (!cfg.lite) true; devops.enable = lib.mkIf (!cfg.lite) (lib.mkDefault true);
terminal-life = { terminal-life = {
enable = true; enable = lib.mkDefault true;
lite = cfg.lite; lite = cfg.lite;
}; };
}; };

View file

@ -6,6 +6,15 @@ let cfg = config.pub-solar.core;
in in
{ {
options.pub-solar.core = { options.pub-solar.core = {
enableCaddy = mkOption {
type = types.bool;
default = !cfg.lite;
};
enableHelp = mkOption {
type = types.bool;
default = !cfg.lite;
};
binaryCaches = mkOption { binaryCaches = mkOption {
type = types.listOf types.str; type = types.listOf types.str;
default = [ ]; default = [ ];
@ -16,11 +25,6 @@ in
default = [ ]; default = [ ];
description = "Public keys of binary caches."; 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 = { config = {
# disable NetworkManager-wait-online by default # disable NetworkManager-wait-online by default
@ -38,27 +42,38 @@ in
# These entries get added to /etc/hosts # These entries get added to /etc/hosts
networking.hosts = { networking.hosts = {
"127.0.0.1" = [ "cups.local" "help.local" "caddy.local" ]; "127.0.0.1" = [ ]
++ lib.optionals cfg.enableCaddy [ "caddy.local" ]
++ lib.optionals config.pub-solar.printing.enable [ "cups.local" ]
++ lib.optionals cfg.enableHelp [ "help.local" ];
}; };
# Caddy reverse proxy for local services like cups # Caddy reverse proxy for local services like cups
services.caddy = { services.caddy = {
enable = true; enable = cfg.enableCaddy;
globalConfig = '' globalConfig = ''
default_bind 127.0.0.1 default_bind 127.0.0.1
auto_https off auto_https off
''; '';
extraConfig = '' extraConfig = concatStringsSep "\n" [
cups.local:80 { (lib.optionalString
request_header Host localhost:631 config.pub-solar.printing.enable
reverse_proxy unix//run/cups/cups.sock ''
} cups.local:80 {
request_header Host localhost:631
reverse_proxy unix//run/cups/cups.sock
}
'')
help.local:80 { (lib.optionalString
root * ${pkgs.psos-docs}/lib/html cfg.enableHelp
file_server ''
} help.local:80 {
''; root * ${pkgs.psos-docs}/lib/html
file_server
}
'')
];
}; };
}; };
} }