Skip to content

Commit fcd2dbe

Browse files
committed
First step of nixification
1 parent 67fa1ec commit fcd2dbe

File tree

1 file changed

+28
-8
lines changed

1 file changed

+28
-8
lines changed

flake.nix

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,28 +24,48 @@
2424
# system.
2525

2626
# Equivalent to inputs'.nixpkgs.legacyPackages.hello;
27-
packages.default = pkgs.hello;
27+
apps.default = {
28+
type = "app";
29+
program = "${pkgs.lib.getExe self'.packages.rps}";
30+
};
31+
packages = {
32+
rps = pkgs.writeShellScriptBin "rps" ''
33+
${pkgs.racket}/bin/raco pkg install --auto --skip-installed pollen string-interpolation && ${pkgs.racket}/bin/raco pollen start
34+
'';
35+
default = pkgs.stdenv.mkDerivation {
36+
name = "tu-lambda.github.io";
37+
src = ./.;
38+
39+
nativeBuildInputs = [ pkgs.cacert ];
40+
buildInputs = [ pkgs.racket ];
41+
buildPhase = ''
42+
export HOME=$(pwd)
43+
raco pkg install --auto --skip-installed pollen string-interpolation
44+
raco pollen render
45+
'';
46+
installPhase = ''
47+
mkdir $out
48+
cp -r assets *.html *.css *.js $out
49+
'';
50+
outputHashAlgo = "sha256";
51+
outputHashMode = "recursive";
52+
outputHash = "sha256-IqePV4oF9/XKDnn+BWIstScY7DDD4YUBkBIv1InMO0o=";
53+
};
54+
};
2855
devshells.default = {
29-
env = [
30-
# { name = "MY_ENV_VAR"; value = "SOTRUE"; }
31-
];
3256
packages = [
3357
pkgs.racket
3458
];
3559
devshell.startup = {
3660
install-langserver.text = ''raco pkg install --auto --skip-installed racket-langserver'';
3761
install-web.text = ''raco pkg install --auto --skip-installed pollen string-interpolation'';
3862
};
39-
commands = [
40-
{ name = "rps"; command = "raco pollen start"; help = "Run the pollen web server"; }
41-
];
4263
};
4364
};
4465
flake = {
4566
# The usual flake attributes can be defined here, including system-
4667
# agnostic ones like nixosModule and system-enumerating ones, although
4768
# those are more easily expressed in perSystem.
48-
4969
};
5070
};
5171
}

0 commit comments

Comments
 (0)