-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathflake.nix
48 lines (46 loc) · 1.34 KB
/
flake.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
{
description = "A Blog";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
rust-overlay.url = "github:oxalica/rust-overlay";
};
outputs = {
self,
nixpkgs,
rust-overlay,
...
}: let
system = "x86_64-linux";
overlays = [(import rust-overlay)];
#pkgs = nixpkgs.legacyPackages.${system};
pkgs = import nixpkgs {
inherit system overlays;
};
rust = pkgs.buildPackages.rust-bin.stable.latest.minimal;
buildInputs = with pkgs; [
rust
leptosfmt
cargo-watch
miniserve
openssl
tailwindcss
pkg-config
];
in {
formatter.x86_64-linux = nixpkgs.legacyPackages.${system}.alejandra;
environment.variables = {
PKG_CONFIG_PATH = "${pkgs.openssl.dev}/lib/pkgconfig";
};
devShells.${system}.default = pkgs.mkShell {
inherit buildInputs;
shellHook = ''mkdir -p out
echo "Bienvenido al Blog."
echo -e 'puede usar los comandos:
\x1b[93m#[Para compilar y ejecutar el servidor web local]\x1b[0m
cargo watch -x run --shell "tailwindcss -i ./input.css -o ./out/output.css && cargo run" &
\x1b[93m#[Para ejecutar o correr los archivos estáticos de tu sitio web localmente]\x1b[0m
miniserve out --index index.html'
'';
};
};
}