Skip to content

Commit 9b756c8

Browse files
committed
Add nix flake
1 parent 6841c9b commit 9b756c8

File tree

3 files changed

+165
-1
lines changed

3 files changed

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

0 commit comments

Comments
 (0)