adding flake
This commit is contained in:
parent
a456d1c17b
commit
8fa8c752ed
2 changed files with 86 additions and 0 deletions
1
.envrc
Normal file
1
.envrc
Normal file
|
@ -0,0 +1 @@
|
||||||
|
use flake .
|
85
flake.nix
Normal file
85
flake.nix
Normal file
|
@ -0,0 +1,85 @@
|
||||||
|
{
|
||||||
|
description = "A fast, simple 2D text renderer for wgpu";
|
||||||
|
|
||||||
|
inputs = {
|
||||||
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||||
|
naersk.url = "github:nix-community/naersk";
|
||||||
|
flake-utils.url = "github:numtide/flake-utils";
|
||||||
|
fenix.url = "github:nix-community/fenix";
|
||||||
|
};
|
||||||
|
|
||||||
|
outputs = inputs: with inputs;
|
||||||
|
flake-utils.lib.eachDefaultSystem
|
||||||
|
(system:
|
||||||
|
let
|
||||||
|
pkgs = import nixpkgs {
|
||||||
|
inherit system;
|
||||||
|
overlays = [fenix.overlays.default];
|
||||||
|
# overlays = [cargo2nix.overlays.default];
|
||||||
|
};
|
||||||
|
naersk' = pkgs.callPackage naersk {};
|
||||||
|
nbi = with pkgs; [
|
||||||
|
# Rust tools
|
||||||
|
alejandra
|
||||||
|
(pkgs.fenix.stable.withComponents [
|
||||||
|
"cargo"
|
||||||
|
"clippy"
|
||||||
|
"rust-src"
|
||||||
|
"rustc"
|
||||||
|
"rustfmt"
|
||||||
|
])
|
||||||
|
rust-analyzer
|
||||||
|
vulkan-loader
|
||||||
|
wayland
|
||||||
|
wayland-protocols
|
||||||
|
libxkbcommon
|
||||||
|
pkg-config
|
||||||
|
];
|
||||||
|
|
||||||
|
bi = with pkgs; [
|
||||||
|
gcc
|
||||||
|
stdenv
|
||||||
|
gnumake
|
||||||
|
gdb
|
||||||
|
cmake
|
||||||
|
makeWrapper
|
||||||
|
vulkan-headers
|
||||||
|
vulkan-loader
|
||||||
|
vulkan-tools
|
||||||
|
harfbuzz
|
||||||
|
libGL
|
||||||
|
cargo-flamegraph
|
||||||
|
fontconfig
|
||||||
|
just
|
||||||
|
sqlx-cli
|
||||||
|
cargo-watch
|
||||||
|
];
|
||||||
|
in rec
|
||||||
|
{
|
||||||
|
devShell = pkgs.mkShell.override {
|
||||||
|
stdenv = pkgs.stdenvAdapters.useMoldLinker pkgs.clangStdenv;
|
||||||
|
} {
|
||||||
|
nativeBuildInputs = nbi;
|
||||||
|
buildInputs = bi;
|
||||||
|
LD_LIBRARY_PATH = "$LD_LIBRARY_PATH:${
|
||||||
|
with pkgs;
|
||||||
|
pkgs.lib.makeLibraryPath [
|
||||||
|
pkgs.vulkan-loader
|
||||||
|
pkgs.wayland
|
||||||
|
pkgs.wayland-protocols
|
||||||
|
pkgs.libxkbcommon
|
||||||
|
]
|
||||||
|
}";
|
||||||
|
DATABASE_URL = "sqlite:///home/chris/.local/share/lumina/library-db.sqlite3";
|
||||||
|
};
|
||||||
|
defaultPackage = naersk'.buildPackage {
|
||||||
|
src = ./.;
|
||||||
|
};
|
||||||
|
packages = {
|
||||||
|
default = naersk'.buildPackage {
|
||||||
|
src = ./.;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue