aboutsummaryrefslogtreecommitdiffstats
path: root/modules/security/enteauth
diff options
context:
space:
mode:
authorArpit Chakladar <arpitchakladar+git@gmail.com>2026-07-15 20:02:29 +0530
committerArpit Chakladar <arpitchakladar+git@gmail.com>2026-07-15 20:03:04 +0530
commit01aaa7ad39c1fe8af6ffbca31abbab27dbfefc95 (patch)
tree88560b79fa71e3b83d9d9aca6d1bb40673a1a170 /modules/security/enteauth
parent2c573bb0c437b83fe629a9a5b818c976d2dfd796 (diff)
downloadhome-manager-config-01aaa7ad39c1fe8af6ffbca31abbab27dbfefc95.tar.gz
home-manager-config-01aaa7ad39c1fe8af6ffbca31abbab27dbfefc95.zip
refactor: organized the modules into better categories
Instead of lumping everything in modules/programs we are separating them into separate directories in modules/
Diffstat (limited to 'modules/security/enteauth')
-rw-r--r--modules/security/enteauth/default.nix61
1 files changed, 61 insertions, 0 deletions
diff --git a/modules/security/enteauth/default.nix b/modules/security/enteauth/default.nix
new file mode 100644
index 0000000..a332bf3
--- /dev/null
+++ b/modules/security/enteauth/default.nix
@@ -0,0 +1,61 @@
+{
+ config,
+ lib,
+ pkgs,
+ ...
+}:
+
+# Ente Auth - end-to-end encrypted authentication (2FA)
+let
+ enteAuthWithKeyring = pkgs.symlinkJoin {
+ name = "ente-auth-wrapped";
+ paths = [ pkgs.ente-auth ];
+ buildInputs = [ pkgs.makeWrapper ];
+ postBuild = ''
+ wrapProgram $out/bin/enteauth \
+ --prefix PATH : ${
+ lib.makeBinPath [
+ pkgs.gnome-keyring
+ pkgs.dbus
+ ]
+ } \
+ --run "echo 'password' | ${pkgs.gnome-keyring}/bin/gnome-keyring-daemon --unlock --components=secrets"
+
+ rm -rf $out/share/applications/*
+
+ ln -s ${customDesktopItem}/share/applications/* $out/share/applications/
+ '';
+ };
+
+ customDesktopItem = pkgs.makeDesktopItem {
+ name = "enteauth";
+ exec = "enteauth";
+ icon = "io.ente.auth";
+ comment = "End-to-end encrypted 2FA authenticator";
+ desktopName = "Ente Auth";
+ genericName = "2FA Authenticator";
+ categories = [
+ "Utility"
+ "Security"
+ ];
+ terminal = false;
+ };
+in
+{
+ options.programs.enteauth = {
+ enable = lib.mkEnableOption "Enables wrapped ente-auth with automated keyring unlocks and a desktop entry.";
+ package = lib.mkOption {
+ type = lib.types.package;
+ default = enteAuthWithKeyring;
+ description = "The customized version of ente-auth with a self-unlocking daemon backend.";
+ };
+ };
+
+ config = lib.mkIf config.programs.enteauth.enable {
+ home.packages = [ config.programs.enteauth.package ];
+
+ xdg.mimeApps.defaultApplications = {
+ "x-scheme-handler/enteauth" = "enteauth.desktop";
+ };
+ };
+}