Skip to content

Configuration ​

There is no configuration file. Settings are command-line flags; the Nix modules write them.

Flags ​

lys-secrets [flags]
lys-secrets pinentry        # or pinentry-lys; see GnuPG pinentry
FlagDefaultEffect
--unlock-fd NnoneRead the login password from inherited descriptor N and unlock login, creating it if absent
--collection-lock-after D0Lock a collection after no secret was read from it and nothing in it changed for D; 0 never
--collection-lock-on-screen-lockoffLock every collection when logind reports the session locked
--confirm-foreign-readsoffAsk before a program reads an item another program stored; see Confirming reads
--ssh-agentoffServe an SSH agent on $XDG_RUNTIME_DIR/lys-secrets/ssh; see SSH agent
--vault-lock-after D15mLock the vault after no field was read for D; 0 never
--vault-sync-interval D30mSync the open vault this often; 0 only on unlock and on request
--vault-collection-folder NAMEemptyShow this vault folder's logins as the read-only bitwarden collection; empty shows none
  • Durations use Go syntax (90s, 1h30m). Negative values are refused. Idle locks and the sync interval count suspended time and act within 30 seconds of resume.
  • --unlock-fd reads the whole descriptor and drops one trailing newline. An empty password or one over 4096 bytes is a startup error. A password that does not open login is logged and leaves it locked.
  • --collection-lock-on-screen-lock watches the logind session's Lock signal and LockedHint on the system bus. If logind is unreachable, this is logged and the service keeps running. The vault is not affected.
  • --vault-collection-folder refuses to start if a keyring collection with id bitwarden exists, naming the file to rename.

Flags for the packaged unit ​

Override ExecStart in ~/.config/systemd/user/lys-secrets.service.d/override.conf:

ini
[Service]
ExecStart=
ExecStart=/usr/bin/lys-secrets --vault-lock-after=30m --vault-collection-folder=Desktop

Then systemctl --user daemon-reload && systemctl --user restart lys-secrets. A restart locks every collection and the vault.

Nix options ​

Under services.lys-secrets, for both the NixOS and home-manager module:

OptionDefaultEffect
enablefalseInstall and start the service
packagethe flake's lys-secretsPackage to run
collections.lockAfter0 (minutes)--collection-lock-after
collections.lockOnScreenLockfalse--collection-lock-on-screen-lock
collections.confirmForeignReadsfalse--confirm-foreign-reads
sshAgent.enablefalse--ssh-agent, and SSH_AUTH_SOCK for login shells
pinentry.enablefalseMakes pinentry-lys gpg-agent's pinentry (home-manager services.gpg-agent.pinentry.package, NixOS programs.gnupg.agent.pinentryPackage)
vault.lockAfter15 (minutes)--vault-lock-after
vault.syncInterval30 (minutes)--vault-sync-interval
vault.collectionFolder""--vault-collection-folder

The bitwarden collection ​

With a folder set, libsecret clients see its logins while the vault is open:

sh
secret-tool lookup username ada
  • Secret: the password.
  • Attributes: xdg:schema (dev.stubbe.lys.Bitwarden.Login), bitwarden:id, name, and where present username, uri (the first) and folder.
  • Only logins that have a password, decrypted fully, and are not behind Bitwarden's master password reprompt are shown.
  • While the vault is locked the collection is locked and empty; searches find nothing and do not prompt. Unlocking it asks for the master password.
  • Creating, changing or deleting items is refused.

Files ​

$XDG_DATA_HOME and $XDG_STATE_HOME default to their usual places under $HOME. $XDG_RUNTIME_DIR must be an absolute path, or lys-secrets exits.

PathContents
$XDG_DATA_HOME/lys-secrets/<id>.keyringOne collection
$XDG_DATA_HOME/lys-secrets/aliases.jsonAlias to collection id
$XDG_STATE_HOME/lys-secrets/bitwarden/session.jsonBitwarden server, email, client id
$XDG_STATE_HOME/lys-secrets/bitwarden/device-idDevice id known to the Bitwarden server
$XDG_RUNTIME_DIR/lys-secrets/controlUnlock socket
$XDG_RUNTIME_DIR/lys-secrets/sshSSH agent socket (--ssh-agent)

Released under the MIT License.