From 50b2bb4eb0394c4b3c6481347720a4a62a5ed200 Mon Sep 17 00:00:00 2001 From: Dilshad Date: Fri, 27 Feb 2026 10:42:04 +0530 Subject: [PATCH] chore: add nix flake --- default.nix | 13 +++++++++++++ flake.lock | 27 +++++++++++++++++++++++++++ flake.nix | 23 +++++++++++++++++++++++ 3 files changed, 63 insertions(+) create mode 100644 default.nix create mode 100644 flake.lock create mode 100644 flake.nix diff --git a/default.nix b/default.nix new file mode 100644 index 00000000..048b7be0 --- /dev/null +++ b/default.nix @@ -0,0 +1,13 @@ +{ + pkgs ? import { }, +}: +let + cargoToml = builtins.fromTOML (builtins.readFile ./Cargo.toml); + version = cargoToml.workspace.package.version; +in +pkgs.rustPlatform.buildRustPackage { + pname = "playit"; + version = version; + cargoLock.lockFile = ./Cargo.lock; + src = pkgs.lib.cleanSource ./.; +} diff --git a/flake.lock b/flake.lock new file mode 100644 index 00000000..82d8ab72 --- /dev/null +++ b/flake.lock @@ -0,0 +1,27 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1771848320, + "narHash": "sha256-0MAd+0mun3K/Ns8JATeHT1sX28faLII5hVLq0L3BdZU=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "2fc6539b481e1d2569f25f8799236694180c0993", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 00000000..5a9befa4 --- /dev/null +++ b/flake.nix @@ -0,0 +1,23 @@ +{ + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + }; + outputs = + { nixpkgs, ... }: + let + supportedSystems = [ + "x86_64-linux" + "aarch64-linux" + "i686-linux" + "x86_64-darwin" + "aarch64-darwin" + ]; + forAllSystems = nixpkgs.lib.genAttrs supportedSystems; + pkgsFor = nixpkgs.legacyPackages; + in + { + packages = forAllSystems (system: { + default = pkgsFor.${system}.callPackage ./. { }; + }); + }; +}