<shofius>
is it possible to create a home-manager module that's hosted on the NUR? not sure if i'm asking correctly...
<shofius>
i'd like to write a module and host it in my NUR repo but have it be able to inherit things from home-manager... specifically i want it to write some config files usind home.file.<name> with a target at config.xdg.<path>
<shofius>
btw, i tried to just start writing something and use it in my config but it's not working, and there are several weird things about what i'm doing so i'm not exactly sure where the error is. we can talk about what errors i'm getting and stuff but i figure it'd be helpful to first just see if this is even possible, and maybe a short example of how to do it
supersandro2000 has quit [Remote host closed the connection]
<piegames[m]>
shofius (IRC): I don't think there is "official" support for that, but given the laziness of the language you can simply expose your custom module as NUR library attribute or something.
<rycee>
shofius: No problem hosting modules in NUR. I do so for my emacs -init one, for example.
johannes_ has quit [Quit: leaving]
aveltras has quit [Quit: Connection closed for inactivity]
<shofius>
rycee: thanks, i'll take a look at yours and see if i can learn something :p
<shofius>
the "weird" part of the environment that i was referring to is that home-manager is not installed on NixOS, which i think i read in the readme is not technically supported, but it's working for me so far... also this is on a pinephone. but i don't think the pinephone thing should be any different than like... a raspberry pi or something
<SumnerEvans[m]>
Wow, NixOS on a pinephone. That's epic.
<simpson>
It should be commonplace, rather than a herculean achievement, to merely put Free Software onto one's own hardware.
rajivr has quit [Quit: Connection closed for inactivity]
cole-h has joined #home-manager
<shofius>
ambroisie: thanks. i did see that, and that's how i was trying to do it but when it didn't work i thought maybe i misunderstood what that example was for. i think i have some issues with my module at this point
<ambroisie>
shofius: what error do you get?
<shofius>
SumnerEvans[m]: there's mobile nixos which i've used to build a few images for the pinephone but right now i'm actually using postmarketos because i like the sxmo interface... there's a port of sxmo to work on top of mobile nixos but it doesn't have the most recent updates, and also doesn't integrate as nicely with nixos as it does with postmarketos, and i didn't want to spend a bunch of energy on a bunch of different things... it t
<shofius>
quite a bit of effort to build nixos images for the phone and also modify the sxmo stuff, etc... i'll come back to mobile nixos soon but for right now it's not as far along as the other pinephone distros
<shofius>
i haven't pushed my module to my NUR repo yet, so i'm copying my whole repo with my changes over to the phone and importing it directly
<shofius>
i'm probably doing something silly... i'm really just trying to create a file based on the options set in the module. eventually i'll probably be writing more than that one file, but i might also break it up into multiple modules for that
<ambroisie>
shofius: why are you importing `<home-manager>` in your module?
<ambroisie>
When you're importing the module into your home-manager configuration, you simply want to use its declared options/configuration
<ambroisie>
The fact that you are importing it in your home-manager configuration gives you the whole `home.file` machinery for example, so no need to import `<home-manager>`
<ambroisie>
Other than that I don't think I can see anything amiss
<shofius>
so you're saying to remove that imports = [<home-manager>];?
<ambroisie>
Yeah
<shofius>
oh ok, so because that particular file gets imported and run in the scope of home manager, where `home.file` is available, it's also available to that module?
<ambroisie>
Yeah that's pretty much it
<shofius>
gotcha
<shofius>
thanks
<shofius>
ah, now i'm getting infinite recursion lol
<ambroisie>
That's progress
<ambroisie>
It means your module evaluated properly
<shofius>
oh nice lol
<shofius>
i hit this same error last night at some point...
<shofius>
also i've dealt with it before with modules and the NUR
<ambroisie>
You might try peppering a few trace calls to see what it is getting stuck on
<shofius>
what's the best way to do that?
<ambroisie>
I haven't dealt much with infinite recursion until now so my debugging tactics aren't really up to snuff
<ambroisie>
Basically, if you check the way builtins.trace works
<ambroisie>
It pretty-prints one of its arguments, and evaluates then returns the value of the other
<ambroisie>
Don't rememer which is first, which is second
<ambroisie>
So it can be useful to see what got evaluated in your configuration
<shofius>
oh nice, i didn't even know that was a thing
<shofius>
thanks
<ambroisie>
Combine that with a form of bisection by removing some part of your configuration until you have isolated the smallest non-working example will also help
shofius has quit [Ping timeout: 268 seconds]
midchildan has quit [Ping timeout: 250 seconds]
ProofTechnique has quit [Ping timeout: 246 seconds]
vdemeester has quit [Read error: Connection reset by peer]
s1341_ has quit [Ping timeout: 260 seconds]
mudri has quit [Ping timeout: 245 seconds]
vdemeester has joined #home-manager
rizary has quit [Ping timeout: 245 seconds]
dgpratt has quit [Ping timeout: 248 seconds]
ProofTechnique has joined #home-manager
midchildan has joined #home-manager
dgpratt has joined #home-manager
rizary has joined #home-manager
s1341_ has joined #home-manager
mudri has joined #home-manager
shofius has joined #home-manager
<shofius>
ooh i got it to work
<shofius>
had to remove the references to `home-manager.` in my module
<shofius>
had a few other errors in there too that i was able to find easily once i got past that
tomchab[m] has joined #home-manager
quinn has joined #home-manager
__monty__ has quit [Quit: leaving]
<shofius>
this is more of a general nix question i guess, but if i have an option that can either be a string or null, and if it's null i want to not do anything, but if there's a string filled in then i want to add a line in the config that also includes that value... how can i do that? looking through the wiki right now but i'm not seeing anything that makes it clear
<shofius>
maybe a function?
<shofius>
oh, i guess i was just using if statements wrong
Synthetica has quit [Quit: Connection closed for inactivity]
supersandro20008 has joined #home-manager
supersandro2000 is now known as Guest61649
Guest61649 has quit [Killed (hitchcock.freenode.net (Nickname regained by services))]