added support for templating and tailwindcss
This commit is contained in:
parent
a87ae3dcd3
commit
dc3b994247
16 changed files with 1668 additions and 70 deletions
35
flake.nix
35
flake.nix
|
|
@ -1,26 +1,47 @@
|
|||
{
|
||||
description = "A simple Rust project";
|
||||
description = "A TCG card trading tool written in Rust";
|
||||
|
||||
inputs.nixpkgs.url = "nixpkgs/nixos-unstable";
|
||||
inputs.nixpkgs.url = "nixpkgs/23.05";
|
||||
|
||||
outputs = { self, nixpkgs }: {
|
||||
outputs = { self, nixpkgs }: let
|
||||
system = "x86_64-linux";
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
|
||||
#Shell scripts for managing the two package maangers from one interface
|
||||
build-tailwind = pkgs.writeShellScriptBin "build-tailwind" ''
|
||||
#!/usr/bin/env zsh
|
||||
set -e
|
||||
export PATH=${pkgs.nodejs_20}/bin:${pkgs.nodePackages_latest.pnpm}/bin:$PATH
|
||||
pnpm dlx tailwindcss -i styles/tailwind.css -o assets/main.css --watch
|
||||
'';
|
||||
run-dev = pkgs.writeShellScriptBin "run-dev" ''
|
||||
#!/usr/bin/env zsh
|
||||
set -e
|
||||
cargo run test.json
|
||||
'';
|
||||
|
||||
defaultPackage.x86_64-linux = with nixpkgs.legacyPackages.x86_64-linux; stdenv.mkDerivation {
|
||||
name = "my-rust-project";
|
||||
in {
|
||||
defaultPackage.${system} = with pkgs; stdenv.mkDerivation {
|
||||
name = "sk-tcg-trader";
|
||||
src = self;
|
||||
|
||||
|
||||
buildInputs = [
|
||||
openssl
|
||||
pkgconfig
|
||||
rustc
|
||||
cargo
|
||||
nodejs-20
|
||||
nodePackages_latest.pnpm
|
||||
];
|
||||
|
||||
|
||||
shellHook = ''
|
||||
export OPENSSL_DIR=${openssl.dev}
|
||||
export OPENSSL_LIB_DIR=${openssl.out}/lib
|
||||
export OPENSSL_INCLUDE_DIR=${openssl.dev}/include
|
||||
'';
|
||||
};
|
||||
|
||||
build-tailwind = build-tailwind;
|
||||
run-dev = run-dev;
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue