Merge pull request #3 from lost-rob0t/master

nixos flake
This commit is contained in:
Tyler Perkins 2024-01-28 20:09:44 -05:00 committed by GitHub
commit 111d396538
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 110 additions and 0 deletions

61
flake.lock generated Normal file
View File

@ -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
}

49
flake.nix Normal file
View File

@ -0,0 +1,49 @@
{
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;
};
rss-cli = (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 = rss-cli;
devShell = pkgs.mkShell {
buildInputs = [
rss-cli
];
};
}
);
}