<pi3r>
So how can I possibly prevent the hardcoding of the user home ?
pi3r has quit [Quit: Leaving]
mexisme has quit [Ping timeout: 268 seconds]
evelyn has quit [Quit: WeeChat 1.6]
mexisme has joined #home-manager
andi- has quit [Remote host closed the connection]
greizgh has quit [Quit: greizgh]
greizgh has joined #home-manager
andi- has joined #home-manager
maralorn has quit [Quit: WeeChat 2.6]
maralorn has joined #home-manager
mexisme has quit [Ping timeout: 240 seconds]
mexisme has joined #home-manager
mexisme has quit [Ping timeout: 240 seconds]
mexisme has joined #home-manager
mexisme has quit [Ping timeout: 276 seconds]
hmpffff has joined #home-manager
pi3r has joined #home-manager
__monty__ has joined #home-manager
mexisme has joined #home-manager
mexisme has quit [Quit: WeeChat 2.6]
<pi3r>
FWIW this problem is not related to the home-manager at all ... Just the crazy way paths are handled in nix ... Basically I need ./ the root path literal
<pi3r>
Coupled with the fact that toPath does not return a path this has been quite a confusing journey ;-)
<rycee>
pi3r: Hey. Ah yeah.
<rycee>
The builtins.path command sometimes is helpful.
<{^_^}>
#890 (by PierreR, 1 day ago, open): Q? : Eclipse with egit & m2e included
<rycee>
Unfortuntely no. When I used Eclipse I installed m2e through Eclipse.
<rycee>
It seemed tricky to package m2e and a few other plugins so I gave up on those.
<rycee>
So I always installed m2e and the marketplace plugins + some from the marketplace manually.
<pi3r>
Good to know thanks. I do the same with the eclipse cli but that's not better.
<rycee>
Unfortunately the plugin package situation for Eclipse is tricky. I never figured out the best way to do it for more complicated plugins.
<rycee>
Now I just use Emacs with lsp-java :-)
evelyn_ has joined #home-manager
hmpffff has quit [Quit: nchrrrr…]
hmpffff has joined #home-manager
hmpffff has quit [Client Quit]
hmpffff has joined #home-manager
hmpffff has quit [Quit: nchrrrr…]
hmpffff has joined #home-manager
hmpffff has quit [Client Quit]
pi3r has quit [Quit: Leaving]
hmpffff has joined #home-manager
hmpffff has quit [Quit: nchrrrr…]
hmpffff has joined #home-manager
hmpffff has quit [Client Quit]
hmpffff has joined #home-manager
hmpffff has quit [Quit: nchrrrr…]
Synthetica has joined #home-manager
thomashoneyman has joined #home-manager
<thomashoneyman>
hey folks! i'm using `jrnl` and i'd like to control an arbitrary file in my home directory with home-manager
<thomashoneyman>
i was looking at the home-manager documentation but I didn't see anything specific to this
<thomashoneyman>
any advice on where to look to do this?
<thomashoneyman>
the idea would be to write a .jrnl_config file with json, making the file read-only and only written by home-manager
<__monty__>
there's a files attribute or something. Search appendix A.
<thomashoneyman>
oh, perfect, under home.file you can control a list of files in the home directory
<thomashoneyman>
including home.file.<name?>.target for the path and home.file.<name?>.text for the contents
<thomashoneyman>
thanks!
<rycee>
thomashoneyman: You can use the `home.file` option but it will create a symlink. If you require a real file then you'll have to do that using a custom activation block.
<rycee>
thomashoneyman: You can omit the target option if you set `name` to the path.
<thomashoneyman>
as in i can have a file in ~/Documents/something.txt and have home-manager symlink it to ~/.something.txt?
<thomashoneyman>
what i'd like to do is have home-manager _write_ the file
<thomashoneyman>
i'm not sure what custom activation blocks are; i'll look that up
<thomashoneyman>
rycee: mind explaining briefly what 'custom activation block' refers to?
<__monty__>
They're a way to run arbitrary shell commands basically.
<__monty__>
There's different boundaries that determine when the commands are run.
<__monty__>
Make sure the commands are idempotent though. I've managed to nest symlinks this way and it can get confusing : )
<rycee>
The home.file option always copies the file to the Nix store. So if you want to avoid that you need an activation block like monty showed.
thomashoneyman has quit [Ping timeout: 240 seconds]
<rycee>
Hehe, yeah I recognize that :-)
thomashoneyman has joined #home-manager
<thomashoneyman>
i see; i'd want to write the file in the activation block, and perhaps symlink with home.file after?
<thomashoneyman>
to restate the original goal: i'd like home-manager to entirely control a file, ~/.jrnl_config, meaning that `home-manager switch` writes the file and it is read-only after that
<thomashoneyman>
i'll go ahead and try with the custom activation block alone
<thomashoneyman>
but i am perfectly happy for the file to simply get written into the nix store and not exist anywhere else
<rycee>
Yeah, if at all possible it is best to use `home.file`, e.g, `home.file.".jrnl_config".text = "foo";`.
<rycee>
Phew, tricky to write code on the phone keyboard :-)
<thomashoneyman>
oh, i misunderstood what you meant by the symlink
<thomashoneyman>
i thought you were saying that home.file relied on there already being a real file
<thomashoneyman>
thanks for attempting to write code from your phone -- i know it's tough!
<rycee>
Ah, no. I meant that the target will be a symlink into the Nix store.
<rycee>
I'm drinking beer as well so I'm doubly handicapped :-D
<__monty__>
Past the Balmer peak?
<thomashoneyman>
it's noon where i live, so i too am drinking a beer
<thomashoneyman>
but i'm also eating Mexican food, so I feel like it's acceptable
<rycee>
monty: Something like that :-)
<thomashoneyman>
sweet! working just fine.
<thomashoneyman>
thanks for the help. now to attempt to get dropdox working as a systemd service via home-manager...
<__monty__>
👍
<__monty__>
Not too hard. Especially if you already have a service file to translate.
<__monty__>
Do note though that the service would run under `systemctl --user`.
<__monty__>
So you have to pass that flag whenever you want to control it.
<thomashoneyman>
for now i'm researching systemd, as i've been a MacOS user my whole life up until installing NixOS this summer
<__monty__>
It's actually kinda similar to launchctl. Might've been inspired by even iirc.
<thomashoneyman>
there are some home-manager modules which manage systemd services, right?
<thomashoneyman>
i'm browsing through for a good, similar example to dropbox
<thomashoneyman>
monty: never used launchctl!
<thomashoneyman>
i work as a UI developer using PureScript, so a lot of this stuff is new
<__monty__>
Launchctl's the worst you have to write everything in this poorly documented xml.
<__monty__>
Not that systemd's so much better documented : >
<thomashoneyman>
i know enough to consider writing xml hellish
<__monty__>
PS, nice!
<thomashoneyman>
(most of the time)
<thomashoneyman>
i'd also like to write some kind of service which checks for updates to my dotfiles and automatically pushes changes to github
<thomashoneyman>
maybe that's just a cron thing
<__monty__>
Systemd replaces cron. Look into systemd timers.
<__monty__>
That's actually a serious improvement imo.
<thomashoneyman>
ah! excellent. thanks for the pointers.
<thomashoneyman>
i'm just googling around for systemd, but if you know of any particularly helpful resources i'd love links
<thomashoneyman>
^ that link actually has a service description, but there is no timer. am i to understand that this will only sync on systemd startup?
<thomashoneyman>
there's only ExecStart
<thomashoneyman>
i'm putting together a service in home.nix which i can upstream
<__monty__>
It depends on the before, after, wantedby, etc. clauses.
<thomashoneyman>
Should I be worried about seeing this message after 'home-manager switch': "User systemd daemon not running. Skipping reload."
<thomashoneyman>
thanks for the timer link. on review it looks like Dropbox might handle triggering sync on its own
<rycee>
thomashoneyman: Home Manager is a bit dumb about reloading the systemd units. If some user systemd using has failed then HM fails to notice it running.
<rycee>
Basically if `systemctl --user status` says a state different from "running".
<thomashoneyman>
hmm
<thomashoneyman>
`systemctl --user status` is running
<thomashoneyman>
*displays 'running', that is
<rycee>
thomashoneyman: Hmm, and `systemctl --user is-system-running`
<thomashoneyman>
i have in .config/systemd/ the file dropbox.service, yet 'systemctl start dropbox.service' returns a 'service not found'
<thomashoneyman>
added that in and it's in the file
<thomashoneyman>
i still get the 'User systemd daemon not running' after home-manager switch
<thomashoneyman>
and i don't see dropbox in the services with `systemctl`
<thomashoneyman>
hmmm
<rycee>
Is it shown when you run `systemctl --user list-unit-files`/
<thomashoneyman>
i can manually run the executable
<thomashoneyman>
one sec
<rycee>
* Is it shown when you run `systemctl --user list-unit-files`?
<thomashoneyman>
yes, it is listed
<thomashoneyman>
with state 'enabled'
<rycee>
Then you probably should be able to start it with `systemctl --user start dropbox.service`
<thomashoneyman>
yes, that worked
<thomashoneyman>
hmmm
hmpffff has joined #home-manager
<thomashoneyman>
thanks, rycee, it's running
<thomashoneyman>
though it's a bit worrying to run that command manually
<thomashoneyman>
vs. it automatically starting up, but i might be missing something
<thomashoneyman>
ouch: need to get a newer version for it to function, too.
<thomashoneyman>
off to the rabbit hole
<rycee>
Oh and you need to set `systemd.user.startServices = true;` to make HM start and stop services.
<rycee>
Otherwise it will just write suggested systemctl commands to run.
<rycee>
But the "User systemd daemon not running. Skipping reload." means that the `XDG_RUNTIME_DIR=${XDG_RUNTIME_DIR:-/run/user/$(id -u)} systemctl --user is-system-running` command returns with an error when HM tries to run it.
<thomashoneyman>
strange. running that command manually returns 'running'
<rycee>
Yeah, it seems a bit odd. Are you using the `home-manager switch` or managing your user from the system configuration?
<thomashoneyman>
i'm using 'home-manager switch' on the command line
<thomashoneyman>
hmm
<thomashoneyman>
i've got 'programs.home-manager.enable = true' set
<thomashoneyman>
my user account is defined in configuration.nix
<rycee>
thomashoneyman: Yeah, but you aren't using the `home-manager.users` option in the system configuration.
<thomashoneyman>
no, i am not
<thomashoneyman>
i don't think i saw that in the readme / manual
<thomashoneyman>
looking for it now
<rycee>
thomashoneyman: Could you try logging out and logging back in? To see if that fixes the `home-manager switch` error message.
<thomashoneyman>
nope: logging out and logging in still says 'user systemd daemon not running'
<dtz>
if something fails like a random user service (perhaps a sync/timer-based service that handle failure or net issues gracefully aka as a success) then 'systemctl status --user' will report 'degraded' and home-manager checks that before trying to switch
<rycee>
dtz: The curious thing is that his systemd says "running", not degraded and `systemctl --user is-system-running` also reports running.
<rycee>
But for some reason when HM runs the same command it must be getting an error.
<dtz>
D: oh sorry if missed some context. That IS strange.
<rycee>
And apparently a relog didn't fix it.
<rycee>
Hmm, perhaps the systemd started by PAM is not compatible with the systemctl command that ends up being used in the activation script?
<rycee>
thomashoneyman: Perhaps could try adding something like this to your `home.nix`:
<__monty__>
It's not recommended anyway, but something that's good to know.
<thomashoneyman>
i don't use nix-env, fortunately
<thomashoneyman>
i see; under root, i see:
<rycee>
If you are running NixOS then nixos-unstable is better than nixpkgs-unstable since I believe it make sure some critical system tests pass before the channel is updated.
<thomashoneyman>
currently dowrloading a ton of stuff
<thomashoneyman>
but i'll let you know if it works
<thomashoneyman>
rycee: __monty__: thanks for all your help, by the way
<thomashoneyman>
i'm sorry to be requiring so much of it!
<rycee>
Yeah, I imagine you are still actually running 19.03 on your system…
<rycee>
And are now updating to 19.09.
<__monty__>
Np, but rycee's definitely doing the heavy lifting ; )
<rycee>
No worries. It was a interesting problem you run into :-)
<thomashoneyman>
still building...
<thomashoneyman>
hah! no way!
<thomashoneyman>
"Failed to query system state: Access denied"
<thomashoneyman>
typical software bug
<thomashoneyman>
*issue
<thomashoneyman>
never where you think
<thomashoneyman>
interesting
<thomashoneyman>
still 19.03 in channels
<thomashoneyman>
maybe i need to manually delete them?
<rycee>
PID 1 is probably still having systemd 239
<thomashoneyman>
i did --remove and .nix-channels for my user is blank, but i still have a /channels directory containing 19.03
<thomashoneyman>
one sec, i'll log out and log in again
thomashoneyman has quit [Quit: Lost terminal]
<rycee>
Did you do a `nixos-rebuild switch`?
<__monty__>
They're not here rn.
thomasho1eyman has joined #home-manager
<thomasho1eyman>
lol i suppose i'm thomasho1eyman according to irssi now
<__monty__>
thomasho1eyman: PID 1 won't get replaced unless you reboot.
<__monty__>
Oh, and rycee asked whether you `nixos-rebuild switch`ed while you were gone.
<__monty__>
nn, peoples
__monty__ has quit [Quit: leaving]
<rycee>
See ya __monty__ :-)
<rycee>
thomasho1eyman: Yeah, if you now updated the system from 19.03 to 19.09 then you'll need to reboot as well to replace systemd running as PID 1.