Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🫣 mommy finds your config with an environment variable now~ +nixos #61

Merged
merged 4 commits into from
Aug 28, 2023

Conversation

ckiee
Copy link
Contributor

@ckiee ckiee commented Aug 18, 2023

i taught mommy this with a js regex: /(MOMMY_[\w_]+)=("[\s\S]*?")/, replaced matches w $1=${$1:-$2}\n on regexr

mommy will usually use her default settings~


i am bringing mommy on a field trip to nixpkgs (home of nixos), she is on flight number NixOS/nixpkgs#250034.


edit: i just noticed mommy already reads a config file in your home, i think it would be good if MOMMY_OPT_CONFIG_FILE was an env var instead

@ckiee ckiee force-pushed the mommy-supports-environment-variables branch from f5db850 to d578552 Compare August 18, 2023 20:50
@ckiee ckiee changed the title 🫣 mommy listens to your environment variables now~ 🫣 mommy finds your config with an environment variable now~ Aug 18, 2023
@ckiee
Copy link
Contributor Author

ckiee commented Aug 19, 2023

she is off her flight and has arrived at nixos now

@FWDekker FWDekker self-assigned this Aug 21, 2023
@FWDekker FWDekker added the enhancement Improvement of existing feature label Aug 21, 2023
@FWDekker
Copy link
Owner

netbsd appears to not be working, but probably because something's wrong with the vm / script. i'll try to debug it locally, not sure how long that will take

@FWDekker
Copy link
Owner

FWDekker commented Aug 21, 2023

