diff options
author | github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> | 2021-11-02 00:01:32 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-02 00:01:32 +0000 |
commit | d27dd6653ef32f35d50db3f249ac4658ba18a5b1 (patch) | |
tree | e968f483c0f81f6f6d973ec3e47bb4258a6ac0a6 /nixos/modules | |
parent | 107b7f5d3931d42c68fe1f51bb62d3d98cf208bf (diff) | |
parent | 550dab224a26ec25e20e82c0c8bfc764e01b772e (diff) | |
download | nixpkgs-d27dd6653ef32f35d50db3f249ac4658ba18a5b1.tar nixpkgs-d27dd6653ef32f35d50db3f249ac4658ba18a5b1.tar.gz nixpkgs-d27dd6653ef32f35d50db3f249ac4658ba18a5b1.tar.bz2 nixpkgs-d27dd6653ef32f35d50db3f249ac4658ba18a5b1.tar.lz nixpkgs-d27dd6653ef32f35d50db3f249ac4658ba18a5b1.tar.xz nixpkgs-d27dd6653ef32f35d50db3f249ac4658ba18a5b1.tar.zst nixpkgs-d27dd6653ef32f35d50db3f249ac4658ba18a5b1.zip |
Merge master into staging-next
Diffstat (limited to 'nixos/modules')
-rw-r--r-- | nixos/modules/programs/neovim.nix | 2 | ||||
-rw-r--r-- | nixos/modules/services/networking/smokeping.nix | 48 | ||||
-rw-r--r-- | nixos/modules/services/x11/desktop-managers/plasma5.nix | 114 |
3 files changed, 90 insertions, 74 deletions
diff --git a/nixos/modules/programs/neovim.nix b/nixos/modules/programs/neovim.nix index 97b77ae98fe..26d75caeb8d 100644 --- a/nixos/modules/programs/neovim.nix +++ b/nixos/modules/programs/neovim.nix @@ -139,7 +139,7 @@ in { environment.systemPackages = [ cfg.finalPackage ]; - environment.variables = { EDITOR = mkOverride 900 "nvim"; }; + environment.variables.EDITOR = mkIf cfg.defaultEditor (mkOverride 900 "nvim"); programs.neovim.finalPackage = pkgs.wrapNeovim cfg.package { inherit (cfg) viAlias vimAlias; diff --git a/nixos/modules/services/networking/smokeping.nix b/nixos/modules/services/networking/smokeping.nix index 021368488a3..c075cbbceac 100644 --- a/nixos/modules/services/networking/smokeping.nix +++ b/nixos/modules/services/networking/smokeping.nix @@ -131,10 +131,15 @@ in }; imgUrl = mkOption { type = types.str; - default = "http://${cfg.hostName}:${toString cfg.port}/cache"; - defaultText = literalExpression ''"http://''${hostName}:''${toString port}/cache"''; + default = "cache"; + defaultText = literalExpression ''"cache"''; example = "https://somewhere.example.com/cache"; - description = "Base url for images generated in the cgi."; + description = '' + Base url for images generated in the cgi. + + The default is a relative URL to ensure it works also when e.g. forwarding + the GUI port via SSH. + ''; }; linkStyle = mkOption { type = types.enum ["original" "absolute" "relative"]; @@ -167,6 +172,17 @@ in defaultText = literalExpression "pkgs.smokeping"; description = "Specify a custom smokeping package"; }; + host = mkOption { + type = types.nullOr types.str; + default = "localhost"; + example = "192.0.2.1"; # rfc5737 example IP for documentation + description = '' + Host/IP to bind to for the web server. + + Setting it to <literal>null</literal> skips passing the -h option to thttpd, + which makes it bind to all interfaces. + ''; + }; port = mkOption { type = types.int; default = 8081; @@ -297,10 +313,11 @@ in }; users.groups.${cfg.user} = {}; systemd.services.smokeping = { - wantedBy = [ "multi-user.target"]; + requiredBy = [ "multi-user.target"]; serviceConfig = { User = cfg.user; Restart = "on-failure"; + ExecStart = "${cfg.package}/bin/smokeping --config=${configPath} --nodaemon"; }; preStart = '' mkdir -m 0755 -p ${smokepingHome}/cache ${smokepingHome}/data @@ -311,18 +328,29 @@ in ${cfg.package}/bin/smokeping --check --config=${configPath} ${cfg.package}/bin/smokeping --static --config=${configPath} ''; - script = "${cfg.package}/bin/smokeping --config=${configPath} --nodaemon"; }; systemd.services.thttpd = mkIf cfg.webService { - wantedBy = [ "multi-user.target"]; + requiredBy = [ "multi-user.target"]; requires = [ "smokeping.service"]; - partOf = [ "smokeping.service"]; path = with pkgs; [ bash rrdtool smokeping thttpd ]; - script = ''thttpd -u ${cfg.user} -c "**.fcgi" -d ${smokepingHome} -p ${builtins.toString cfg.port} -D -nos''; - serviceConfig.Restart = "always"; + serviceConfig = { + Restart = "always"; + ExecStart = lib.concatStringsSep " " (lib.concatLists [ + [ "${pkgs.thttpd}/bin/thttpd" ] + [ "-u ${cfg.user}" ] + [ ''-c "**.fcgi"'' ] + [ "-d ${smokepingHome}" ] + (lib.optional (cfg.host != null) "-h ${cfg.host}") + [ "-p ${builtins.toString cfg.port}" ] + [ "-D -nos" ] + ]); + }; }; }; - meta.maintainers = with lib.maintainers; [ erictapen ]; + meta.maintainers = with lib.maintainers; [ + erictapen + nh2 + ]; } diff --git a/nixos/modules/services/x11/desktop-managers/plasma5.nix b/nixos/modules/services/x11/desktop-managers/plasma5.nix index e8a62ea7576..52b641e23bd 100644 --- a/nixos/modules/services/x11/desktop-managers/plasma5.nix +++ b/nixos/modules/services/x11/desktop-managers/plasma5.nix @@ -14,10 +14,6 @@ let ini = pkgs.formats.ini { }; - pulseaudio = config.hardware.pulseaudio; - pactl = "${getBin pulseaudio.package}/bin/pactl"; - sed = "${getBin pkgs.gnused}/bin/sed"; - gtkrc2 = writeText "gtkrc-2.0" '' # Default GTK+ 2 config for NixOS Plasma 5 include "/run/current-system/sw/share/themes/Breeze/gtk-2.0/gtkrc" @@ -80,7 +76,7 @@ let # Qt from doing this wackiness in the first place. trolltech_conf="''${XDG_CONFIG_HOME}/Trolltech.conf" if [ -e "$trolltech_conf" ]; then - ${sed} -i "$trolltech_conf" -e '/nix\\store\|nix\/store/ d' + ${getBin pkgs.gnused}/bin/sed -i "$trolltech_conf" -e '/nix\\store\|nix\/store/ d' fi # Remove the kbuildsyscoca5 cache. It will be regenerated @@ -101,43 +97,36 @@ let XDG_CONFIG_HOME=''${XDG_CONFIG_HOME:-$HOME/.config} ''; - startplasma = - '' - ${set_XDG_CONFIG_HOME} - mkdir -p "''${XDG_CONFIG_HOME}" - - '' - + optionalString pulseaudio.enable '' - # Load PulseAudio module for routing support. - # See also: http://colin.guthr.ie/2009/10/so-how-does-the-kde-pulseaudio-support-work-anyway/ - ${pactl} load-module module-device-manager "do_routing=1" - - '' - + '' - ${activationScript} - - # Create default configurations if Plasma has never been started. - kdeglobals="''${XDG_CONFIG_HOME}/kdeglobals" - if ! [ -f "$kdeglobals" ] - then - kcminputrc="''${XDG_CONFIG_HOME}/kcminputrc" - if ! [ -f "$kcminputrc" ]; then - cat ${kcminputrc} >"$kcminputrc" - fi - - gtkrc2="$HOME/.gtkrc-2.0" - if ! [ -f "$gtkrc2" ]; then - cat ${gtkrc2} >"$gtkrc2" - fi - - gtk3_settings="''${XDG_CONFIG_HOME}/gtk-3.0/settings.ini" - if ! [ -f "$gtk3_settings" ]; then - mkdir -p "$(dirname "$gtk3_settings")" - cat ${gtk3_settings} >"$gtk3_settings" - fi + startplasma = '' + ${set_XDG_CONFIG_HOME} + mkdir -p "''${XDG_CONFIG_HOME}" + '' + optionalString config.hardware.pulseaudio.enable '' + # Load PulseAudio module for routing support. + # See also: http://colin.guthr.ie/2009/10/so-how-does-the-kde-pulseaudio-support-work-anyway/ + ${getBin config.hardware.pulseaudio.package}/bin/pactl load-module module-device-manager "do_routing=1" + '' + '' + ${activationScript} + + # Create default configurations if Plasma has never been started. + kdeglobals="''${XDG_CONFIG_HOME}/kdeglobals" + if ! [ -f "$kdeglobals" ]; then + kcminputrc="''${XDG_CONFIG_HOME}/kcminputrc" + if ! [ -f "$kcminputrc" ]; then + cat ${kcminputrc} >"$kcminputrc" fi - ''; + gtkrc2="$HOME/.gtkrc-2.0" + if ! [ -f "$gtkrc2" ]; then + cat ${gtkrc2} >"$gtkrc2" + fi + + gtk3_settings="''${XDG_CONFIG_HOME}/gtk-3.0/settings.ini" + if ! [ -f "$gtk3_settings" ]; then + mkdir -p "$(dirname "$gtk3_settings")" + cat ${gtk3_settings} >"$gtk3_settings" + fi + fi + ''; in @@ -202,27 +191,24 @@ in services.xserver.displayManager.sessionPackages = [ pkgs.libsForQt5.plasma5.plasma-workspace ]; security.wrappers = { - kcheckpass = - { - setuid = true; - owner = "root"; - group = "root"; - source = "${getBin libsForQt5.kscreenlocker}/libexec/kcheckpass"; - }; - start_kdeinit = - { - setuid = true; - owner = "root"; - group = "root"; - source = "${getBin libsForQt5.kinit}/libexec/kf5/start_kdeinit"; - }; - kwin_wayland = - { - owner = "root"; - group = "root"; - capabilities = "cap_sys_nice+ep"; - source = "${getBin plasma5.kwin}/bin/kwin_wayland"; - }; + kcheckpass = { + setuid = true; + owner = "root"; + group = "root"; + source = "${getBin libsForQt5.kscreenlocker}/libexec/kcheckpass"; + }; + start_kdeinit = { + setuid = true; + owner = "root"; + group = "root"; + source = "${getBin libsForQt5.kinit}/libexec/kf5/start_kdeinit"; + }; + kwin_wayland = { + owner = "root"; + group = "root"; + capabilities = "cap_sys_nice+ep"; + source = "${getBin plasma5.kwin}/bin/kwin_wayland"; + }; }; # DDC support @@ -372,9 +358,12 @@ in programs.ssh.askPassword = mkDefault "${plasma5.ksshaskpass.out}/bin/ksshaskpass"; # Enable helpful DBus services. + services.accounts-daemon.enable = true; + # when changing an account picture the accounts-daemon reads a temporary file containing the image which systemsettings5 may place under /tmp + systemd.services.accounts-daemon.serviceConfig.PrivateTmp = false; services.udisks2.enable = true; services.upower.enable = config.powerManagement.enable; - services.system-config-printer.enable = (mkIf config.services.printing.enable (mkDefault true)); + services.system-config-printer.enable = mkIf config.services.printing.enable (mkDefault true); services.xserver.libinput.enable = mkDefault true; # Extra UDEV rules used by Solid @@ -427,5 +416,4 @@ in nixpkgs.config.firefox.enablePlasmaBrowserIntegration = true; }) ]; - } |