From 646241f355a1587eecf26649cbe3aefa3889e169 Mon Sep 17 00:00:00 2001 From: Konstantin Fickel Date: Sat, 14 Feb 2026 17:59:43 +0100 Subject: [PATCH] feat: add home-manager module output --- flake.lock | 12 ++++++------ flake.nix | 44 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+), 6 deletions(-) diff --git a/flake.lock b/flake.lock index 0f2727f..4fa0a20 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "nixpkgs": { "locked": { - "lastModified": 1769789167, - "narHash": "sha256-kKB3bqYJU5nzYeIROI82Ef9VtTbu4uA3YydSk/Bioa8=", + "lastModified": 1770197578, + "narHash": "sha256-AYqlWrX09+HvGs8zM6ebZ1pwUqjkfpnv8mewYwAo+iM=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "62c8382960464ceb98ea593cb8321a2cf8f9e3e5", + "rev": "00c21e4c93d963c50d4c0c89bfa84ed6e0694df2", "type": "github" }, "original": { @@ -80,11 +80,11 @@ ] }, "locked": { - "lastModified": 1769957392, - "narHash": "sha256-6PkqwwYf5K2CHi2V+faI/9pqjfz/HxUkI/MVid6hlOY=", + "lastModified": 1770331927, + "narHash": "sha256-jlOvO++uvne/lTgWqdI4VhTV5OpVWi70ZDVBlT6vGSs=", "owner": "pyproject-nix", "repo": "uv2nix", - "rev": "d18bc50ae1c3d4be9c41c2d94ea765524400af75", + "rev": "5b43a934e15b23bfba6c408cba1c570eccf80080", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 669701a..d112b66 100644 --- a/flake.nix +++ b/flake.nix @@ -85,6 +85,50 @@ in { + homeManagerModules.default = + { + lib, + config, + pkgs, + ... + }: + let + cfg = config.programs.streamer; + in + { + options.programs.streamer = { + enable = lib.mkEnableOption "streamer"; + + base-folder = lib.mkOption { + type = lib.types.str; + description = "Base Folder of Streamer"; + }; + + package = lib.mkOption { + type = lib.types.package; + default = self.packages.${pkgs.system}.streamer; + defaultText = lib.literalExpression "inputs.streamer.packages.\${pkgs.system}.streamer"; + description = "The package to use for the streamer binary."; + }; + }; + + config = lib.mkIf cfg.enable { + assertions = [ + (lib.hm.assertions.assertPlatform "programs.streamer" pkgs lib.platforms.linux) + ]; + + home.packages = [ cfg.package ]; + + xdg.configFile."streamer/config.yaml".source = + (pkgs.formats.yaml { }).generate "streamer-configuration" + { + base_folder = cfg.base-folder; + }; + + home.shellAliases.s = "streamer"; + }; + }; + # Package a virtual environment as our main application. # # Enable no optional dependencies for production build.