summaryrefslogtreecommitdiff
path: root/flake.nix
diff options
context:
space:
mode:
authorjakka <jakka@jakka.su>2026-05-10 20:57:37 +0300
committerjakka <jakka@jakka.su>2026-05-10 20:57:37 +0300
commiteda73353c4a9c90edac0c71d6cd25ebc54aebc59 (patch)
tree94891b7f37a15b4db9f344f508750f858d2813cf /flake.nix
parent55dba532207bcf8c575550e177b782ba9b002029 (diff)
set up flake for development
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix52
1 files changed, 52 insertions, 0 deletions
diff --git a/flake.nix b/flake.nix
new file mode 100644
index 0000000..ca8a0ad
--- /dev/null
+++ b/flake.nix
@@ -0,0 +1,52 @@
+{
+ inputs = {
+ flake-utils.url = "github:numtide/flake-utils";
+ naersk = {
+ url = "github:nix-community/naersk";
+ inputs.nixpkgs.follows = "nixpkgs";
+ };
+ nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
+ };
+
+ outputs =
+ {
+ flake-utils,
+ naersk,
+ nixpkgs,
+ ...
+ }:
+ flake-utils.lib.eachDefaultSystem (
+ system:
+ let
+ pkgs = (import nixpkgs) { inherit system; };
+
+ naersk' = pkgs.callPackage naersk { };
+
+ in
+ {
+ # For `nix build` & `nix run`:
+ packages.default = naersk'.buildPackage {
+ src = ./.;
+ nativeBuildInputs = with pkgs; [
+ cmake
+ flac
+ sqlite
+ ];
+ };
+
+ # For `nix develop`:
+ devShell = pkgs.mkShell {
+ nativeBuildInputs = with pkgs; [
+ cargo
+ rustc
+ ];
+ packages = with pkgs; [
+ nixd
+ nixfmt
+ rust-analyzer
+ clippy
+ ];
+ };
+ }
+ );
+}