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
<tdeo> first module i've written, so probably has some stuff wrong
<rycee> tdeo: Thanks 😃 Looks pretty good, I'll have a closer look in the evening.
linarcx has joined #home-manager
linarcx has quit [Ping timeout: 246 seconds]
feepo has joined #home-manager
linarcx has joined #home-manager
linarcx has quit [Quit: WeeChat 2.4]
linarcx has joined #home-manager
linarcx has quit [Quit: WeeChat 2.4]
linarcx has joined #home-manager
<NickHu> How can I map `import` over all files in a subdirectory, so I can make better use of https://rycee.gitlab.io/home-manager/options.html#opt-nixpkgs.overlays?
<NickHu> e.g. I want home-manager to use overlays from ${dotfiles}/.config/nixpkgs/overlays
<infinisil> NickHu: Check out builtins.readDir
linarcx has quit [Quit: WeeChat 2.4]
linarcx has joined #home-manager
ardumont has quit [Ping timeout: 246 seconds]
ardumont has joined #home-manager
linarcx has quit [Ping timeout: 250 seconds]
linarcx has joined #home-manager
linarcx has quit [Quit: WeeChat 2.4]
linarcx has joined #home-manager
linarcx has quit [Ping timeout: 245 seconds]
linarcx has joined #home-manager
linarcx has quit [Quit: WeeChat 2.4]
linarcx has joined #home-manager
Orbstheorem has joined #home-manager
<Orbstheorem> Hello, how can I manage my home-manager configuration from my configuration.nix?
<Orbstheorem> The instructions on the wiki say to import <home-manager>/nixos, but this doesn't exist, so I'm trying to import <home-manager>/modules instead
<Orbstheorem> I'm getting this error when I build the derivation: `error: anonymous function at /nix/store/[...]/default.nix:1:1 called with unexpected argument 'config',`
ardumont has quit [Ping timeout: 245 seconds]
<Orbstheorem> `overlays = [ "${home-manager}/overlay.nix" ];` doesn't work either, I get `error: Module `[...]nixos-config/modules/users.nix` has unsupported attribute `overlays'.[...]`
ardumont has joined #home-manager
linarcx has quit [Ping timeout: 268 seconds]
linarcx has joined #home-manager
<Orbstheorem> Well, the overlay was definitely not what I wanted
<Orbstheorem> turns out I somehow managed to get a partial checkout of home-manager
<Orbstheorem> Importing <home-manager/nixos> works
<Orbstheorem> I'm now dealing with a situation where I import the module in the same file I define options that use home-manager types provided in it's options.
<Orbstheorem> If I access them via options, I get that they don't exist (I believe because the imports have not been processed yet) and if I access them via config, I get an infinite recursion :D
ardumont has quit [Ping timeout: 250 seconds]
ardumont has joined #home-manager
linarcx has quit [Quit: WeeChat 2.4]
linarcx has joined #home-manager
linarcx has quit [Quit: WeeChat 2.4]
linarcx has joined #home-manager
ardumont has quit [Ping timeout: 245 seconds]
ardumont has joined #home-manager
ardumont has quit [Ping timeout: 246 seconds]
ardumont has joined #home-manager
xent has joined #home-manager
<infinisil> Orbstheorem: Unfortunately you can't use `imports` and `options` in your home-manager modules when using it through NixOS
<infinisil> This is because the module system fundamentally doesn't support this
<infinisil> So what you need to do instead is write NixOS modules for everything, and include those from other NixOS modules
<infinisil> Then you can define new options (even HM ones) and use imports in those
<Orbstheorem> Okay
<infinisil> home-manager.users.* can't have any imports/options declarations that is
<Orbstheorem> right, ofc
<Orbstheorem> I'm trying to replicate your options.mine.userConfig in my own configuration
xent has quit [Remote host closed the connection]
<Orbstheorem> (I'm still phrasing my question x) )
<Orbstheorem> So, I `imports = [ <home-manager/nixos> ];`, but when I define my `options.roos.userConfig = {type = options.home-manager.users.type.function.wrapper;, ...`, I get an evaluation error saying that attribute 'home-manager' is missing from 'options'
<Orbstheorem> Since I can't see any imports to home-manager in your system config, I wonder how does it get evaluated?
<Orbstheorem> This is the file I'm working on: https://paste.gnugen.ch/raw/XDJG
iceypoi has joined #home-manager
<iceypoi> rycee: I've been playing around quite successfully with home-manager in WSL
<iceypoi> apart from that one package that just doesn't exist in 64 bits, it all pretty much just works ;-)
<infinisil> Orbstheorem: Ah, you need to add `options` to the argument list at the top
<infinisil> This is why some people don't like `with`, because in this case your `options` value came from `lib.options` due to the `with lib;`
<infinisil> Which is not the same `options` as the one from the argument list
<Orbstheorem> Ah!
* Orbstheorem didn't know there was a lib.options
<Orbstheorem> Je check
<Orbstheorem> It works \^^/
ardumont has quit [Ping timeout: 245 seconds]
ardumont has joined #home-manager
linarcx has quit [Quit: WeeChat 2.4]
linarcx has joined #home-manager
infinisil has quit [Quit: Configuring ZNC, sorry for the joins/quits!]
infinisil has joined #home-manager
infinisil has quit [Quit: Configuring ZNC, sorry for the joins/quits!]
infinisil has joined #home-manager
iceypoi has quit [Quit: WeeChat 2.4]
<rycee> infinisil: Hmm, I use module imports within my configuration that i Nix import into the system configuration.
<rycee> I.e., I have `home-manager.users.rycee = import ./user/rycee.nix;` in my system configuration and inside rycee.nix I have e.g. `imports = [ ./common.nix ./extra-packages.nix ];`
<rycee> Works fine.
<rycee> Or maybe I misunderstood something?
<rycee> But I suspect the user configuration module needs to be of a "function form", not just an attribute set.
linarcx has quit [Quit: WeeChat 2.4]
<rycee> Damn, Matrix is really nice. My internet has been down since the afternoon and I still got all messages from the Matrix users in here :-D
ardumont has quit [Ping timeout: 250 seconds]
<infinisil> rycee: Do you try to define options in rycee.nix?
<infinisil> It only doesn't work if you do, I'm pretty sure
<rycee> infinisil: No, not directly. But the common.nix file imports my emacs.nix (https://gitlab.com/rycee/configurations/blob/master/user/emacs.nix), which in turn imports my emacs-init module, which does define options :-)
<infinisil> Hmm..
<infinisil> rycee: Ahhh
<infinisil> It works as long as you only use the new options within that submodule
<infinisil> But you couldn't set your new home-manager options from configuration.nix
ardumont has joined #home-manager
<infinisil> My certainty is rising
<rycee> Yeah, the pastebin I just looked at seems quite different. Not like my setup.
<rycee> Wouln't it be possible to just map over the users and mkMerge with a module containing the options that should be set for all users?
infinisil has quit [Quit: Configuring ZNC, sorry for the joins/quits!]
infinisil has joined #home-manager
<infinisil> rycee: Maybe, I haven't tried it
<infinisil> Well maybe I have and it didn't work, but I can't remember trying it :)
<rycee> Me neither :-)
<rycee> I just have the common.nix import directly in my user config so at the system level it becomes very simple, just to use a Nix import.
klntsky has quit [Ping timeout: 256 seconds]
klntsky has joined #home-manager
ardumont has quit [Ping timeout: 258 seconds]