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
hmpffff has quit [Quit: nchrrrr…]
<hpfr[m]> Right now, I have all my scripts in a directory that I add to my PATH. Is there a better way to do this with home-manager?
<hpfr[m]> by scripts I mean just small bash stuff for personal use
<cole-h> Maybe something like `pkgs.writeShellScriptBin`?
malSet has joined #home-manager
malSet has quit [Read error: Connection reset by peer]
malSet has joined #home-manager
malSet has quit [Read error: Connection reset by peer]
malSet has joined #home-manager
malSet has quit [Read error: Connection reset by peer]
malSet has joined #home-manager
malSet has quit [Read error: Connection reset by peer]
malSet has joined #home-manager
malSet has quit [Read error: Connection reset by peer]
malSet has joined #home-manager
malSet has quit [Read error: Connection reset by peer]
malSet has joined #home-manager
malSet has quit [Read error: Connection reset by peer]
malSet has joined #home-manager
malSet has quit [Read error: Connection reset by peer]
malSet has joined #home-manager
malSet has quit [Read error: Connection reset by peer]
malSet has joined #home-manager
malSet has quit [Read error: Connection reset by peer]
malSet has joined #home-manager
malSet has quit [Read error: Connection reset by peer]
malSet has joined #home-manager
malSet has quit [Read error: Connection reset by peer]
bgamari has quit [Remote host closed the connection]
bgamari has joined #home-manager
benkolera is now known as benkolera_
benkolera has joined #home-manager
benkolera_ has quit []
<hpfr[m]> cole-h: how do I discover documentation and source for that function?
<cole-h> If you execute that in your repl, it'll show you where it's defined
<cole-h> (no arguments)
<cole-h> nixpkgs/pkgs/build-support/trivial-builders.nix:204:25
<hpfr[m]> thanks
<hpfr[m]> cole-h: interesting. so in this case, that would work because they would end up in /nix/store/home-manager-path where they would be in my path?
<hpfr[m]> there's also a pkgs.writeShellScript, which is identical except it writes the script directly to the store path rather than in store-path/bin. does this matter?
<hpfr[m]> also, where would I put this in my configuration? I see that it's based on writeTextFile which is based on runCommand, but I'm confused on what that returns
<hpfr[m]> ok, I'm pretty sure it returns a derivation, but I don't know what to do with that derivation
<hpfr[m]> ok, I searched for writeShellScript in the home-manager repo, and I found that I could use toString on the returned derivation, and I'm pretty sure I could concatenate that with my PATH. I have like twenty scripts though. I could write the nix to do this for all of them, but it doesn't seem ideal. Can I write them all to the same derivation?
Max[m]4 has quit [Ping timeout: 260 seconds]
uvnikita[m] has quit [Ping timeout: 260 seconds]
uvnikita[m] has joined #home-manager
Max[m]4 has joined #home-manager
malSet has joined #home-manager
malSet has quit [Read error: Connection reset by peer]
malSet has joined #home-manager
malSet has quit [Read error: Connection reset by peer]
malSet has joined #home-manager
malSet has quit [Read error: Connection reset by peer]
malSet has joined #home-manager
malSet has joined #home-manager
malSet has quit [Read error: Connection reset by peer]
malSet has joined #home-manager
malSet has quit [Read error: Connection reset by peer]
malSet has joined #home-manager
cole-h has quit [Ping timeout: 264 seconds]
malSet has quit [Read error: Connection reset by peer]
malSet has joined #home-manager
malSet has quit [Read error: Connection reset by peer]
malSet has joined #home-manager
malSet has quit [Read error: Connection reset by peer]
malSet has joined #home-manager
malSet has quit [Read error: Connection reset by peer]
malSet has joined #home-manager
malSet has quit [Read error: Connection reset by peer]
malSet has joined #home-manager
malSet has quit [Read error: Connection reset by peer]
malSet has joined #home-manager
malSet has quit [Read error: Connection reset by peer]
hmpffff has joined #home-manager
<immae> hpfr[m]: https://paste.ee/p/lH26L something like that could do the trick
<hpfr[m]> Ah, then I could add that to my path, cool
<hpfr[m]> immae: would I just put this in a let statement as “scripts” or something and then make use of it wherever appropriate
<immae> hpfr[m]: something like home.packages = let scripts = (the snippet); in [ scripts other_packages ]; yes
<hpfr[m]> Oh, you can treat it as a full fledged package? That would be nice and simple, thanks for the help
<immae> to be considered a proper package it just needs some directories bin / share / lib ..., like what you find in /usr in regular distribution. Then it will just use them yes
hmpffff_ has joined #home-manager
hmpffff has quit [Ping timeout: 246 seconds]
jfroche has joined #home-manager
__monty__ has joined #home-manager
jfroche has quit [Ping timeout: 240 seconds]
jfroche has joined #home-manager
s1341 has joined #home-manager
<s1341> hi all
<s1341> created my first PR for home-manager: https://github.com/rycee/home-manager/pull/1105
<{^_^}> #1105 (by s1341, 1 minute ago, open): zplug: Add initial support for zplug package manager
<rycee> hpfr: I have the following in my `home.packages` for some random scripts:
<rycee> s1341: Neat :-)
<s1341> rycee: :D
<s1341> rycee: my pr failed the tests... but i can't figure out what the issue is...
<s1341> can you take a look?
<rycee> Don't have time. I'm working. Scroll through the Travis-ci log and look for red. Most likely it failed the formatting check. Try running `./format` in the project root.
<s1341> rycee yeah i get 'not formatted'
<s1341> rycee: ok. i figured it out...
malSet has joined #home-manager
malSet has quit [Read error: Connection reset by peer]
malSet has joined #home-manager
malSet has quit [Read error: Connection reset by peer]
malSet has joined #home-manager
malSet has quit [Read error: Connection reset by peer]
malSet has joined #home-manager
malSet has quit [Read error: Connection reset by peer]
malSet has joined #home-manager
malSet has quit [Read error: Connection reset by peer]
malSet has joined #home-manager
malSet has quit [Read error: Connection reset by peer]
malSet has joined #home-manager
malSet has quit [Read error: Connection reset by peer]
malSet has joined #home-manager
malSet has quit [Read error: Connection reset by peer]
s1341 has quit [Quit: Connection closed for inactivity]
cole-h has joined #home-manager
cjpbirkbeck has joined #home-manager
malSet has joined #home-manager
malSet has quit [Read error: Connection reset by peer]
malSet has joined #home-manager
malSet has quit [Read error: Connection reset by peer]
malSet has joined #home-manager
malSet has quit [Read error: Connection reset by peer]
malSet has joined #home-manager
malSet has quit [Read error: Connection reset by peer]
malSet has joined #home-manager
malSet has quit [Read error: Connection reset by peer]
hmpffff_ has quit [Quit: nchrrrr…]
malSet has joined #home-manager
malSet has quit [Read error: Connection reset by peer]
malSet has joined #home-manager
malSet has quit [Read error: Connection reset by peer]
malSet has joined #home-manager
malSet has quit [Read error: Connection reset by peer]
malSet has joined #home-manager
malSet has quit [Read error: Connection reset by peer]
malSet has joined #home-manager
malSet has quit [Read error: Connection reset by peer]
malSet has joined #home-manager
malSet has quit [Read error: Connection reset by peer]
malSet has joined #home-manager
malSet has quit [Read error: Connection reset by peer]
malSet has joined #home-manager
malSet has quit [Read error: Connection reset by peer]
malSet has joined #home-manager
malSet has quit [Read error: Connection reset by peer]
malSet has joined #home-manager
malSet has quit [Read error: Connection reset by peer]
<cjpbirkbeck> hello, anybody here? i've used nixos for while now, and i'm thinking of moving (some of my) configs to home-manager.
<__monty__> Great : )
<cjpbirkbeck> currently, i have neovim with the plugins installed at the system level, while source a regular vimL script almost all settings. would i be able to keep the same setting with home-manager, or would the user-level packages override the package at system level?
hmpffff has joined #home-manager
hmpffff has quit [Read error: Connection reset by peer]
hmpffff has joined #home-manager
<hpfr[m]> rycee: your `substituteInPlace` concerns me. I also use rofi-emoji, why would you have to make a separate path variable for it? all my scripts depend on installed packages, since that's what personal bash scripts are for. do I need to substitute a path like that for all my scripts? why can't your rofi-emoji script see the rofi, xclip, and xdotool packages?
hmpffff has quit [Ping timeout: 246 seconds]
hmpffff has joined #home-manager
hmpffff__ has joined #home-manager
hmpffff has quit [Ping timeout: 264 seconds]
<cole-h> hpfr[m]: It's probably required because rofi-emoji hardcodes paths. It's really weird; I looked into packaging it previously, but gave up
jfroche has quit [Remote host closed the connection]
<cjpbirkbeck> okay, so it is possible configure home-manager from configuration.nix (or anything it sources)? and would it be better just to configure home-manager outside of configuration.nix?
<judson_> Is there a variable or something to get the config directory in home.nix?
<judson_> I'm trying to configure a program that needs a path to a file, and using e.g. $XDG_CONFIG_HOME isn't working.
<cole-h> xdg.configHome I think
<cole-h> Yep, `xdg.configHome`
<hpfr[m]> cjpbirkbeck: yes, check the hm manual for the NixOS module
<hpfr[m]> It’s up to preference of that vs separate, but most people tend to move to the NixOS module
<judson_> cole-h I tried that and it reports "no such variable."
<judson_> Oh, it needs `config.xdg.configHome`
<judson_> Thanks!
<cole-h> Ah yeah, sorry x)
<hpfr[m]> cole-h: are you talking about the rofi-emoji written in C? I don’t think that’s the one rycee is using because he’s copying it like other shell scripts. I’m guessing he uses this one which is also what I use https://gist.github.com/NearHuscarl/5d366e1a3b788814bcbea62c1f66241d
<hpfr[m]> But I don’t get why that one would need the path substitution so I could be misunderstanding
<cole-h> hpfr[m]: Oh, yeah I was thinking about the actual rofi plugin written in C. Sorry :^)
cjpbirkbeck has quit [Quit: cjpbirkbeck]
cjpbirkbeck has joined #home-manager
<hpfr[m]> I've run into an issue. one of the scripts I have is used as the script for a systemd user service I've defined with home-manager. I have to specify the absolute path of a package installed with home-manager to get the user service script to find it when it's called by systemd. Is there a way to fix this? Am I going about it wrong?
<hpfr[m]> I guess I'm using the NixOS option `systemd.user.services`, maybe I should use the home-manager option, but the home-manager unitType seems much more nebulously defined...
<cole-h> The hm systemd units are extremely similar to what you would write in an actual unit file. Here's an example from my config: https://gist.github.com/cole-h/792c29dedb5fa44fc3359d2396917b80
<cole-h> Basically boils down to `systemd.user.services."name"."Header"."Setting=SomeValue"`
<hpfr[m]> yeah, I know. I feel like the NixOS module's unit type is better
<hpfr[m]> but if this gets the paths working, I'll use it
<hpfr[m]> honestly it's probably better since the NixOS module provides those services to every user which doesn't really make sense for what I'm using it for
<hpfr[m]> cole-h: the service I'm writing uses one of the scripts I packaged using rycee's method (pkgs.runCommand) called `setbg` for `ExecStart`. So I have a `let` at the start of my hm module defining the scripts package as `gui-scripts`, which I include in `home.packages` and in the `ExecStart` as `"${gui-scripts}/bin/setbg"`. When I try to run the service, the script can't find `ls`, or `grep`, or `ln`. How am I supposed to
<hpfr[m]> give the script a path to work with?
malSet has joined #home-manager
<cole-h> `runCommand "name" { buildInputs = [ coreutils ] } ''script''` maybe?
<hpfr[m]> like when I'm defining the scripts package? I could try that, but the scripts work fine when I run them from a terminal
<cole-h> Probably because you have access to coreutils in your terminal environment
malSet has quit [Read error: Connection reset by peer]
<cole-h> If adding it as `buildInputs` doesn't work, you can try `Environment="${lib.makeBinPath [ coreutils ]}";` in the unit
<hpfr[m]> oh, hah
malSet has joined #home-manager
<hpfr[m]> there is also `systemd.user.sessionVariables`, maybe I could define a PATH there?
<cole-h> You could certainly try :P
<cole-h> I don't use it myself
malSet has quit [Read error: Connection reset by peer]
malSet has joined #home-manager
<hpfr[m]> with the Environment in the unit method I got invalid environment assignment, I think I have to add PATH= before the nix expr
malSet has quit [Read error: Connection reset by peer]
malSet has joined #home-manager
<cole-h> Oh yeah, sorry
<cole-h> It just gives you the resulting value of PATH, which still needs to be assigned
malSet has quit [Read error: Connection reset by peer]
malSet has joined #home-manager
malSet has quit [Read error: Connection reset by peer]
malSet has joined #home-manager
malSet has quit [Read error: Connection reset by peer]
malSet has joined #home-manager
malSet has quit [Read error: Connection reset by peer]
malSet has joined #home-manager
malSet has quit [Read error: Connection reset by peer]
<hpfr[m]> I also had to add a with pkgs, but what does that mean exactly with makeBinPath? which derivation of coreutils is it making a path to?
malSet has joined #home-manager
malSet has quit [Read error: Connection reset by peer]
malSet has joined #home-manager
malSet has quit [Read error: Connection reset by peer]
<cole-h> All it does is print out the bin path of whatever derivation(s) you put in that list
<cole-h> So `lib.makeBinPath [ coreutils procps ]` would result in a string that looks like this:
<cole-h> /nix/store/hzvl3dvv8651iqlb5g6gq5hzjzmhjn7m-coreutils-8.31/bin:/nix/store/nz8baf2s4wygv1nc6pybb7dc5wn3yw8f-procps-3.3.16/bin
<hpfr[m]> I get that, but how does it "pick" which bin path to use for coreutils? since you can have multiple installed. how does pkgs.coreutils signify a unique path?
<cole-h> I'm not sure I understand your question. How can you have "multiple installed" coreutils?
hmpffff has joined #home-manager
hmpffff__ has quit [Ping timeout: 250 seconds]
<cole-h> Anybody here use the sway module in hm? I would appreciate testing on this PR, if you have a moment: https://github.com/rycee/home-manager/pull/1086. Been running it for a week and it seems fine, but it'd be nice to get a breadth of people to test it
<{^_^}> #1086 (by cole-h, 1 week ago, open): sway: fix onChange when defunct sockets exist
<hpfr[m]> cole-h: you can do that with nix? Any package can depend on any version of coreutils so how dues makeBinPath “pick” a path when given pkgs.coreutils
<hpfr[m]> Wish I could use sway, bought nvidia before I switched to linux unfortunately
* cole-h has a 1080
* hpfr[m] wonders how
<cole-h> Nouveau works fine.
<hpfr[m]> Nouveau is performant post 700 séries? I was under the impression it was really bad because NVidia doesn’t provide enough info
<cole-h> Whatever `pkgs.coreutils` evaluates to is what will be used. If you overlay it for an older version of coreutils, that will be used. If you don't have any overlays for it, the version from your channels will be used. There's never any ambiguity.
<cole-h> I don't game in Linux, so maybe that's why I'm fine with it. But watching videos on YouTube (via Firefox), mpv streams (via streamlink/youtube-dl) works fine. I haven't seen any hitches.
<hpfr[m]> Oh, the version from channel. Thanks
<hpfr[m]> Interesting, looks like the 10 series (NV130) is pretty well supported now https://nouveau.freedesktop.org/wiki/FeatureMatrix/
<hpfr[m]> I have a 2070 (NV160) so I’m out of luck
<cole-h> Ah, unfortunate
hmpffff_ has joined #home-manager
hmpffff has quit [Ping timeout: 246 seconds]
mexisme has joined #home-manager
c0c0 has quit [Ping timeout: 250 seconds]
c0c0 has joined #home-manager
mexisme_ has joined #home-manager
mexisme has quit [Ping timeout: 246 seconds]
__monty__ has quit [Quit: leaving]
dtz has quit [Ping timeout: 246 seconds]
hmpffff_ has quit [Ping timeout: 260 seconds]