Env: Update flake
This commit is contained in:
120
flake.lock
generated
120
flake.lock
generated
@ -1,8 +1,33 @@
|
|||||||
{
|
{
|
||||||
"nodes": {
|
"nodes": {
|
||||||
|
"clj-nix": {
|
||||||
|
"inputs": {
|
||||||
|
"devshell": "devshell",
|
||||||
|
"nix-fetcher-data": "nix-fetcher-data",
|
||||||
|
"nixpkgs": [
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1763549559,
|
||||||
|
"narHash": "sha256-w7qhicMuDyfm9/dJKs5+47XqhZmGXRfkZjyn8XjO+c0=",
|
||||||
|
"owner": "jlesquembre",
|
||||||
|
"repo": "clj-nix",
|
||||||
|
"rev": "a55b9fbce3da4aa35c94221f76d40c79e6de4d81",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "jlesquembre",
|
||||||
|
"repo": "clj-nix",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"devshell": {
|
"devshell": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": "nixpkgs"
|
"nixpkgs": [
|
||||||
|
"clj-nix",
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1741473158,
|
"lastModified": 1741473158,
|
||||||
@ -18,6 +43,24 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"flake-parts": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs-lib": "nixpkgs-lib"
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1719745305,
|
||||||
|
"narHash": "sha256-xwgjVUpqSviudEkpQnioeez1Uo2wzrsMaJKJClh+Bls=",
|
||||||
|
"owner": "hercules-ci",
|
||||||
|
"repo": "flake-parts",
|
||||||
|
"rev": "c3c5ecc05edc7dafba779c6c1a61cd08ac6583e9",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "hercules-ci",
|
||||||
|
"repo": "flake-parts",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"flake-utils": {
|
"flake-utils": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"systems": "systems"
|
"systems": "systems"
|
||||||
@ -36,43 +79,80 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nix-fetcher-data": {
|
||||||
|
"inputs": {
|
||||||
|
"flake-parts": "flake-parts",
|
||||||
|
"nixpkgs": [
|
||||||
|
"clj-nix",
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1722073938,
|
"lastModified": 1728229178,
|
||||||
"narHash": "sha256-OpX0StkL8vpXyWOGUD6G+MA26wAXK6SpT94kLJXo6B4=",
|
"narHash": "sha256-p5Fx880uBYstIsbaDYN7sECJT11oHxZQKtHgMAVblWA=",
|
||||||
"owner": "NixOS",
|
"owner": "jlesquembre",
|
||||||
"repo": "nixpkgs",
|
"repo": "nix-fetcher-data",
|
||||||
"rev": "e36e9f57337d0ff0cf77aceb58af4c805472bfae",
|
"rev": "f3a73c34d28db49ef90fd7872a142bfe93120e55",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "NixOS",
|
"owner": "jlesquembre",
|
||||||
"ref": "nixpkgs-unstable",
|
"repo": "nix-fetcher-data",
|
||||||
"repo": "nixpkgs",
|
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs_2": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1741865919,
|
"lastModified": 1763618868,
|
||||||
"narHash": "sha256-4thdbnP6dlbdq+qZWTsm4ffAwoS8Tiq1YResB+RP6WE=",
|
"narHash": "sha256-v5afmLjn/uyD9EQuPBn7nZuaZVV9r+JerayK/4wvdWA=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "573c650e8a14b2faa0041645ab18aed7e60f0c9a",
|
"rev": "a8d610af3f1a5fb71e23e08434d8d61a466fc942",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "NixOS",
|
"id": "nixpkgs",
|
||||||
"ref": "nixpkgs-unstable",
|
"type": "indirect"
|
||||||
"repo": "nixpkgs",
|
}
|
||||||
"type": "github"
|
},
|
||||||
|
"nixpkgs-lib": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1717284937,
|
||||||
|
"narHash": "sha256-lIbdfCsf8LMFloheeE6N31+BMIeixqyQWbSr2vk79EQ=",
|
||||||
|
"type": "tarball",
|
||||||
|
"url": "https://github.com/NixOS/nixpkgs/archive/eb9ceca17df2ea50a250b6b27f7bf6ab0186f198.tar.gz"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"type": "tarball",
|
||||||
|
"url": "https://github.com/NixOS/nixpkgs/archive/eb9ceca17df2ea50a250b6b27f7bf6ab0186f198.tar.gz"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"devshell": "devshell",
|
"clj-nix": "clj-nix",
|
||||||
"flake-utils": "flake-utils",
|
"flake-utils": "flake-utils",
|
||||||
"nixpkgs": "nixpkgs_2"
|
"nixpkgs": "nixpkgs",
|
||||||
|
"rust-overlay": "rust-overlay"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"rust-overlay": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": [
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1763865987,
|
||||||
|
"narHash": "sha256-DJpzM8Jz3B0azJcAoF+YFHr8rEbxYLJ0wy1kWZ29HOw=",
|
||||||
|
"owner": "oxalica",
|
||||||
|
"repo": "rust-overlay",
|
||||||
|
"rev": "042d905c01a6eec3bcae8530dacb19cda9758a63",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "oxalica",
|
||||||
|
"repo": "rust-overlay",
|
||||||
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"systems": {
|
"systems": {
|
||||||
|
|||||||
395
flake.nix
395
flake.nix
@ -1,114 +1,329 @@
|
|||||||
{
|
rec {
|
||||||
description = "Svelte F1 Guessgame";
|
description = "Formula11";
|
||||||
|
|
||||||
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
inputs = {
|
||||||
inputs.flake-utils.url = "github:numtide/flake-utils";
|
nixpkgs.url = "nixpkgs"; # Use nixpkgs from system registry
|
||||||
inputs.devshell.url = "github:numtide/devshell";
|
flake-utils.url = "github:numtide/flake-utils";
|
||||||
|
|
||||||
|
rust-overlay.url = "github:oxalica/rust-overlay";
|
||||||
|
rust-overlay.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
|
||||||
|
clj-nix.url = "github:jlesquembre/clj-nix";
|
||||||
|
clj-nix.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
};
|
||||||
|
|
||||||
outputs = {
|
outputs = {
|
||||||
self,
|
self,
|
||||||
nixpkgs,
|
nixpkgs,
|
||||||
flake-utils,
|
flake-utils,
|
||||||
devshell,
|
rust-overlay,
|
||||||
|
clj-nix,
|
||||||
}:
|
}:
|
||||||
|
# Create a shell (and possibly package) for each possible system, not only x86_64-linux
|
||||||
flake-utils.lib.eachDefaultSystem (system: let
|
flake-utils.lib.eachDefaultSystem (system: let
|
||||||
pkgs = import nixpkgs {
|
pkgs = import nixpkgs {
|
||||||
inherit system;
|
inherit system;
|
||||||
config.allowUnfree = true;
|
config.allowUnfree = true;
|
||||||
overlays = [devshell.overlays.default];
|
overlays = [
|
||||||
};
|
rust-overlay.overlays.default
|
||||||
|
|
||||||
timple = pkgs.python312Packages.buildPythonPackage rec {
|
|
||||||
pname = "timple";
|
|
||||||
version = "0.1.8";
|
|
||||||
|
|
||||||
src = pkgs.python312Packages.fetchPypi {
|
|
||||||
inherit pname version;
|
|
||||||
hash = "sha256-u8EgMA8BA6OpPlSg0ASRxLcIcv5psRIEcBpIicagXw8=";
|
|
||||||
};
|
|
||||||
|
|
||||||
doCheck = false;
|
|
||||||
pyproject = true;
|
|
||||||
|
|
||||||
# Build time deps
|
|
||||||
nativeBuildInputs = with pkgs.python312Packages; [
|
|
||||||
setuptools
|
|
||||||
];
|
|
||||||
|
|
||||||
# Run time deps
|
|
||||||
dependencies = with pkgs.python312Packages; [
|
|
||||||
matplotlib
|
|
||||||
numpy
|
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
inherit (pkgs) lib stdenv;
|
||||||
|
|
||||||
fastf1 = pkgs.python312Packages.buildPythonPackage rec {
|
# ===========================================================================================
|
||||||
pname = "fastf1";
|
# Define custom dependencies
|
||||||
version = "3.4.4";
|
# ===========================================================================================
|
||||||
|
|
||||||
src = pkgs.python312Packages.fetchPypi {
|
# Python package example
|
||||||
inherit pname version;
|
# typed-ffmpeg = pkgs.python313Packages.buildPythonPackage rec {
|
||||||
hash = "sha256-nELQtvzlLsUYyVaPe1KqvMmzHy5l5W7u1I6m8r8md/4=";
|
# pname = "typed_ffmpeg";
|
||||||
};
|
# version = "3.6";
|
||||||
|
#
|
||||||
|
# src = pkgs.python313Packages.fetchPypi {
|
||||||
|
# inherit pname version;
|
||||||
|
# hash = "sha256-YPspq/lqI/jx/9FCQntmQPw4lrPIsdxtHTUg0F0QbrM=";
|
||||||
|
# };
|
||||||
|
#
|
||||||
|
# pyproject = true;
|
||||||
|
# build-system = [
|
||||||
|
# pkgs.python313Packages.setuptools
|
||||||
|
# pkgs.python313Packages.setuptools-scm
|
||||||
|
# ];
|
||||||
|
# };
|
||||||
|
|
||||||
doCheck = false;
|
# python = pkgs.python313.withPackages (p:
|
||||||
pyproject = true;
|
# with p; [
|
||||||
|
# # numpy
|
||||||
|
# # matplotlib
|
||||||
|
# # typed-ffmpeg
|
||||||
|
# # pyside6
|
||||||
|
# ]);
|
||||||
|
|
||||||
# Build time deps
|
# rust = pkgs.rust-bin.stable.latest.default.override {
|
||||||
nativeBuildInputs = with pkgs.python312Packages; [
|
# extensions = ["rust-src"]; # Include the Rust stdlib source (for IntelliJ)
|
||||||
hatchling
|
# };
|
||||||
hatch-vcs
|
|
||||||
];
|
|
||||||
|
|
||||||
# Run time deps
|
# 64 bit C/C++ compilers that don't collide (use the same libc)
|
||||||
dependencies = with pkgs.python312Packages; [
|
# bintools = pkgs.wrapBintoolsWith {
|
||||||
matplotlib
|
# bintools = pkgs.bintools.bintools; # Unwrapped bintools
|
||||||
numpy
|
# libc = pkgs.glibc;
|
||||||
pandas
|
# };
|
||||||
python-dateutil
|
# gcc = pkgs.hiPrio (pkgs.wrapCCWith {
|
||||||
requests
|
# cc = pkgs.gcc.cc; # Unwrapped gcc
|
||||||
requests-cache
|
# libc = pkgs.glibc;
|
||||||
scipy
|
# bintools = bintools;
|
||||||
rapidfuzz
|
# });
|
||||||
websockets
|
# clang = pkgs.wrapCCWith {
|
||||||
timple
|
# cc = pkgs.clang.cc; # Unwrapped clang
|
||||||
];
|
# libc = pkgs.glibc;
|
||||||
};
|
# bintools = bintools;
|
||||||
in {
|
# };
|
||||||
devShell = pkgs.devshell.mkShell {
|
|
||||||
name = "Formula11";
|
|
||||||
|
|
||||||
packages = with pkgs; [
|
# Multilib C/C++ compilers that don't collide (use the same libc)
|
||||||
nodejs_23
|
# bintools_multilib = pkgs.wrapBintoolsWith {
|
||||||
pocketbase
|
# bintools = pkgs.bintools.bintools; # Unwrapped bintools
|
||||||
|
# libc = pkgs.glibc_multi;
|
||||||
|
# };
|
||||||
|
# gcc_multilib = pkgs.hiPrio (pkgs.wrapCCWith {
|
||||||
|
# cc = pkgs.gcc.cc; # Unwrapped gcc
|
||||||
|
# libc = pkgs.glibc_multi;
|
||||||
|
# bintools = bintools_multilib;
|
||||||
|
# });
|
||||||
|
# clang_multilib = pkgs.wrapCCWith {
|
||||||
|
# cc = pkgs.clang.cc; # Unwrapped clang
|
||||||
|
# libc = pkgs.glibc_multi;
|
||||||
|
# bintools = bintools_multilib;
|
||||||
|
# };
|
||||||
|
|
||||||
sqlite # For sqlite console
|
# ===========================================================================================
|
||||||
sqlitebrowser # To check low-level pocketbase data
|
# Specify dependencies
|
||||||
];
|
# https://nixos.org/manual/nixpkgs/stable/#ssec-stdenv-dependencies-overview
|
||||||
|
# Just for a "nix develop" shell, buildInputs can be used for everything.
|
||||||
|
# ===========================================================================================
|
||||||
|
|
||||||
# Use $1 for positional args
|
# Add dependencies to nativeBuildInputs if they are executed during the build:
|
||||||
commands = [
|
# - Those which are needed on $PATH during the build, for example cmake and pkg-config
|
||||||
{
|
# - Setup hooks, for example makeWrapper
|
||||||
name = "pb";
|
# - Interpreters needed by patchShebangs for build scripts (with the --build flag), which can be the case for e.g. perl
|
||||||
help = "Serve PocketBase";
|
nativeBuildInputs = with pkgs; [
|
||||||
command = "pocketbase serve --http 192.168.86.50:8090 --dev";
|
nodejs_24
|
||||||
}
|
pocketbase
|
||||||
{
|
|
||||||
name = "dev";
|
sqlite # For sqlite console
|
||||||
help = "Serve Formula 11 (Dev)";
|
sqlitebrowser # To check low-level pocketbase data
|
||||||
command = "npm run dev -- --host --port 5173";
|
|
||||||
}
|
# Languages:
|
||||||
{
|
# python
|
||||||
name = "prod";
|
# rust
|
||||||
help = "Serve Formula 11 (Prod)";
|
# bintools
|
||||||
command = "npm run build && npm run preview -- --host --port 5173";
|
# gcc
|
||||||
}
|
# clang
|
||||||
{
|
# bintools_multilib
|
||||||
name = "check";
|
# gcc_multilib
|
||||||
help = "Continuously monitor for SvelteKit issues";
|
# clang_multilib
|
||||||
command = "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch";
|
# clojure
|
||||||
}
|
# jdk
|
||||||
];
|
|
||||||
|
# C/C++:
|
||||||
|
# gdb
|
||||||
|
# valgrind
|
||||||
|
# gnumake
|
||||||
|
# cmake
|
||||||
|
# pkg-config
|
||||||
|
|
||||||
|
# Clojure:
|
||||||
|
# leiningen
|
||||||
|
# clj-nix.packages.${system}.deps-lock
|
||||||
|
|
||||||
|
# Java:
|
||||||
|
# gradle
|
||||||
|
|
||||||
|
# Python:
|
||||||
|
# hatch
|
||||||
|
# py-spy
|
||||||
|
|
||||||
|
# Qt:
|
||||||
|
# qt6.wrapQtAppsHook # For the shellHook
|
||||||
|
];
|
||||||
|
|
||||||
|
# Add dependencies to buildInputs if they will end up copied or linked into the final output or otherwise used at runtime:
|
||||||
|
# - Libraries used by compilers, for example zlib
|
||||||
|
# - Interpreters needed by patchShebangs for scripts which are installed, which can be the case for e.g. perl
|
||||||
|
buildInputs = with pkgs; [
|
||||||
|
# C/C++:
|
||||||
|
# boost
|
||||||
|
# sfml
|
||||||
|
|
||||||
|
# Qt:
|
||||||
|
# qt6.qtbase
|
||||||
|
# qt6.full
|
||||||
|
];
|
||||||
|
# ===========================================================================================
|
||||||
|
# Define buildable + installable packages
|
||||||
|
# ===========================================================================================
|
||||||
|
# package = stdenv.mkDerivation {
|
||||||
|
# inherit nativeBuildInputs buildInputs;
|
||||||
|
# pname = "";
|
||||||
|
# version = "1.0.0";
|
||||||
|
# src = ./.;
|
||||||
|
#
|
||||||
|
# installPhase = ''
|
||||||
|
# mkdir -p $out/bin
|
||||||
|
# mv ./BINARY $out/bin
|
||||||
|
# '';
|
||||||
|
# };
|
||||||
|
# package = clj-nix.lib.mkCljApp {
|
||||||
|
# inherit pkgs;
|
||||||
|
# modules = [
|
||||||
|
# # Option list: https://jlesquembre.github.io/clj-nix/options/
|
||||||
|
# {
|
||||||
|
# name = "";
|
||||||
|
# version = "1.0.0";
|
||||||
|
# main-ns = "";
|
||||||
|
# projectSrc = ./.;
|
||||||
|
# withLeiningen = true;
|
||||||
|
# buildCommand = "lein uberjar"; # Requires "withLeiningen = true;"
|
||||||
|
# jdk = pkgs.jdk; # Default is pkgs.jdk_headless
|
||||||
|
# # customJdk.enable = true;
|
||||||
|
# # nativeImage.enable = true;
|
||||||
|
# }
|
||||||
|
# ];
|
||||||
|
# };
|
||||||
|
in rec {
|
||||||
|
# Provide package for "nix build"
|
||||||
|
# defaultPackage = package;
|
||||||
|
# defaultApp = flake-utils.lib.mkApp {
|
||||||
|
# drv = defaultPackage;
|
||||||
|
# };
|
||||||
|
|
||||||
|
# Provide environment for "nix develop"
|
||||||
|
devShell = pkgs.mkShell {
|
||||||
|
inherit nativeBuildInputs buildInputs;
|
||||||
|
name = description;
|
||||||
|
|
||||||
|
# =========================================================================================
|
||||||
|
# Define environment variables
|
||||||
|
# =========================================================================================
|
||||||
|
|
||||||
|
# Rust stdlib source:
|
||||||
|
# RUST_SRC_PATH = "${rust}/lib/rustlib/src/rust/library";
|
||||||
|
|
||||||
|
# Custom dynamic libraries:
|
||||||
|
# LD_LIBRARY_PATH = builtins.concatStringsSep ":" [
|
||||||
|
# # Rust Bevy GUI app:
|
||||||
|
# # "${pkgs.xorg.libX11}/lib"
|
||||||
|
# # "${pkgs.xorg.libXcursor}/lib"
|
||||||
|
# # "${pkgs.xorg.libXrandr}/lib"
|
||||||
|
# # "${pkgs.xorg.libXi}/lib"
|
||||||
|
# # "${pkgs.libGL}/lib"
|
||||||
|
#
|
||||||
|
# # JavaFX app:
|
||||||
|
# # "${pkgs.libGL}/lib"
|
||||||
|
# # "${pkgs.gtk3}/lib"
|
||||||
|
# # "${pkgs.glib.out}/lib"
|
||||||
|
# # "${pkgs.xorg.libXtst}/lib"
|
||||||
|
# ];
|
||||||
|
|
||||||
|
# Dynamic libraries from buildinputs:
|
||||||
|
# LD_LIBRARY_PATH = nixpkgs.lib.makeLibraryPath buildInputs;
|
||||||
|
|
||||||
|
# QT imports to use with "qmlls -E"
|
||||||
|
# QML_IMPORT_PATH = "${pkgs.qt6.full}/lib/qt-6/qml";
|
||||||
|
|
||||||
|
# Set PYTHONPATH
|
||||||
|
# PYTHONPATH = ".";
|
||||||
|
|
||||||
|
# Set matplotlib backend
|
||||||
|
# MPLBACKEND = "TkAgg";
|
||||||
|
|
||||||
|
# =========================================================================================
|
||||||
|
# Define shell environment
|
||||||
|
# =========================================================================================
|
||||||
|
|
||||||
|
# Setup the shell when entering the "nix develop" environment (bash script).
|
||||||
|
shellHook = let
|
||||||
|
mkCmakeScript = type: let
|
||||||
|
typeLower = lib.toLower type;
|
||||||
|
in
|
||||||
|
pkgs.writers.writeFish "cmake-${typeLower}.fish" ''
|
||||||
|
cd $FLAKE_PROJECT_ROOT
|
||||||
|
|
||||||
|
echo "Removing build directory ./cmake-build-${typeLower}/"
|
||||||
|
rm -rf ./cmake-build-${typeLower}
|
||||||
|
|
||||||
|
echo "Creating build directory"
|
||||||
|
mkdir cmake-build-${typeLower}
|
||||||
|
cd cmake-build-${typeLower}
|
||||||
|
|
||||||
|
echo "Running cmake"
|
||||||
|
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE="${type}" -DCMAKE_EXPORT_COMPILE_COMMANDS="On" ..
|
||||||
|
|
||||||
|
echo "Linking compile_commands.json"
|
||||||
|
cd ..
|
||||||
|
ln -sf ./cmake-build-${typeLower}/compile_commands.json ./compile_commands.json
|
||||||
|
'';
|
||||||
|
|
||||||
|
cmakeDebug = mkCmakeScript "Debug";
|
||||||
|
cmakeRelease = mkCmakeScript "Release";
|
||||||
|
|
||||||
|
mkBuildScript = type: let
|
||||||
|
typeLower = lib.toLower type;
|
||||||
|
in
|
||||||
|
pkgs.writers.writeFish "cmake-build.fish" ''
|
||||||
|
cd $FLAKE_PROJECT_ROOT/cmake-build-${typeLower}
|
||||||
|
|
||||||
|
echo "Running cmake"
|
||||||
|
cmake --build .
|
||||||
|
'';
|
||||||
|
|
||||||
|
buildDebug = mkBuildScript "Debug";
|
||||||
|
buildRelease = mkBuildScript "Release";
|
||||||
|
|
||||||
|
# Use this to specify commands that should be ran after entering fish shell
|
||||||
|
initProjectShell = pkgs.writers.writeFish "init-shell.fish" ''
|
||||||
|
echo "Entering \"${description}\" environment..."
|
||||||
|
|
||||||
|
# Determine the project root, used e.g. in cmake scripts
|
||||||
|
set -g -x FLAKE_PROJECT_ROOT (git rev-parse --show-toplevel)
|
||||||
|
|
||||||
|
# Rust Bevy:
|
||||||
|
# abbr -a build-release-windows "CARGO_FEATURE_PURE=1 cargo xwin build --release --target x86_64-pc-windows-msvc"
|
||||||
|
|
||||||
|
# C/C++:
|
||||||
|
# abbr -a cmake-debug "${cmakeDebug}"
|
||||||
|
# abbr -a cmake-release "${cmakeRelease}"
|
||||||
|
# abbr -a build-debug "${buildDebug}"
|
||||||
|
# abbr -a build-release "${buildRelease}"
|
||||||
|
|
||||||
|
# Clojure:
|
||||||
|
# abbr -a clojure-deps "deps-lock --lein"
|
||||||
|
|
||||||
|
# Python:
|
||||||
|
# abbr -a run "python ./app/main.py"
|
||||||
|
# abbr -a profile "py-spy record -o profile.svg -- python ./app/main.py && firefox profile.svg"
|
||||||
|
# abbr -a ptop "py-spy top -- python ./app/main.py"
|
||||||
|
|
||||||
|
# Formula11:
|
||||||
|
abbr -a pb "pocketbase serve --http 192.168.86.50:8090 --dev"
|
||||||
|
abbr -a dev "npm run dev -- --host --port 5173"
|
||||||
|
abbr -a prod "npm run build && npm run preview -- --host --port 5173"
|
||||||
|
abbr -a check "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch"
|
||||||
|
'';
|
||||||
|
in
|
||||||
|
builtins.concatStringsSep "\n" [
|
||||||
|
# Launch into pure fish shell
|
||||||
|
''
|
||||||
|
exec "$(type -p fish)" -C "source ${initProjectShell} && abbr -a menu '${pkgs.bat}/bin/bat "${initProjectShell}"'"
|
||||||
|
''
|
||||||
|
|
||||||
|
# Qt: Launch into wrapped fish shell
|
||||||
|
# https://nixos.org/manual/nixpkgs/stable/#sec-language-qt
|
||||||
|
# ''
|
||||||
|
# fishdir=$(mktemp -d)
|
||||||
|
# makeWrapper "$(type -p fish)" "$fishdir/fish" "''${qtWrapperArgs[@]}"
|
||||||
|
# exec "$fishdir/fish" -C "source ${initProjectShell} && abbr -a menu '${pkgs.bat}/bin/bat "${initProjectShell}"'"
|
||||||
|
# ''
|
||||||
|
];
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user