i think (hope) the issues have been fixed, time will tell. (edit: time did tell, they're fixed!)

btw, thank you very much for opening this issue, and for taking mommy on a trip to nixos! she's very excited to go there! let me know if there are any issues you encounter or troubles you have. i don't have a lot of time on my hands at all right now, but i will do my best ^^

btw, are there any special installation instructions users should be aware of for nixos? would be great if you could add those to the readme! and would you mind rebasing your pr onto the dev branch? i'll make sure to change the default branch soon so that future PRs will go into the correct branch (edit: default branch for future prs is now dev, though yours is still targeting main) :)

@ckiee ckiee changed the base branch from main to dev August 21, 2023 22:14
@ckiee ckiee force-pushed the mommy-supports-environment-variables branch from 71806bc to bbc4021 Compare August 21, 2023 22:15
@ckiee
Copy link
Contributor Author

ckiee commented Aug 21, 2023

rebasing breaks git atm, presumably because of:

warning: in the working copy of '.github/img/demo.gif', CRLF will be replaced by LF the next time Git touches it
warning: in the working copy of '.github/img/sample1.png', CRLF will be replaced by LF the next time Git touches it
warning: in the working copy of '.github/img/sample2.png', CRLF will be replaced by LF the next time Git touches it

so mommy has now taught git how to not make a mess (:

also rebased

@ckiee
Copy link
Contributor Author

ckiee commented Aug 21, 2023

btw, are there any special installation instructions users should be aware of for nixos?

yes! the nix package uses this PR to let creatures configure mommy from within nix-the-language:

pkgs.mommy.override {
  mommySettings.sweetie = "catgirl";
}

the catch is, nix is a vast ecosystem with a lot of "distros" (NixOS, nix-darwin, NixOS-WSL, home-manager, standalone nix (bold means it's a common starting point)) and it's very difficult to write widely-applicable instructions that are succinct and don't assume user knowledge.

i'm not sure when, but i'll eventually try to PR something that works Well Enough 💜

@FWDekker
Copy link
Owner

FWDekker commented Aug 22, 2023

so mommy has now taught git how to not make a mess (:

very nice! i wasn't aware that you could combine text=auto and eol=lf like that. if you're on it anyway, could you maybe change the .gitattributes to the singular line * text=auto eol=lf? pretty sure it's the same, but shorter.

it's very difficult to write widely-applicable instructions that are succinct and don't assume user knowledge

i see. i still think it would be valuable to add it to the readme so that others know that release channel exists. now, i'm absolutely not familiar with nixos (and regret to say i don't have time to delve much deeper) but i just read up on it a little bit. what do you think of adding a subsection "nix/nixos" (include both, so people don't confuse it with "*nix") in the readme under "with a package manager" in which you add a list item "nixpkgs (automatic or manual updates)" where you say something like

to try out mommy from nixpkgs, run

nix-shell -p mommy

for other installation options and configuration instructions, check nixpkgs~

(you can mommy-ify the use of language if you want, of course)

from my understanding, this allows us to show off your work of having a package on nixpkgs ✨, allows users to quickly try out mommy without configuration and without permanent side effects, and still links users to the more advanced information if they want it. what do you think?

i'm not sure when, but i'll eventually try to PR something that works Well Enough 💜

what do you mean? don't you think it currently works well enough? ^^'

@ckiee ckiee force-pushed the mommy-supports-environment-variables branch 7 times, most recently from fc31d34 to c107dec Compare August 26, 2023 14:57
@ckiee
Copy link
Contributor Author

ckiee commented Aug 26, 2023

so mommy has now taught git how to not make a mess (:

very nice! i wasn't aware that you could combine text=auto and eol=lf like that. if you're on it anyway, could you maybe change the .gitattributes to the singular line * text=auto eol=lf? pretty sure it's the same, but shorter.

done! :3

from my understanding, this allows us to show off your work of having a package on nixpkgs ✨, allows users to quickly try out mommy without configuration and without permanent side effects, and still links users to the more advanced information if they want it. what do you think?

yes! but the instructions there (or anywhere else i could think of) weren't very useful, so i wrote my own. we also added CI because i wanted to add to the "mommy is tested on " line :P

the ci seems to work too, (netbsd fails tho!) but it's a bit scary because the output doesn't seem to be displayed, but running it locally shows it is running mommy's tests inside nix, so it should be fine.

i'm not sure when, but i'll eventually try to PR something that works Well Enough 💜

what do you mean? don't you think it currently works well enough? ^^'

i was referring to the missing docs, and now they are good too~

cya again soon!

Copy link
Owner

@FWDekker FWDekker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'm happy. just have a few questions so i understand this correctly so that i don't break things in the future :-) (...and one minor change request)

cya again soon!

👋

README.md Show resolved Hide resolved
.gitattributes Show resolved Hide resolved
src/main/sh/mommy Outdated Show resolved Hide resolved
.github/workflows/ci.yml Show resolved Hide resolved
git was getting confused and trying to run some CRLF conversion, so we,
as i understand, allow it to guess whether a file is binary or text.

https://stackoverflow.com/a/46592252
…G basedir)

xdg: it is very important mommy can find her girl's instructions even when
     they are scribbled down in an unusual place!

     https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
@ckiee ckiee force-pushed the mommy-supports-environment-variables branch from c107dec to efceb22 Compare August 27, 2023 21:04
@ckiee ckiee changed the title 🫣 mommy finds your config with an environment variable now~ 🫣 mommy finds your config with an environment variable now~ +nixos Aug 27, 2023
@FWDekker FWDekker added the packaging Packaging and distribution of the software label Aug 28, 2023
Copy link
Owner

@FWDekker FWDekker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

awesome! thank you very much for your work! i'll merge this pr now, later today i'll add you to the list of contributors and i'll do a little bit more nitpicking ^^

@FWDekker FWDekker merged commit 0139f00 into FWDekker:dev Aug 28, 2023
@ckiee
Copy link
Contributor Author

ckiee commented Aug 28, 2023

watch out for this little creature!

~: determinatesystems/nix-installer-action@main and determinatesystems/magic-nix-cache-action@main are not allowed to be used in FWDekker/mommy. Actions in this workflow must be: within a repository owned by FWDekker or matching the following: ffurrer2/extract-release-notes@*, softprops/action-gh-release@*, vmactions/*, actions/checkout@*, actions/download-artifact@*, actions/upload-artifact@*, Homebrew/actions/setup-homebrew@*, msys2/setup-msys2@*.

@FWDekker
Copy link
Owner

watch out for this little creature!

yes, i noticed it, and though i allowed the new actions, i was unable to re-run the actions because of the specific type of error, so i'll have to postpone that to the next commit. thanks for the heads up! ^^

@FWDekker
Copy link
Owner

FWDekker commented Nov 7, 2023

hi @ckiee! brief question: i see on the list of nixos packages that mommy is at v1.2.3 (which i believe is secretly the same as v1.2.4 because you included patches), but still makes it look like the package is outdated. does updating mommy on nixpkgs require a pr in nixos/nixpkgs or will the update happen automatically once a new github release for mommy is made?

@ckiee
Copy link
Contributor Author

ckiee commented Nov 7, 2023

hi ^^
it does require a PR, though if you make a release a bot just might come around and open a PR on its own, if there's spare build capacity to test the update and it knows what to do with everything. so that only happens sometimes!

it probably wouldn't work here, because the patches would indeed be conflicting and it doesn't know how to handle that.

just made the pr: NixOS/nixpkgs#266090

@FWDekker
Copy link
Owner

FWDekker commented Nov 7, 2023

thank you!

if the bot doesn't detect future releases i think i'll just use @FWDekkerBot to automatically create prs for nixpkgs in the future. it currently already does that for homebrew and aur anyway~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improvement of existing feature packaging Packaging and distribution of the software
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants