nix-community / todomvc-nix Goto Github PK
View Code? Open in Web Editor NEWExample on how to nixify a project [maintainer=@Rizary]
Example on how to nixify a project [maintainer=@Rizary]
I am in the middle of working on something similar to this repo. Then I thought it will be nice if I just move all my work into todomvc-nix.
My idea is to add the new Flake system, and GitHub action into the repo so every newcomer to Nix language can use this repo as their starting project.
To add some notes, I see some new posts on using Nix and Bazel together into the project, and some people found it too difficult to integrate it. I am planning to add into this repo, what do you think?
I'm getting this on NixOS stable:
$ nix-build
building '/nix/store/5yikvvp7wclvq9x2i1vfnwwx4il5x0y5-931a0b8be80661902baefb3e7d55403be893e0e6.tar.gz-unpacked.drv'...
while setting up the build environment: executing '/nix/store/czx8vkrb9jdgjyz8qfksh10vrnqa723l-bash-4.4-p23/bin/bash': No such file or directory
builder for '/nix/store/5yikvvp7wclvq9x2i1vfnwwx4il5x0y5-931a0b8be80661902baefb3e7d55403be893e0e6.tar.gz-unpacked.drv' failed with exit code 1
error: build of '/nix/store/5yikvvp7wclvq9x2i1vfnwwx4il5x0y5-931a0b8be80661902baefb3e7d55403be893e0e6.tar.gz-unpacked.drv' failed
Trying to follow the Readme.md
:
% git clone https://github.com/nix-community/todomvc-nix
Cloning into 'todomvc-nix'...
remote: Enumerating objects: 1165, done.
remote: Counting objects: 100% (763/763), done.
remote: Compressing objects: 100% (426/426), done.
remote: Total 1165 (delta 341), reused 649 (delta 250), pack-reused 402
Receiving objects: 100% (1165/1165), 9.83 MiB | 2.42 MiB/s, done.
Resolving deltas: 100% (516/516), done.
sloth% cd todomvc-nix
sloth% nix develop
error: flake 'git+file:///Users/dap/proj/todomvc-nix' does not provide attribute 'devShells.x86_64-darwin.default', 'devShell.x86_64-darwin', 'packages.x86_64-darwin.default' or 'defaultPackage.x86_64-darwin'
Did you mean devShell
System info:
System Version: macOS 12.3 (21E230)
Kernel Version: Darwin 21.4.0
Boot Volume: Macintosh HD
Boot Mode: Normal
...
Secure Virtual Memory: Enabled
System Integrity Protection: Enabled
Time since boot: 9 days 7:22
% nix --version
nix (Nix) 2.7.0
I get the following warning when running nix develop
:
error: hash mismatch in fixed-output derivation '/nix/store/c7zzc9z2qn2958y9xb2cq2k9z9lpcyb7-channel-rust-stable.toml.drv':
specified: sha256-+EFKtTDUlFY0aUXdSvrz7tAhf5/GsqyVOp8skXGTEJM=
got: sha256-MJyH6FPVI7diJql9d+pifu5aoqejvvXyJ+6WSJDWaIA=
After updating nix/rust-backend/default.nix as well as Cargo.lock, running nix build .#nix.rustBackend
fails with
error[E0277]: the trait bound `std::string::String: log::kv::value::ToValue` is not satisfied
--> /build/rust-backend-0.1.0-vendor.tar.gz/tide/src/log/middleware.rs:43:9
|
43 | / log::info!("<-- Request received", {
44 | | method: method,
45 | | path: path,
46 | | });
| |___________^ the trait `log::kv::value::ToValue` is not implemented for `std::string::String`
|
= note: required for the cast to the object type `dyn log::kv::value::ToValue`
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
Here's a branch that has the updates I ran.
I ran nix develop
and got the following message:
error: --- Error ---------------------------------------------------------------------------------------------------------------------------- nix
hash mismatch in fixed-output derivation '/nix/store/5pb8dycgqsrspqg7kpdsp0fchnb5f9d6-channel-rust-stable.toml.drv':
specified: sha256-7zt+rHZxx+ha4P/UnT2aNIuBtjPkejVI2PycAt+Apiw=
got: sha256-KCh2UBGtdlBJ/4UOqZlxUtcyefv7MH1neoVNV4z0nWs=
(use '--show-trace' to show detailed location information)
I'm running NixOS 20.09 with flake support enabled.
On this branch, I updated the rust-stable
sha256 since it was old. After doing that, I couldn't build the Rust backend, so I tried cargo update
, but still couldn't build. I ran nix flake update
hoping that would improve the situation, but no dice. After doing all of this, here's what happens when I try to build the backend:
Compiling tide v0.13.0
Compiling sqlx-macros v0.3.5
error[E0277]: the trait bound `std::string::String: log::kv::value::ToValue` is not satisfied
--> /build/rust-backend-0.1.0-vendor.tar.gz/tide/src/log/middleware.rs:43:9
|
43 | / log::info!("<-- Request received", {
44 | | method: method,
45 | | path: path,
46 | | });
| |___________^ the trait `log::kv::value::ToValue` is not implemented for `std::string::String`
|
= note: required for the cast to the object type `dyn log::kv::value::ToValue`
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
I'm not knowledgeable with Rust, so I'm not sure how to handle this.
This repo is the first repo that I use as an example when learning how to package Haskell backend. It would be nice if I can add Rust and Golang into the backend.
In the frontend side, I would like to add Typescript, or Svelte.
Is it to change the gid/uid nginx is run as to match nix?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.