From 893ec06b7c0a80744f30cd13d0cd8c535cf8dae1 Mon Sep 17 00:00:00 2001 From: Maxiem Geldhof Date: Mon, 13 Oct 2025 18:55:11 +0200 Subject: [PATCH] Fix selene --- flake.lock | 17 ++++++++++++ flake.nix | 3 ++ jellyfin-exporter/flake.nix | 55 +++++++++++++++++++++++++++++++++++++ 3 files changed, 75 insertions(+) create mode 100644 jellyfin-exporter/flake.nix diff --git a/flake.lock b/flake.lock index f5f51ff..fcd58d6 100644 --- a/flake.lock +++ b/flake.lock @@ -87,6 +87,22 @@ "type": "github" } }, + "jellyfin-exporter": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "path": "./jellyfin-exporter", + "type": "path" + }, + "original": { + "path": "./jellyfin-exporter", + "type": "path" + }, + "parent": [] + }, "nix-darwin": { "inputs": { "nixpkgs": [ @@ -128,6 +144,7 @@ "inputs": { "agenix": "agenix", "home-manager": "home-manager_2", + "jellyfin-exporter": "jellyfin-exporter", "nix-darwin": "nix-darwin", "nixpkgs": "nixpkgs" } diff --git a/flake.nix b/flake.nix index 2883726..013a23e 100644 --- a/flake.nix +++ b/flake.nix @@ -9,6 +9,8 @@ home-manager.inputs.nixpkgs.follows = "nixpkgs"; agenix.url = "github:ryantm/agenix"; agenix.inputs.nixpkgs.follows = "nixpkgs"; + jellyfin-exporter.url = "path:./jellyfin-exporter"; + jellyfin-exporter.inputs.nixpkgs.follows = "nixpkgs"; }; outputs = @@ -18,6 +20,7 @@ home-manager, nixpkgs, agenix, + jellyfin-exporter, }: let macbook = import ./systems/macbook/macbook.nix inputs; diff --git a/jellyfin-exporter/flake.nix b/jellyfin-exporter/flake.nix new file mode 100644 index 0000000..307e58b --- /dev/null +++ b/jellyfin-exporter/flake.nix @@ -0,0 +1,55 @@ +{ + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05"; + }; + + outputs = + { self, nixpkgs }: + let + # The set of systems to provide outputs for + allSystems = [ + "x86_64-linux" + "aarch64-linux" + "x86_64-darwin" + "aarch64-darwin" + ]; + + # A function that provides a system-specific Nixpkgs for the desired systems + forAllSystems = + f: + nixpkgs.lib.genAttrs allSystems ( + system: + f { + pkgs = import nixpkgs { inherit system; }; + } + ); + in + { + packages = forAllSystems ( + { pkgs }: + { + default = pkgs.buildGoModule (finalAttrs: { + doCheck = false; + pname = "jellyfin-exporter"; + version = "1.3.8"; + + src = pkgs.fetchFromGitHub { + owner = "rebelcore"; + repo = "jellyfin_exporter"; + tag = "v${finalAttrs.version}"; + hash = "sha256-7fIrjcy6y/Ayj43WeuPNCx3uVJyl5Wf6bWs5ta2PpWc="; + }; + + # Let Nix fetch Go modules and hash them automatically + vendorHash = "sha256-JSOKDbefQyDLNy2y1oW7HUplQw8uhhOGZ+ueWyUYYQ0="; + + meta = { + description = "Jellyfin exporter for Prometheus"; + homepage = "https://github.com/rebelcore/jellyfin_exporter"; + license = pkgs.lib.licenses.asl20; + }; + }); + } + ); + }; +}