taskwarrior: make .taskrc writable (attempt nr. 2)#2761
taskwarrior: make .taskrc writable (attempt nr. 2)#2761berbiche merged 3 commits intonix-community:masterfrom
Conversation
|
Made this as draft, since I can't get the formatter or tests to work =/ Not sure how to proceed (as in what I need to read/understand to make the tests/formatter work). |
|
Un-doing the draft status so as to let tests run... |
berbiche
left a comment
There was a problem hiding this comment.
Thanks for continuing the previous efforts!
The script needs to be fixed because of how the shell parses redirection operators > and other symbols.
|
Thanks to @berbiche's edit suggestion, The tests still don't run though, and with the same error =/ |
|
I can also report that the documentation's recommended Anyone got any tips for what I'm missing/need to understand/write? |
|
I have spent quite some time (fruitlessly) looking at previous "editable" issues and the official documentation, and I'm no closer to understanding what to read/learn so as to figure out the next step for this PR. This is my current state [1]1: No change wrt. this either. |
berbiche
left a comment
There was a problem hiding this comment.
Sorry, I have been busy.
I left a comment that should hopefully fix the issue.
4916021 to
57ad817
Compare
berbiche
left a comment
There was a problem hiding this comment.
Left additional comments.
I think this PR will be good to merge after these last fixes.
No worries, completely understandable =) Thanks for all your time and efforts spent on this so far! Just before your latest proposed changes/comments (good ones too, thanks!), I think I got it to work (locally) for me on my computer/setup! Yell at me once it's visible if you want it moved out of this PR =)
Unfortunately, it's still not passing the tests =/ I extracted the HM activation script from the latest commit, and below are the relevant lines generated in the "resulting" Relevant lines#!/nix/store/2kh3c4v2vf6d6xg6c9n8zvfpwf3zzwca-bash-5.1-p12/bin/bash
set -eu
set -o pipefail
cd $HOME
export PATH="/nix/store/2kh3c4v2vf6d6xg6c9n8zvfpwf3zzwca-bash-5.1-p12/bin:/nix/store/vizjhz04x6xl57x2vrpqa52j8q6rkjfh-coreutils-9.0/bin:/nix/store/wa9x5983qing9gifsaf0iln4fcjxssxs-diffutils-3.8/bin:/nix/store/y7iizrf51pgi8vjhiwndajz4ihwm416f-findutils-4.8.0/bin:/nix/store/dgfsb2gr8z7c7fncw7w8igqgskisksgf-gettext-0.21/bin:/nix/store/s6sb3m2312hjw78zg5gyjpky5w0z1cgw-gnugrep-3.7/bin:/nix/store/rg7bpxyqipjgxfc6q5h7p1yrnsgaypsk-gnused-4.8/bin:/nix/store/y332ks5b6xbihvhchs84lq36na9bf4rf-ncurses-6.3/bin${PATH:+:}$PATH"
export TEXTDOMAIN=hm-modules
export TEXTDOMAINDIR=/nix/store/7kj4cymd9jxzwjls0hs0dfbl7v8r6crm-hm-modules-messages
source /nix/store/xc42m2j2znv5n2px2fhy0phgraldhlbc-home-manager.sh
#!/usr/bin/env bash
# snip...
_iNote "Activating %s" "regenDotTaskRc"
$VERBOSE_ECHO "Ensuring generated taskwarrior config included in taskrc"
# Ensure file's existence
if [[ ! -s "/home/hm-user/.config/task/taskrc" ]]; then
if [[ -v DRY_RUN ]]; then
$DRY_RUN_CMD echo "include /home/hm-user/.config/task/home-manager-taskrc" ">" "/home/hm-user/.config/task/taskrc"
else
echo "include /home/hm-user/.config/task/home-manager-taskrc" > "/home/hm-user/.config/task/taskrc"
fi
fi
# Add include statement for home-manager generated config
if ! /nix/store/s6sb3m2312hjw78zg5gyjpky5w0z1cgw-gnugrep-3.7/bin/grep -qF "include /home/hm-user/.config/task/home-manager-taskrc" /home/hm-user/.config/task/taskrc; then
if [[ -v DRY_RUN ]]; then
$DRY_RUN_CMD /nix/store/rg7bpxyqipjgxfc6q5h7p1yrnsgaypsk-gnused-4.8/bin/sed -i '1i include /home/hm-user/.config/task/home-manager-taskrc' /home/hm-user/.config/task/taskrc
else
/nix/store/rg7bpxyqipjgxfc6q5h7p1yrnsgaypsk-gnused-4.8/bin/sed -i '1i include /home/hm-user/.config/task/home-manager-taskrc' /home/hm-user/.config/task/taskrc
fi
fi
_iNote "Activating %s" "reloadSystemd"
# snip...It's specifically the lines referencing EDIT: Clarify/improve readability |
|
@x10an14 hi, if you could try the module on your machine it would be nice! The standard test environment does not test activation scripts so the last part of the test had to be dropped. |
279ddae to
5c59b02
Compare
Ahh, okay! Thanks for confirming that for me, I've been stuck on that for almost a month now x)
Can confirm, with latest squashed&force-pushed commit, it works on my machine =) |
This is achieved by generating the Home Manager configuration file as `~/.config/task/home-manager-taskrc`, and including that file into ~/.config/task/taskrc. Fixes nix-community#2360 Co-authored-by: Nicolas Berbiche <nic.berbiche@gmail.com> Co-authored-by: @x10an14 <x10an14@users.noreply.github.com>
5c59b02 to
0f1c437
Compare
|
Rebased on top of master |
|
In my opinion / understanding (both of which might be lacking) I believe this PR is "complete" as in ready to merge. Starting to feel a little burnt out on this, so I hope someone else can pick this up now if there's more that should be done. I might have some more capacity in me, but I'm a little fed up with the steep learnong-curve/reverse engineering required for someone with my (in)competence level. If someone wants to ask more of me here, hope its okay to request unambiguous instructions&rationale (and maybe also shorter feedback loop - if possible). |
|
Hi again, Thanks again for your efforts 😃. |
This is achieved by generating the Home Manager configuration file as `~/.config/task/home-manager-taskrc`, and including that file into ~/.config/task/taskrc. Fixes nix-community#2360 Co-authored-by: mainrs <5113257+mainrs@users.noreply.github.com> Co-authored-by: Nicolas Berbiche <nicolas@normie.dev>
This is achieved by generating the Home Manager configuration file as `~/.config/task/home-manager-taskrc`, and including that file into ~/.config/task/taskrc. Fixes nix-community#2360 Co-authored-by: mainrs <5113257+mainrs@users.noreply.github.com> Co-authored-by: Nicolas Berbiche <nicolas@normie.dev>
This is an updated duplicate of #2697, where I attempted to fix/add tests too.
Description
$HOME/.config/taskrcwriteable for users, so as to e.g. allowtask contextcommands.Checklist
Change is backwards compatible.
Code formatted with
./format.Code tested through
nix-shell --pure tests -A run.all.Test cases updated/added. See example.
Commit messages are formatted like
See CONTRIBUTING for more information and recent commit messages for examples.
If this PR adds a new module
Added myself as module maintainer. See example.
Added myself and the module files to
.github/CODEOWNERS.