lol
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

nixos/glances: init module

+176
+2
nixos/doc/manual/release-notes/rl-2411.section.md
··· 197 197 198 198 - [Zapret](https://github.com/bol-van/zapret), a DPI bypass tool. Available as [services.zapret](option.html#opt-services.zapret.enable). 199 199 200 + - [Glances](https://github.com/nicolargo/glances), an open-source system cross-platform monitoring tool. Available as [services.glances](option.html#opt-services.glances). 201 + 200 202 ## Backward Incompatibilities {#sec-release-24.11-incompatibilities} 201 203 202 204 - Nixpkgs now requires Nix 2.3.17 or newer to allow for zstd compressed binary artifacts.
+1
nixos/modules/module-list.nix
··· 888 888 ./services/monitoring/do-agent.nix 889 889 ./services/monitoring/fusion-inventory.nix 890 890 ./services/monitoring/gatus.nix 891 + ./services/monitoring/glances.nix 891 892 ./services/monitoring/goss.nix 892 893 ./services/monitoring/grafana-agent.nix 893 894 ./services/monitoring/grafana-image-renderer.nix
+20
nixos/modules/services/monitoring/glances.md
··· 1 + # Glances {#module-serives-glances} 2 + 3 + Glances an Eye on your system. A top/htop alternative for GNU/Linux, BSD, Mac OS 4 + and Windows operating systems. 5 + 6 + Visit [the Glances project page](https://github.com/nicolargo/glances) to learn 7 + more about it. 8 + 9 + # Quickstart {#module-serives-glances-quickstart} 10 + 11 + Use the following configuration to start a public instance of Glances locally: 12 + 13 + ```nix 14 + { 15 + services.glances = { 16 + enable = true; 17 + openFirewall = true; 18 + }; 19 + }; 20 + ```
+110
nixos/modules/services/monitoring/glances.nix
··· 1 + { 2 + pkgs, 3 + config, 4 + lib, 5 + utils, 6 + ... 7 + }: 8 + let 9 + cfg = config.services.glances; 10 + 11 + inherit (lib) 12 + getExe 13 + maintainers 14 + mkEnableOption 15 + mkOption 16 + mkIf 17 + mkPackageOption 18 + ; 19 + 20 + inherit (lib.types) 21 + bool 22 + listOf 23 + port 24 + str 25 + ; 26 + 27 + inherit (utils) 28 + escapeSystemdExecArgs 29 + ; 30 + 31 + in 32 + { 33 + options.services.glances = { 34 + enable = mkEnableOption "Glances"; 35 + 36 + package = mkPackageOption pkgs "glances" { }; 37 + 38 + port = mkOption { 39 + description = "Port the server will isten on."; 40 + type = port; 41 + default = 61208; 42 + }; 43 + 44 + openFirewall = mkOption { 45 + description = "Open port in the firewall for glances."; 46 + type = bool; 47 + default = false; 48 + }; 49 + 50 + extraArgs = mkOption { 51 + type = listOf str; 52 + default = [ "--webserver" ]; 53 + example = [ 54 + "--webserver" 55 + "--disable-webui" 56 + ]; 57 + description = '' 58 + Extra command-line arguments to pass to glances. 59 + 60 + See https://glances.readthedocs.io/en/latest/cmds.html for all available options. 61 + ''; 62 + }; 63 + }; 64 + 65 + config = mkIf cfg.enable { 66 + 67 + environment.systemPackages = [ cfg.package ]; 68 + 69 + systemd.services."glances" = { 70 + description = "Glances"; 71 + after = [ "network.target" ]; 72 + wantedBy = [ "multi-user.target" ]; 73 + 74 + serviceConfig = { 75 + Type = "simple"; 76 + DynamicUser = true; 77 + ExecStart = "${getExe cfg.package} --port ${toString cfg.port} ${escapeSystemdExecArgs cfg.extraArgs}"; 78 + Restart = "on-failure"; 79 + 80 + NoNewPrivileges = true; 81 + ProtectSystem = "full"; 82 + ProtectHome = true; 83 + PrivateTmp = true; 84 + PrivateDevices = true; 85 + ProtectKernelTunables = true; 86 + ProtectKernelModules = true; 87 + ProtectKernelLogs = true; 88 + ProtectControlGroups = true; 89 + MemoryDenyWriteExecute = true; 90 + RestrictAddressFamilies = [ 91 + "AF_INET" 92 + "AF_INET6" 93 + "AF_NETLINK" 94 + "AF_UNIX" 95 + ]; 96 + LockPersonality = true; 97 + RestrictRealtime = true; 98 + ProtectClock = true; 99 + ReadWritePaths = [ "/var/log" ]; 100 + CapabilityBoundingSet = [ "CAP_NET_BIND_SERVICE" ]; 101 + AmbientCapabilities = [ "CAP_NET_BIND_SERVICE" ]; 102 + SystemCallFilter = [ "@system-service" ]; 103 + }; 104 + }; 105 + 106 + networking.firewall.allowedTCPPorts = mkIf cfg.openFirewall [ cfg.port ]; 107 + }; 108 + 109 + meta.maintainers = with maintainers; [ claha ]; 110 + }
+1
nixos/tests/all-tests.nix
··· 383 383 gitolite = handleTest ./gitolite.nix {}; 384 384 gitolite-fcgiwrap = handleTest ./gitolite-fcgiwrap.nix {}; 385 385 glance = runTest ./glance.nix; 386 + glances = runTest ./glances.nix; 386 387 glusterfs = handleTest ./glusterfs.nix {}; 387 388 gnome = handleTest ./gnome.nix {}; 388 389 gnome-extensions = handleTest ./gnome-extensions.nix {};
+36
nixos/tests/glances.nix
··· 1 + { lib, ... }: 2 + 3 + { 4 + name = "glances"; 5 + 6 + nodes = { 7 + machine_default = 8 + { pkgs, ... }: 9 + { 10 + services.glances = { 11 + enable = true; 12 + }; 13 + }; 14 + 15 + machine_custom_port = 16 + { pkgs, ... }: 17 + { 18 + services.glances = { 19 + enable = true; 20 + port = 5678; 21 + }; 22 + }; 23 + }; 24 + 25 + testScript = '' 26 + machine_default.start() 27 + machine_default.wait_for_unit("glances.service") 28 + machine_default.wait_for_open_port(61208) 29 + 30 + machine_custom_port.start() 31 + machine_custom_port.wait_for_unit("glances.service") 32 + machine_custom_port.wait_for_open_port(5678) 33 + ''; 34 + 35 + meta.maintainers = [ lib.maintainers.claha ]; 36 + }
+6
pkgs/applications/system/glances/default.nix
··· 8 8 packaging, 9 9 psutil, 10 10 setuptools, 11 + pydantic, 12 + nixosTests, 11 13 # Optional dependencies: 12 14 fastapi, 13 15 jinja2, ··· 68 70 jinja2 69 71 prometheus-client 70 72 ] ++ lib.optional stdenv.hostPlatform.isLinux hddtemp; 73 + 74 + passthru.tests = { 75 + service = nixosTests.glances; 76 + }; 71 77 72 78 meta = { 73 79 homepage = "https://nicolargo.github.io/glances/";