nix stuff

This commit is contained in:
Mike Heier 2024-09-08 12:36:57 -04:00
parent 7bbdfc0d49
commit 9fba024add
4 changed files with 123 additions and 0 deletions

2
.gitignore vendored
View File

@ -277,3 +277,5 @@ apiclient/generated
# Omnisharp crash logs
mono_crash.*.json
out

1
deps.nix Normal file
View File

@ -0,0 +1 @@
{ fetchNuGet }: [

61
flake.lock Normal file
View File

@ -0,0 +1,61 @@
{
"nodes": {
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1710146030,
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1725634671,
"narHash": "sha256-v3rIhsJBOMLR8e/RNWxr828tB+WywYIoajrZKFM+0Gg=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "574d1eac1c200690e27b8eb4e24887f8df7ac27c",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

59
flake.nix Normal file
View File

@ -0,0 +1,59 @@
{
description = "Jellyfin Server";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
jellyfin-package = pkgs.buildDotnetModule {
pname = "jellyfin";
version = "0.0.1";
# src = fetchFromGitHub {
# owner = "some_owner";
# repo = pname;
# rev = "v${version}";
# hash = ""; # use e.g. `nix-prefetch-git`
# };
src = ./Jellyfin.Server;
projectFile = "Jellyfin.Server/Jellyfin.Server.csproj";
dotnet-sdk = pkgs.dotnet-sdk_8;
dotnet-runtime = pkgs.dotnet-runtime_8;
nugetDeps = ./deps.nix; # create a blank file here, then populate it with `nix-build -A fetch-deps && ./result`
meta = with pkgs.lib; {
homepage = "https://jellyfin.org";
description = "Jellyfin Server";
license = licenses.mit;
};
runtimeDeps = [ pkgs.ffmpeg ]; # This will wrap ffmpeg's library path into `LD_LIBRARY_PATH`.
};
in
{
devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [
dotnet-sdk_8
dotnetPackages.Nuget
omnisharp-roslyn
mono
];
shellHook = ''
echo "Welcome to the .NET 8 development environment!"
echo "dotnet version: $(dotnet --version)"
'';
DOTNET_ROOT = "${pkgs.dotnet-sdk_8}";
LD_LIBRARY_PATH = "${pkgs.stdenv.cc.cc.lib}/lib64:$LD_LIBRARY_PATH";
};
packages.jellyfin = jellyfin-package;
defaultPackage = jellyfin-package;
});
}