Skip to content

Change global-sops-mode setup example #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

tkerm94
Copy link

@tkerm94 tkerm94 commented Aug 11, 2024

Hi! I tried to enable global-sops-mode according to the example in the readme and it only worked after reloading the emacs configuration multiple times. Adding it to after-init-hook solved the problem.

@djgoku
Copy link
Owner

djgoku commented Aug 11, 2024

Hi! I tried to enable global-sops-mode according to the example in the readme and it only worked after reloading the emacs configuration multiple times. Adding it to after-init-hook solved the problem.

Can you share your configuration even if just the use-package configuration?

How were you testing to make sure sops was enabled?

@tkerm94
Copy link
Author

tkerm94 commented Aug 12, 2024

Sure, here's my emacs reload keybind setup and sops package configuration:

(leader-keys
  ;; ...
  "h r r" '((lambda () (interactive) (load-file user-init-file)))) :wk "Reload emacs config")))))
;; ...
(use-package sops)
(add-hook 'after-init-hook 'global-sops-mode)

Enabling global-sops-mode according to the readme:

(use-package sops
  :init
  (global-sops-mode 1))

After restarting the emacs server, I pressed ^M-x and looked for global-sops-mode in both configurations.
In the configuration with the readme example, global-sops-mode was disabled and only enabled after pressing h-r-r 2-3 times, while in the configuration using after-init-hook it was enabled by default.

@djgoku
Copy link
Owner

djgoku commented Aug 13, 2024

@tkerm94 what version of emacs and is this a custom config or doom or?

@tkerm94
Copy link
Author

tkerm94 commented Aug 13, 2024

Version is 29.4, configuration is custom with packages managed by nix.

@djgoku
Copy link
Owner

djgoku commented Aug 17, 2024

@tkerm94 Can you try to reproduce the problem with this config?

https://gist.github.com/djgoku/abcec99bdca110c9c26fb6cb7f5cd049

I wasn't able to reproduce it https://github.com/getsops/sops/blob/main/example.yaml

@tkerm94
Copy link
Author

tkerm94 commented Aug 18, 2024

I wasn't able to reproduce this with this config either. Before I was using emacsclient with the emacs daemon running, now I tried to run emacs and it shows Error (use-package): sops/:init: Symbol's function definition is void: global-sops-mode when trying to use the example from the readme, apparently elpaca is doing something different?

@djgoku
Copy link
Owner

djgoku commented Aug 18, 2024

Have you tried --debug-init with your config? Can you share a minimal config that reproduces the issue?

@tkerm94
Copy link
Author

tkerm94 commented Aug 18, 2024

When run with --debug-init it shows the following:

Debugger entered--Lisp error: (void-function global-sops-mode)
  (global-sops-mode 1)
  (condition-case err (global-sops-mode 1) ((debug error) (funcall use-package--warning25 :init err)))
  (progn (condition-case err (global-sops-mode 1) ((debug error) (funcall use-package--warning25 :init err))) (if (not (require 'sops nil t)) (display-warning 'use-package (format "Cannot load %s" 'sops) :error)))
  (condition-case err (progn (condition-case err (global-sops-mode 1) ((debug error) (funcall use-package--warning25 :init err))) (if (not (require 'sops nil t)

Here's a small flake with the necessary packages and minimal emacs configuration:

nix develop git+https://gist.github.com/tkerm94/9475a0615ca43c4d3967e597f52f3c74#not-working --no-write-lock-file

Use #working and #not-working at the end of the url to switch between configurations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants