File tree Expand file tree Collapse file tree 3 files changed +121
-0
lines changed Expand file tree Collapse file tree 3 files changed +121
-0
lines changed Original file line number Diff line number Diff line change 1+ {
2+ description = "Simple flake for build Audio Source" ;
3+
4+ inputs . nixpkgs . url = "github:NixOS/nixpkgs/nixpkgs-unstable" ;
5+
6+ outputs =
7+ { self , nixpkgs } :
8+ let
9+ systems = nixpkgs . lib . genAttrs [
10+ "x86_64-linux"
11+ "aarch64-linux"
12+ ] ;
13+ forAllStystem = nixpkgs . lib . genAttrs systems ;
14+ pkgsForSystem = system : import nixpkgs { inherit system ; } ;
15+ in
16+ {
17+ formatter = forAllStystem ( system : ( pkgsForSystem system ) . nixfmt-tree ) ;
18+ packages = forAllStystem ( system : {
19+ audiosource = import ./nix/package.nix {
20+ inherit ( pkgsForSystem )
21+ stdenv
22+ lib
23+ pkgs
24+ fetchFromGitHub
25+ makeWrapper
26+ ;
27+ } ;
28+ default = self . packages . ${ system } . audiosource ;
29+ } ) ;
30+ devShell = forAllStystem (
31+ system : with ( pkgsForSystem system ) ; {
32+ default = mkShell {
33+ inputsFrom = [ self . packages . ${ system } . default ] ;
34+ packages = [
35+ nixd
36+ nixfmt-tree
37+ bash-language-server
38+ ] ;
39+ } ;
40+ }
41+ ) ;
42+ } ;
43+ }
Original file line number Diff line number Diff line change 1+ {
2+ stdenv ,
3+ lib ,
4+ pkgs ,
5+ fetchFromGitHub ,
6+ makeWrapper ,
7+ } :
8+ let
9+ runtimeBins = with pkgs ; [
10+ android-tools
11+ python312
12+ pulseaudio
13+ ] ;
14+ runtimePath = builtins . concatStringsSep ":" ( map ( pkg : "${ pkg } /bin" ) runtimeBins ) ;
15+
16+ in
17+ stdenv . mkDerivation ( finalAttrs : {
18+ pname = "audiosource" ;
19+ version = "1.4" ;
20+ outputs = [
21+ "out"
22+ ] ;
23+ src = fetchFromGitHub {
24+ owner = "gdzx" ;
25+ repo = "audiosource" ;
26+ rev = "v${ finalAttrs . version } " ;
27+ hash = "sha256-SlX8gjs7X5jfoeU6pyk4n8f6oMJgneGVt0pmFs48+mQ=" ;
28+ } ;
29+ nativeBuildInputs = [ makeWrapper ] ;
30+ installPhase = ''
31+ runHook preInstall
32+ mkdir -p $out/bin
33+ install -Dm755 audiosource $out/bin/audiosource
34+ runHook postInstall
35+ '' ;
36+ postInstall = ''
37+ wrapProgram $out/bin/audiosource \
38+ --prefix PATH : "${ runtimePath } "
39+ '' ;
40+ meta = with lib ; {
41+ description = "Use an Android device as a USB microphone" ;
42+ mainProgram = "audiosource" ;
43+ homepage = "https://github.com/gdzx/audiosource" ;
44+ license = licenses . mit ;
45+ platforms = [
46+ "x86_64-linux"
47+ "aarch64-linux"
48+ ] ;
49+ maintainers = [ "ReStranger" ] ;
50+ } ;
51+ } )
You can’t perform that action at this time.
0 commit comments