Merge 6cbdcc300ffa7b36ba7f25ee5a72bb4ad98090c3 into dbd26ba2e71d0a5b79dba873a2beeff59f1cd8dd

This commit is contained in:
Saif Al-Din Samy 2026-08-31 08:23:22 +03:00 committed by GitHub
commit e5465c2d08
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 78 additions and 0 deletions

27
flake.lock generated Normal file
View File

@ -0,0 +1,27 @@
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1787360063,
"narHash": "sha256-dt4WdcvsA8/RCe+VZZwqU0X+XMM3wBbGCWA0/sFWzGo=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "2c423e03bbafcff28bfadc6781a4a8257f205cb5",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

51
flake.nix Normal file
View File

@ -0,0 +1,51 @@
{
description = "Navidrome is an open source web-based music collection server and streamer.";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
};
outputs =
{
self,
nixpkgs,
}:
let
systems = [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
forAllSystems = nixpkgs.lib.genAttrs systems;
pkgsForEach = system: nixpkgs.legacyPackages.${system};
in
{
devShells = forAllSystems (
system:
let
pkgs = pkgsForEach system;
goModVersion = builtins.head (
builtins.match ".*\ngo ([0-9]+\\.[0-9]+).*" (builtins.readFile ./go.mod)
);
goAttr = "go_${builtins.replaceStrings [ "." ] [ "_" ] goModVersion}";
nvmrcVersion = builtins.head (builtins.match ".([0-9]+).*" (builtins.readFile ./.nvmrc));
nodeAttr = "nodejs_${nvmrcVersion}";
in
{
default = pkgs.mkShell {
name = "navidrome-shell";
packages = with pkgs; [
pkgs.${goAttr}
gopls
pkgs.${nodeAttr}
gnumake
perl
];
shellHook = ''
export PATH="$HOME/go/bin:$PATH"
echo "Navidrome dev shell ready"
'';
};
}
);
};
}