Open pmiddend opened 4 years ago
Good question! Since I'm still learning both Reflex and Nix, I still don't know exactly how people usually structure such projects.
My guess is that one could organize the frontend and backend in folders like:
├── backend
│ └── src
└── frontend
└── src
And then modify default.nix
to something like:
{ pkgs ? import <nixpkgs> {}
, reflex-platform ? import ./nix/reflex-platform.nix
, compiler ? "ghcjs"
}:
reflex-platform.project (_: {
withHoogle = false;
useWarp = true;
packages = {
backend = ./backend;
frontend = ./frontend;
};
shells = {
ghc = [
"backend"
"frontend"
];
ghcjs = [
"backend"
"frontend"
];
};
})
But I'm not sure what to do with the compiler
argument. Perhaps override that in a default.nix
inside ./backend
?
Once I get more acquainted with both Nix and Reflex, I'll probably update this template with my findings.
Thanks for the idea!
Not sure how to solve this, but I got the idea from:
https://github.com/ElvishJerricco/reflex-project-skeleton
I think it'd be very desirable. Using Haskell "full-stack" (or any language, for that matter) sounds pretty enticing. :)
Could this be easily extended?