diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..6be6102 --- /dev/null +++ b/flake.lock @@ -0,0 +1,61 @@ +{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1705309234, + "narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1706191920, + "narHash": "sha256-eLihrZAPZX0R6RyM5fYAWeKVNuQPYjAkCUBr+JNvtdE=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "ae5c332cbb5827f6b1f02572496b141021de335f", + "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 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..fc3be41 --- /dev/null +++ b/flake.nix @@ -0,0 +1,50 @@ +{ + inputs = { + nixpkgs = { + url = "github:nixos/nixpkgs/nixos-unstable"; + }; + flake-utils = { + url = "github:numtide/flake-utils"; + }; + }; + outputs = { nixpkgs, flake-utils, ... }: flake-utils.lib.eachDefaultSystem (system: + let + pkgs = import nixpkgs { + inherit system; + }; + mousetrap = (with pkgs; stdenv.mkDerivation { + pname = "rss-cli"; + version = "master"; + src = fetchgit { + url = "https://github.com/Clortox/rss-cli"; + rev = "e28bb8f66e941274b02cbc5ac5f28483bc26d588"; + sha256 = "sha256-AWFkgIOrNjfdBAWa1EC5J26SP4EH3RfkXosRXpe3yPI="; + }; + nativeBuildInputs = [ + pkg-config + ]; + buildInputs = [ + curl.dev + rapidxml + ]; + buildPhase = "make all -j $NIX_BUILD_CORES"; + installPhase = '' + mkdir --parents "$out/bin" + cp bin/* $out/bin + ''; + } + ); + in rec { + defaultApp = flake-utils.lib.mkApp { + drv = defaultPackage; + }; + defaultPackage = mousetrap; + devShell = pkgs.mkShell { + buildInputs = [ + mousetrap + pkgs.libnotify + ]; + }; + } + ); +}