From 743e72547532e1c5f61e44834aafc385ad15779e Mon Sep 17 00:00:00 2001 From: Victor Date: Tue, 19 Dec 2023 12:27:50 +0100 Subject: [PATCH] add module --- flake.nix | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index 7f6ee89..486d57d 100644 --- a/flake.nix +++ b/flake.nix @@ -53,9 +53,30 @@ ''; }; + nixosModules.default = { config }: + with lib; + let cfg = config.services.gnome-autounlock-keyring; + in { + options.services.gnome-autounlock-keyring = { + enable = mkEnableOption "gnome-autounlock.keyring"; + }; + + config = mkIf cfg.enable { + systemd.user.services.gnome-autounlock-keyring = { + description = "Automatically unlock gnome keyring using TPM"; + wantedBy = [ "gnome-session.target" ]; + script = '' + ${packages.default}/bin/gnome-autounlock-keyring unlock + ''; + serviceConfig = { Type = "oneshot"; }; + }; + }; + }; + devShells.default = pkgs.mkShell { shellHook = "${packages.default.preBuild}"; - inherit (packages.default) nativeBuildInputs buildInputs LIBCLANG_PATH; + inherit (packages.default) + nativeBuildInputs buildInputs LIBCLANG_PATH; }; }); }