Skip to content

Commit ed090bb

Browse files
committed
Add nix flake
1 parent 6841c9b commit ed090bb

File tree

3 files changed

+151
-1
lines changed

3 files changed

+151
-1
lines changed

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,4 +210,7 @@ dist
210210
.idea
211211
*.fs.js
212212
0.bundle.js
213-
.yarn
213+
.yarn
214+
215+
# Nix
216+
.envrc

flake.lock

Lines changed: 48 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
{
2+
description = "A fresh retake of the React API in Fable, optimized for happiness.";
3+
4+
inputs = {
5+
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
6+
flake-parts = {
7+
url = "github:hercules-ci/flake-parts";
8+
inputs.nixpkgs-lib.follows = "nixpkgs";
9+
};
10+
};
11+
12+
outputs =
13+
inputs@{ self, flake-parts, ... }:
14+
flake-parts.lib.mkFlake { inherit inputs; } {
15+
systems = [
16+
"x86_64-linux"
17+
"aarch64-linux"
18+
];
19+
20+
perSystem =
21+
{
22+
self',
23+
lib,
24+
pkgs,
25+
system,
26+
...
27+
}:
28+
let
29+
permittedPackages = [
30+
"dotnet-core-combined"
31+
"dotnet-wrapped-combined"
32+
"dotnet-combined"
33+
"dotnet-sdk-6.0.428"
34+
"dotnet-sdk-wrapped-6.0.428"
35+
"dotnet-sdk-6.0.136"
36+
];
37+
libPath =
38+
with pkgs;
39+
lib.makeLibraryPath [
40+
glib
41+
nss
42+
nspr
43+
atk
44+
cups
45+
libdrm
46+
dbus
47+
expat
48+
xorg.libX11
49+
xorg.libXcomposite
50+
xorg.libXdamage
51+
xorg.libXext
52+
xorg.libXfixes
53+
xorg.libXrandr
54+
xorg.libxcb
55+
xorg.libxshmfence
56+
libxkbcommon
57+
libxcomp
58+
libgbm
59+
gtk3
60+
pango
61+
cairo
62+
alsa-lib
63+
];
64+
in
65+
{
66+
_module.args.pkgs = import self.inputs.nixpkgs {
67+
inherit system;
68+
config = {
69+
permittedInsecurePackages = permittedPackages;
70+
};
71+
};
72+
devShells.default = pkgs.mkShell {
73+
inputsFrom = builtins.attrValues self'.packages;
74+
env = {
75+
# Will work as soon as PuppeteerSharp is updated on Fable Mocha
76+
# Both are defined at https://pptr.dev/api/puppeteer.chromesettings
77+
PUPPETEER_CHROME_SKIP_DOWNLOAD = true;
78+
PUPPETEER_SKIP_CHROME_DOWNLOAD = true;
79+
PUPPETEER_SKIP_DOWNLOAD = true;
80+
NODE_OPTIONS = "--openssl-legacy-provider";
81+
PUPPETEER_EXECUTABLE_PATH = "${pkgs.chromium}/bin/chromium";
82+
PUPPETEER_BROWSER = "chrome";
83+
};
84+
packages = with pkgs; [
85+
(
86+
with dotnetCorePackages;
87+
combinePackages [
88+
dotnetCorePackages.sdk_6_0
89+
dotnetCorePackages.sdk_8_0
90+
]
91+
)
92+
fantomas
93+
chromium
94+
];
95+
LD_LIBRARY_PATH = libPath;
96+
};
97+
};
98+
};
99+
}

0 commit comments

Comments
 (0)