[ASK] Developing F# Web App (Fullstack) on NixOS

Hi,

I am a NixOS user which want to try my luck to learn F# and build a full-stack web app using this language. I have looked into the SAFE stack and try it on my nixos. However, I need some enlightenment about how to build derivation for easy deployment (as this is one of the advantages of NixOS IMO).

What I already found so far in nixpkgs still confused me. Below are the links that I read:

  1. Getting the dotnet cli (perhaps?) or sdk + cli
  2. how to build a dotnet package

Yet I can’t find some simple derivation on how to build F# project using those tools. Hence, I would like to get some information (maybe pointers) on how to do F# development the right way if I choose to develop it in NixOS.

  1. About the dotnet, how to choose compiler that will be used and local package? I notice in the documentation, we can have nuget.config. Is there any other way?
  2. I notice when building one NuGet package using dotnetPackages, I see there are some .dll files and other extension. Should I include all of those file? or just the .dll file?

Thank you.

disclaimer: I have installed dotnet cli and try it in one of a sample project and it works nicely, but I never see any project that being built using nix-build.

1 Like

I also found another link:

  1. list of dotnet packages available by default; and
  2. fsharp compiler itself (F# 4.1)

This adds the reference asked in the above question (new user can post 2 links max).

1 Like

Know nothing about Nix, but found this: https://media.ccc.de/v/nixcon2015-10-en-Developing_and_deploying_a_F_MicroService_on_NixOS#t=1560

Maybe my full-build Dockerfile for SAFE could be useful: https://gitlab.com/jindraivanek/fantomas-ui/blob/master/build.Dockerfile. Maybe you can just do docker build inside Nix?

Hi @jindraivanek thank you for the link. I think I have watched the video. One thing that I notice is paket2nix is not developed further.

for the second link, the purpose of developing on NixOS with Nix package manager is also creating docker image, since Nix can directly compile to docker image.

one thing to notice is Nix is different from NixOS.