aboutsummaryrefslogtreecommitdiff
path: root/flake.nix
diff options
context:
space:
mode:
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix54
1 files changed, 54 insertions, 0 deletions
diff --git a/flake.nix b/flake.nix
new file mode 100644
index 0000000..403a9d5
--- /dev/null
+++ b/flake.nix
@@ -0,0 +1,54 @@
+{
+ description = "pdiscidurl - print the MusicBrainz submission URL for a disc";
+
+ inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
+
+ outputs =
+ { self, nixpkgs }:
+ let
+ systems = [ "x86_64-linux" ];
+
+ forAllSystems = f: nixpkgs.lib.genAttrs systems (system: f nixpkgs.legacyPackages.${system});
+
+ pdiscidurl =
+ {
+ lib,
+ stdenv,
+ pkg-config,
+ libdiscid,
+ }:
+ stdenv.mkDerivation {
+ pname = "pdiscidurl";
+ version = "0-unstable-${self.shortRev or self.dirtyShortRev or "dirty"}";
+
+ src = ./.;
+
+ nativeBuildInputs = [ pkg-config ];
+ buildInputs = [ libdiscid ];
+
+ makeFlags = [ "PREFIX=$(out)" ];
+
+ meta = {
+ mainProgram = "pdiscidurl";
+ license = lib.licenses.lgpl21Plus;
+ # TODO: test if I ever need on another platform
+ platforms = lib.platforms.linux;
+ };
+ };
+ in
+ {
+ packages = forAllSystems (pkgs: {
+ default = pkgs.callPackage pdiscidurl { };
+ });
+
+ overlays.default = final: prev: {
+ pdiscidurl = final.callPackage pdiscidurl { };
+ };
+
+ devShells = forAllSystems (pkgs: {
+ default = pkgs.mkShell {
+ inputsFrom = [ (pkgs.callPackage pdiscidurl { }) ];
+ };
+ });
+ };
+}