21
submitted 2 weeks ago by F04118F@feddit.nl to c/nix@programming.dev

Recently got started with Nix and Home-Manager. I thought Advent Of Code would be a good way to get more comfortable with the Nix language.

I don't think I ever made it beyond Day 6 though, even in my most comfortable language (Python) so no idea where this will strand.

I am learning a lot about Nix though!

Have you used the Nix language outside of configuration? Let's share and discuss!

you are viewing a single comment's thread
view the rest of the comments
[-] gavin@fosstodon.org 2 points 2 weeks ago* (last edited 2 weeks ago)

@F04118F

If I can make the time, I will. But I know @ellyse is doing it. ๐ŸŽ… ๐Ÿ‘ฉโ€๐Ÿ’ป
She did one last night live on stream.

https://ohai.social/@ellyse/113482901348671949

[-] ellyse@ohai.social 1 points 2 weeks ago

@gavin @F04118F yup! thats a link to a 2019 AoC, but here's my video for day 1 this year https://www.youtube.com/live/P_3rUzAN0vw?si=W0qxiwKeDHVN_2aQ
the code is here: https://github.com/ellyxir/advent_of_code/tree/main/2024/nix/day01

i looked at your solution, good work!

[-] F04118F@feddit.nl 1 points 2 weeks ago* (last edited 2 weeks ago)

Your code looks awesome, I'm definitely going to steal some ideas from that, especially the lib.pipe really cleans up a lot of unnecessary bindings I did.

Doing a with import ./utils.nix is also a lot cleaner than nesting let statements.

[-] kintrix@linux.community 3 points 2 weeks ago* (last edited 2 weeks ago)

You can also use the pipe operators; but they are still experimental features.

foo (bar (baz x)) = x |> baz |> bar |> foo = foo <| bar <| baz <| x

load more comments (6 replies)
load more comments (9 replies)
load more comments (9 replies)
this post was submitted on 02 Dec 2024
21 points (100.0% liked)

Nix / NixOS

1819 readers
1 users here now

Main links

Videos

founded 2 years ago
MODERATORS