commit f0ade0d043cbcf59fc1913e8317beb8d6479d6ea Author: Xaiya Schumin Date: Wed May 20 00:20:04 2026 +0200 ✨ add discord-music-presence Signed-off-by: Xaiya Schumin diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..0327fb6 --- /dev/null +++ b/.envrc @@ -0,0 +1,6 @@ +if has nix_direnv_version; then + watch_file modules/flake/shell.nix + + # now we want to load the flake environment + use flake +fi \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..33a9b94 --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +### Nix template + +# Ignore build outputs from performing a nix-build or `nix build` command +result +result-* + +# Ignore the configuration folder for Jetbrains IDEs +.idea/ + +# Development environment +.direnv/ + +# Disable vm outputs that are called when starting a vm in this directory +*.qcow +*.qcow2 \ No newline at end of file diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..8c95fc0 --- /dev/null +++ b/flake.lock @@ -0,0 +1,27 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1778869304, + "narHash": "sha256-30sZNZoA1cqF5JNO9fVX+wgiQYjB7HJqqJ4ztCDeBZE=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "d233902339c02a9c334e7e593de68855ad26c4cb", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..e1f9343 --- /dev/null +++ b/flake.nix @@ -0,0 +1,37 @@ +{ + description = "Xaiya's packaged packages"; + + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; + }; + + outputs = + { self, nixpkgs }: + let + inherit (nixpkgs) lib; + + eachSystem = + systems: fn: + lib.foldl' ( + acc: system: lib.recursiveUpdate acc (lib.mapAttrs (_: value: { ${system} = value; }) (fn system)) + ) { } systems; + + systems = lib.systems.flakeExposed; + in + eachSystem systems ( + system: + let + pkgs = nixpkgs.legacyPackages.${system}; + in + { + # TODO: add logic for packages + packages = { + discord-music-presence = pkgs.callPackage ./pkgs/discord-music-presence.nix { }; + }; + + devShells = { + default = pkgs.callPackage ./shell.nix { }; + }; + } + ); +} diff --git a/pkgs/discord-music-presence.nix b/pkgs/discord-music-presence.nix new file mode 100644 index 0000000..ef9c9e1 --- /dev/null +++ b/pkgs/discord-music-presence.nix @@ -0,0 +1,29 @@ +{ + lib, + stdenv, + fetchurl, + appimageTools, +}: +let + version = "2.3.5"; + pname = "discord-music-presence"; + + src = fetchurl { + url = "https://github.com/ungive/discord-music-presence/releases/download/v${version}/musicpresence-${version}-linux-x86_64.AppImage"; + hash = "sha256-M7oDxVevspA3SGuHktS8ChQAYopgIqypiVlzyE4uyqI="; + }; + + appimageContents = appimageTools.extractType1 { inherit src; name = pname; }; + +in +appimageTools.wrapType2 rec { + inherit pname version src; + + meta = { + description = "The Discord music status that works with any media player"; + homepage = "https://github.com/ungive/discord-music-presence"; + license = lib.licenses.unfreeRedistributable; + maintainers = with lib.maintainers; [ ]; + mainProgram = "discord-music-presence"; + }; +} diff --git a/shell.nix b/shell.nix new file mode 100644 index 0000000..ec7b15a --- /dev/null +++ b/shell.nix @@ -0,0 +1,12 @@ +{ + mkShell, + callPackage, +}: +let + defaultPackage = callPackage ./pkgs/discord-music-presence.nix { }; +in +mkShell { + inputsFrom = [ defaultPackage ]; + + packages = [ ]; +}