rycee changed the topic of #home-manager to: Support and discussion around the Home Manager project (https://github.com/rycee/home-manager) | Logs: https://logs.nix.samueldr.com/home-manager
stephank5 has joined #home-manager
stephank has quit [Ping timeout: 256 seconds]
stephank5 is now known as stephank
cole-h has quit [Quit: Goodbye]
<eyJhb> Anyone that has a home-manager example for Mutt + e.g. GMail, Hotmail, custom domain?
<eyJhb> Actually anything?
dermetfan has joined #home-manager
quinn has quit [Quit: ZNC 1.7.5 - https://znc.in]
<eyJhb> rycee: if you have time at any point, I would appreciate some help (provided you use it) :)
<rycee> eyJhb: Sorry, I don't use mutt so won't be of much help.
<rycee> The best tip is usually to investigate the generated configuration.
<eyJhb> Damn, hoped you did since I could see some cleanup in the config :) Guess I will ping teto and evanjs
<eyJhb> rycee: yeah, also what I am trying. But I have a hard time seeing why it won't work. Having a basic setup actually gives me errors
<eyJhb> ANd I am doing nothing fancy, so want to confirm it actually works as intended
asymptotically has joined #home-manager
KarlJoad has joined #home-manager
<KarlJoad> Hey rycee, I just went over the comments in your pull request, and your comment makes sense, and should be easy enough to do. However, I am unsure about how to make a script to run through Nix. Off the top of your head, are there other modules that do the same thing that I could look at for ideas?
__monty__ has joined #home-manager
tudorr has joined #home-manager
<KarlJoad> Is there a way to open a nix repl for home-manager?
<__monty__> KarlJoad: Try nix repl '<home-manager>', depending on the channel name you chose of course.
malSet has quit [Read error: Connection reset by peer]
malSet has joined #home-manager
<KarlJoad> I have done that, and I get a repl that loads 5 variables, but I do not know the name of those 5, nor can I access things that home-manager might have added.
<KarlJoad> __monty__: Well, I found the 5, but I still cannot access the attributes that home-manager provides.
<__monty__> How'd you list the variables?
<KarlJoad> I started the repl, then `:l <home-manager>`, then tabbed for completion and compared with a repl that had not loaded home-manager
<KarlJoad> The 5 variables added were: docs, home-manager, install, nixos, and path.
teto has quit [Ping timeout: 265 seconds]
<__monty__> Hmm, looks like you need to load either <home-manager/nixos> or <home-manager/nix-darwin>. Haven't figured out how to pass the config yet, though.
<KarlJoad> I tried your suggestion, and got an error, stating "error: cannot auto-call a function that has an argument without a default value ('config')". So, I attempted to provide a path to my config and the repl cannot find the home.nix config file, when given the path.
<__monty__> That's because you need to import home.nix but even then I can't get it to work.
<__monty__> What are you trying to do btw? It's probably a lot easier to find in the docs.
<KarlJoad> I want to try to figure out how to properly get the email addresses out of config.accounts.email.accounts.<name>.address and into a list.
<__monty__> Ah, yeah, repl would be nice. My guess'd be `map (x: x.address) (listAttrs config.accounts.email.accounts)`.
<KarlJoad> That seems to be where I'm ending up, yeah. I just wish I had a REPL to test that in.
<KarlJoad> I may be bad at functional programming, but with a REPL, at least I can easily test my failures and work until I get it right.
<__monty__> Yeah, ime nix's repl is more "A tool you can use when you no longer need it." than a playground to learn the language and libraries.
<KarlJoad> Yeah, that's what it seems like. Which sucks for me, because I'm bad at functional programming, but at least I need to more fully think through my stuff before writing it.
<__monty__> Or we sit here and hold tight until rycee gives us the proper incantation : )
<KarlJoad> All hail rycee and his nix skills...
<KarlJoad> How I passed my functional programming class is still a mystery to me.
<KarlJoad> Also, I am developing a package module for a program that only is only up-to-date on the unstable channel. Is there a way to specify where home-manager should pull it from? I managed to get it done with a one-liner importing the unstable channel in my configuration.nix.
<__monty__> I'd give the module a package attribute. That way you can pass (import '<unstable>').packagename from your home.nix.
<__monty__> programs.vim.package for example.
<KarlJoad> That seems to be the thing I will have to do.
<KarlJoad> Thing is, I never added the unstable channel to my channel list. It's in the `nix.nixPath` configuration variable.
<__monty__> That achieves the same thing. Just means you can't manage it with nix-channel.
tudorr has quit [Quit: ZNC 1.7.5 - https://znc.in]
<KarlJoad> Yeah. Trying to get it to work correctly now.
KarlJoad has quit [Quit: Konversation terminated!]
KarlJoad has joined #home-manager
tudorr has joined #home-manager
tudorr has quit [Quit: ZNC 1.7.5 - https://znc.in]
tudorr has joined #home-manager
tudorr has quit [Quit: ZNC 1.7.5 - https://znc.in]
tudorr has joined #home-manager
<KarlJoad> rycee: How do you set up a nix repl for home-manager development?
tudorr has quit [Quit: ZNC 1.7.5 - https://znc.in]
ardumont has quit [Ping timeout: 260 seconds]
__monty__ has quit [Quit: leaving]
ardumont has joined #home-manager
spacekookie has quit [Quit: **aggressive swooshing**]
spacekookie has joined #home-manager
spacekookie has quit [Client Quit]
spacekookie has joined #home-manager
dermetfan has quit [Ping timeout: 272 seconds]
__monty__ has joined #home-manager
quinn has joined #home-manager
dermetfan has joined #home-manager
cole-h has joined #home-manager
<pbogdan> anyone having trouble with the recently added socket activation for Emacs? I tried a few times and whenever the service gets activated Emacs just complains there's a server already running on the socket and refuses to launch
<pbogdan> do I need to add anything to my Emacs config to make it work?
s1341 has quit [Quit: Connection closed for inactivity]
<pbogdan> logs when the service gets activated - https://gist.github.com/pbogdan/868226b37e809de4700aee9ba78b8ec3 (this is Emacs without my personal configuration or any extra packages)
<KarlJoad> pbogdan: I tried to use the socket last night, and I didn't get it to work either. Then again, I had other issues with the module created by home-manager that I will start looking into.
<rycee> pbogdan: Try latest master.
<rycee> KarlJoad: What do you mean by "nix repl for home-manager development"? What would you like to do in the repl?
<pbogdan> rycee: thank you, will give it a spin in a bit
<KarlJoad> rycee: I was trying to test getting all the email address out of each `accounts.email.accounts.<name>` and into a list, for that wrapper script you mentioned in the PR.
<KarlJoad> I wanted to test my ideas before actually writing it, but I just wrote out to a file instead.
<KarlJoad> I specifically wanted to have the accounts.email.accounts set available to me, so I was sure I was working on the correct thing.
<rycee> Ah, right.
<rycee> Well, something like `hm = import ~/path/to/home-manager/modules { configuration = ~/.config/nixpkgs/home.nix; pkgs = import <nixpkgs> {}; }` should work.
<rycee> Then you should be able to do something like `builtins.mapAttrs (n: v: v.address) hm.config.accounts.email.accounts`
<KarlJoad> Perfect, that's exactly what I was searching for.
<rycee> 👍️
<KarlJoad> Yeah, I went a different library function mapAttrsToList, because I wanted a list out of it, but same thing essentially.
<KarlJoad> Still not sure what you mean by a wrapper script though.
<rycee> Me neither, it was just something mentioned in the issue you linked in the comment.
<KarlJoad> Yeah, and I see where you're going with it. A new command that we introduce to the path, like mu-mail-init, and it handles all the parameters for an `mu init`, which could be nice. But, I don't see any other modules doing that right now.
<rycee> But I was thinking it would be good if mu was aware of the accounts you've configured.
<rycee> Just having the module install the mu package is not very useful.
<rycee> I'm not sure what the best design would be. I used mu a little a long time ago but now I use notmuch so I've forgotten everything about mu :-/
<KarlJoad> True. However, in a typical installation mu isn't aware of the accounts anyways. All the configuration of mu happens at the initial index. Which means providing a script for the user could be nice, you're right. If you think a script is warranted, then is there another modules that does something similar?
<KarlJoad> The difference here is that notmuch creates a config file, storing this information. mu doesn't.
asymptotically has quit [Quit: Leaving]
spacekookie has quit [Quit: No Ping reply in 60 seconds.]
spacekookie has joined #home-manager
<KarlJoad> I only put the comment about mu's author not making a config file to explain why I did not include any additional options and why there may not be any tests about the new module.
<rycee> But I guess you at the very least have to point mu to the maildir paths to index?
<KarlJoad> Correct. You do that with `mu init --maildir=<path> --my-address="addr1@dom1.com" [--my-address=...]` and then never again.
<rycee> Ok, might be something to do in the activation script.
<KarlJoad> At least, in the version of mu that home-manager targets, the unstable version. However, that version did a major overhaul of the index initialization, which is what NixOS 20.03 has right now
<KarlJoad> The activation script is what I thought you were talking about. The minor problem with that is that after every `home-manager switch`, you would need to run `mu index` again, because you just created a new index..
<rycee> Your module would never be used with 20.03 so that is no problem.
<KarlJoad> That's what you confirmed last night, so yeah. Is there any way for me to assure that though? Because when I was testing yesterday, I pulled the old version when written the same way as the other modules on master.
<rycee> If you don't need to run the init on each switch then you'd have to find a way to prevent that.
<rycee> If you want you can try doing asserts based on the nixpkgs version but I wouldn't worry about it.
<KarlJoad> Ok, then I won't worry about the version.
<KarlJoad> Then, is there another module that you can think of off the top of your head that has a single-run activation script?
<rycee> No sure, don't think so.
<rycee> I imagine it would be done by checking if some mu file exists for the account.
<KarlJoad> Yeah. Writing a file to somewhere in the Maildir directory might work as a record of it being done.
__monty__ has quit [Quit: leaving]
<KarlJoad> rycee: Would it make more sense to write this guard file into the maildir store or the cache location of the xapian database? Does home-manager currently have a preference for that?
<rycee> Why not just check if there is a database?
<rycee> If you absolutely need to create a file yourself then I'd suggest to put it in `"${XDG_DATA_HOME:-$HOME/.local/share}/home-manager"`.
<KarlJoad> Then there should be a way to identify if a directory/file is already created, right?
dermetfan has quit [Ping timeout: 260 seconds]