Skip to content

Commit 3a67e6d

Browse files
authored
paretosecurity: 0.1.9 -> 0.2.12 (#401384)
2 parents 96a57ba + f072058 commit 3a67e6d

File tree

3 files changed

+36
-12
lines changed

3 files changed

+36
-12
lines changed

nixos/modules/services/security/paretosecurity.nix

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@ in
1212
options.services.paretosecurity = {
1313
enable = lib.mkEnableOption "[ParetoSecurity](https://paretosecurity.com) [agent](https://github.com/ParetoSecurity/agent) and its root helper";
1414
package = lib.mkPackageOption pkgs "paretosecurity" { };
15-
trayIcon = lib.mkEnableOption "tray icon for ParetoSecurity";
15+
trayIcon = lib.mkOption {
16+
type = lib.types.bool;
17+
default = true;
18+
description = "Set to false to disable the tray icon and run as a CLI tool only.";
19+
};
1620
};
1721

1822
config = lib.mkIf cfg.enable {

nixos/tests/paretosecurity.nix

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,7 @@
4646
{
4747
imports = [ ./common/user-account.nix ];
4848

49-
services.paretosecurity = {
50-
enable = true;
51-
trayIcon = true;
52-
};
49+
services.paretosecurity.enable = true;
5350

5451
services.xserver.enable = true;
5552
services.xserver.displayManager.lightdm.enable = true;
@@ -119,5 +116,16 @@
119116
xfce.wait_for_text("Pareto Security")
120117
xfce.succeed("xdotool click 1")
121118
xfce.wait_for_text("Run Checks")
119+
120+
# Test 5: paretosecurity:// URL handler is registered
121+
xfce.succeed("su - alice -c 'xdg-open paretosecurity://foo'")
122+
123+
# Test 6: Desktop entry
124+
xfce.succeed("xdotool mousemove 10 10")
125+
xfce.succeed("xdotool click 1") # hide the tray icon window
126+
xfce.succeed("xdotool click 1") # show the Applications menu
127+
xfce.succeed("xdotool mousemove 10 200")
128+
xfce.succeed("xdotool click 1")
129+
xfce.wait_for_text("Pareto Security")
122130
'';
123131
}

pkgs/by-name/pa/paretosecurity/package.nix

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,16 @@ buildGoModule (finalAttrs: {
1717
webkitgtk_4_1
1818
];
1919
pname = "paretosecurity";
20-
version = "0.1.9";
20+
version = "0.2.12";
2121

2222
src = fetchFromGitHub {
2323
owner = "ParetoSecurity";
2424
repo = "agent";
2525
rev = finalAttrs.version;
26-
hash = "sha256-KJs4xC3EtGG4116UE+oIEwAMcuDWIm9gqgZY+Bv14ac=";
26+
hash = "sha256-skBxDPC+C8JU1CW6g3SA2C4IawaoPzVi8pdl5BCutUY=";
2727
};
2828

29-
vendorHash = "sha256-3plpvwLe32AsGuVzdM2fSmTPkKwRFmhi651NEIRdOxw=";
29+
vendorHash = "sha256-YnyACP/hJYxi4AWMwr0We4YUTbWwahKAIYN6RnHmzls=";
3030
proxyVendor = true;
3131

3232
ldflags = [
@@ -51,6 +51,17 @@ buildGoModule (finalAttrs: {
5151
install -Dm444 ${finalAttrs.src}/apt/paretosecurity-trayicon.service $out/lib/systemd/user/paretosecurity-trayicon.service
5252
substituteInPlace $out/lib/systemd/user/paretosecurity-trayicon.service \
5353
--replace-fail "/usr/bin/paretosecurity" "$out/bin/paretosecurity"
54+
55+
# Install .desktop files
56+
install -Dm444 ${finalAttrs.src}/apt/ParetoSecurity.desktop $out/share/applications/ParetoSecurity.desktop
57+
substituteInPlace $out/share/applications/ParetoSecurity.desktop \
58+
--replace-fail "/usr/bin/paretosecurity" "$out/bin/paretosecurity"
59+
install -Dm444 ${finalAttrs.src}/apt/ParetoSecurityLink.desktop $out/share/applications/ParetoSecurityLink.desktop
60+
substituteInPlace $out/share/applications/ParetoSecurityLink.desktop \
61+
--replace-fail "/usr/bin/paretosecurity" "$out/bin/paretosecurity"
62+
63+
# Install icon
64+
install -Dm444 ${finalAttrs.src}/assets/icon.png $out/share/icons/hicolor/512x512/apps/ParetoSecurity.png
5465
'';
5566

5667
passthru.tests = {
@@ -74,10 +85,11 @@ buildGoModule (finalAttrs: {
7485
root helper that allows you to run the checker in userspace. Some checks
7586
require root permissions, and the checker asks the helper to run those.
7687
77-
Additionally, if you enable `services.paretosecurity.trayIcon`, you get a
78-
little Vilfredo Pareto living in your systray showing your the current
79-
status of checks. This will also enable a systemd timer to update the
80-
status of checks once per hour.
88+
Additionally, using the NixOS module gets you a little Vilfredo Pareto
89+
living in your systray showing your the current status of checks. The
90+
NixOS Module also installs a systemd timer to update the status of checks
91+
once per hour. If you want to use just the CLI mode, set
92+
`services.paretosecurity.trayIcon` to `false`.
8193
8294
Finally, you can run `paretosecurity link` to configure the agent
8395
to send the status of checks to https://dash.paretosecurity.com to make

0 commit comments

Comments
 (0)