paretosecurity: 0.1.9 -> 0.2.12

Also:
* enable tray icon by default when nixos module is enabled
* install desktop entry
* install paretosecurity:// URL handler
* install app icon

Changed files
+36 -12
nixos
modules
services
tests
pkgs
by-name
pa
paretosecurity
+5 -1
nixos/modules/services/security/paretosecurity.nix
···
options.services.paretosecurity = {
enable = lib.mkEnableOption "[ParetoSecurity](https://paretosecurity.com) [agent](https://github.com/ParetoSecurity/agent) and its root helper";
package = lib.mkPackageOption pkgs "paretosecurity" { };
-
trayIcon = lib.mkEnableOption "tray icon for ParetoSecurity";
};
config = lib.mkIf cfg.enable {
···
options.services.paretosecurity = {
enable = lib.mkEnableOption "[ParetoSecurity](https://paretosecurity.com) [agent](https://github.com/ParetoSecurity/agent) and its root helper";
package = lib.mkPackageOption pkgs "paretosecurity" { };
+
trayIcon = lib.mkOption {
+
type = lib.types.bool;
+
default = true;
+
description = "Set to false to disable the tray icon and run as a CLI tool only.";
+
};
};
config = lib.mkIf cfg.enable {
+12 -4
nixos/tests/paretosecurity.nix
···
{
imports = [ ./common/user-account.nix ];
-
services.paretosecurity = {
-
enable = true;
-
trayIcon = true;
-
};
services.xserver.enable = true;
services.xserver.displayManager.lightdm.enable = true;
···
xfce.wait_for_text("Pareto Security")
xfce.succeed("xdotool click 1")
xfce.wait_for_text("Run Checks")
'';
}
···
{
imports = [ ./common/user-account.nix ];
+
services.paretosecurity.enable = true;
services.xserver.enable = true;
services.xserver.displayManager.lightdm.enable = true;
···
xfce.wait_for_text("Pareto Security")
xfce.succeed("xdotool click 1")
xfce.wait_for_text("Run Checks")
+
+
# Test 5: paretosecurity:// URL handler is registered
+
xfce.succeed("su - alice -c 'xdg-open paretosecurity://foo'")
+
+
# Test 6: Desktop entry
+
xfce.succeed("xdotool mousemove 10 10")
+
xfce.succeed("xdotool click 1") # hide the tray icon window
+
xfce.succeed("xdotool click 1") # show the Applications menu
+
xfce.succeed("xdotool mousemove 10 200")
+
xfce.succeed("xdotool click 1")
+
xfce.wait_for_text("Pareto Security")
'';
}
+19 -7
pkgs/by-name/pa/paretosecurity/package.nix
···
webkitgtk_4_1
];
pname = "paretosecurity";
-
version = "0.1.9";
src = fetchFromGitHub {
owner = "ParetoSecurity";
repo = "agent";
rev = finalAttrs.version;
-
hash = "sha256-KJs4xC3EtGG4116UE+oIEwAMcuDWIm9gqgZY+Bv14ac=";
};
-
vendorHash = "sha256-3plpvwLe32AsGuVzdM2fSmTPkKwRFmhi651NEIRdOxw=";
proxyVendor = true;
ldflags = [
···
install -Dm444 ${finalAttrs.src}/apt/paretosecurity-trayicon.service $out/lib/systemd/user/paretosecurity-trayicon.service
substituteInPlace $out/lib/systemd/user/paretosecurity-trayicon.service \
--replace-fail "/usr/bin/paretosecurity" "$out/bin/paretosecurity"
'';
passthru.tests = {
···
root helper that allows you to run the checker in userspace. Some checks
require root permissions, and the checker asks the helper to run those.
-
Additionally, if you enable `services.paretosecurity.trayIcon`, you get a
-
little Vilfredo Pareto living in your systray showing your the current
-
status of checks. This will also enable a systemd timer to update the
-
status of checks once per hour.
Finally, you can run `paretosecurity link` to configure the agent
to send the status of checks to https://dash.paretosecurity.com to make
···
webkitgtk_4_1
];
pname = "paretosecurity";
+
version = "0.2.12";
src = fetchFromGitHub {
owner = "ParetoSecurity";
repo = "agent";
rev = finalAttrs.version;
+
hash = "sha256-skBxDPC+C8JU1CW6g3SA2C4IawaoPzVi8pdl5BCutUY=";
};
+
vendorHash = "sha256-YnyACP/hJYxi4AWMwr0We4YUTbWwahKAIYN6RnHmzls=";
proxyVendor = true;
ldflags = [
···
install -Dm444 ${finalAttrs.src}/apt/paretosecurity-trayicon.service $out/lib/systemd/user/paretosecurity-trayicon.service
substituteInPlace $out/lib/systemd/user/paretosecurity-trayicon.service \
--replace-fail "/usr/bin/paretosecurity" "$out/bin/paretosecurity"
+
+
# Install .desktop files
+
install -Dm444 ${finalAttrs.src}/apt/ParetoSecurity.desktop $out/share/applications/ParetoSecurity.desktop
+
substituteInPlace $out/share/applications/ParetoSecurity.desktop \
+
--replace-fail "/usr/bin/paretosecurity" "$out/bin/paretosecurity"
+
install -Dm444 ${finalAttrs.src}/apt/ParetoSecurityLink.desktop $out/share/applications/ParetoSecurityLink.desktop
+
substituteInPlace $out/share/applications/ParetoSecurityLink.desktop \
+
--replace-fail "/usr/bin/paretosecurity" "$out/bin/paretosecurity"
+
+
# Install icon
+
install -Dm444 ${finalAttrs.src}/assets/icon.png $out/share/icons/hicolor/512x512/apps/ParetoSecurity.png
'';
passthru.tests = {
···
root helper that allows you to run the checker in userspace. Some checks
require root permissions, and the checker asks the helper to run those.
+
Additionally, using the NixOS module gets you a little Vilfredo Pareto
+
living in your systray showing your the current status of checks. The
+
NixOS Module also installs a systemd timer to update the status of checks
+
once per hour. If you want to use just the CLI mode, set
+
`services.paretosecurity.trayIcon` to `false`.
Finally, you can run `paretosecurity link` to configure the agent
to send the status of checks to https://dash.paretosecurity.com to make