Every Nix derivation produces a Nix store output that has 3 things:
- Executables
- Libraries
- Data
Executables are always exported using the PATH
environment variable. This is pretty much automatic.
int main(int argc, char **argv) { | |
struct SoundIo *soundio = soundio_create(); | |
if (!soundio) { | |
fprintf(stderr, "out of memory\n"); | |
return 1; | |
} | |
int err; | |
if ((err = soundio_connect(soundio))) { | |
fprintf(stderr, "unable to connect: %s\n", soundio_strerror(err)); | |
soundio_destroy(soundio); |
##################################################################################################### | |
# 2019-01-15 Initial Creation | |
# 2019-04-01 Added ReSharper Settings | |
# 2019-05-16 Naming Rules Work With ReSharper | |
# 2019-07-09 Constant and Static Readonly Naming Rules | |
# 2022-09-16 New Settings for Visual Studio 2022 | |
##################################################################################################### | |
# Based off of generic config from https://github.com/RehanSaeed/EditorConfig | |
# License MIT - https://github.com/RehanSaeed/EditorConfig/blob/master/LICENSE | |
# |
This documentation describes potential implementation of Type Classes and Shapes features in Roslyn compiler.
Goals:
module EnvDemo | |
open System | |
open System.IO | |
[<Struct>] | |
type Nothing = | |
private | |
| Nothing |
using System; | |
class Program | |
{ | |
// M wants to get an instance via Func | |
static void M(Func<string> factory) | |
{ | |
Console.WriteLine(factory()); | |
} |
Some applications requires contacting HTTPS endpoints. In those cases you need to supply the CA certificates.
Most Nix applications won't package in the CA certificates, this is because they can make use of the OS provided CA certificate store.
The NixOS location for this is at: /etc/ssl/certs
.
The OpenSSL library in Nixpkgs is compiled to use that path if there is no environment variables such as SSL_CERT_FILE
.
<# | |
.Synopsis | |
Exports environment variable from the .env file to the current process. | |
.Description | |
This function looks for .env file in the current directoty, if present | |
it loads the environment variable mentioned in the file to the current process. | |
based on https://github.com/rajivharris/Set-PsEnv |
let race (a:Async<'a>) (b:Async<'a>) : Async<'a * Async<'a>> = async { | |
return! | |
Async.FromContinuations <| fun (ok,err,cnc) -> | |
let state = ref 0 | |
let iv = new TaskCompletionSource<_>() | |
let ok a = | |
if (Interlocked.CompareExchange(state, 1, 0) = 0) then | |
ok (a, iv.Task |> Async.AwaitTask) | |
else | |
iv.SetResult a |