Skip to content

Commit

Permalink
hyfetch: init at 1.99.0-unstable-2024-10-23 (#118)
Browse files Browse the repository at this point in the history
* hyfetch: init at 1.99.0-unstable-2024-10-23

* neowofetch: only enable x11 support by default on linux

* ci: don't check all systems

some packages are broken by deps on lower tier platforms. ci doesn't
need to fail over them
  • Loading branch information
getchoo authored Oct 24, 2024
1 parent 95a40f4 commit f9516c0
Show file tree
Hide file tree
Showing 3 changed files with 156 additions and 4 deletions.
13 changes: 9 additions & 4 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,12 @@ jobs:
name: getchoo
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}

- name: Evaluate flake
run: |
nix flake check \
--no-build \
--show-trace
- name: Run build
run: |
nix run \
Expand All @@ -60,7 +66,7 @@ jobs:
--systems '${{ matrix.system }}' \
--option accept-flake-config true \
--option allow-import-from-derivation false \
--flake '.#packages'
--flake '.#packages.${{ matrix.system }}'
check:
name: Check flake
Expand All @@ -77,10 +83,9 @@ jobs:
- name: Run check
run: |
nix flake check \
--all-systems \
--accept-flake-config \
--print-build-logs \
--show-trace \
--accept-flake-config
--show-trace
build-gate:
name: Build gate
Expand Down
92 changes: 92 additions & 0 deletions pkgs/hyfetch/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
{
lib,
fastfetch,
fetchFromGitHub,
installShellFiles,
macchina,
makeBinaryWrapper,
neowofetch,
rustPlatform,
unstableGitUpdater,
withAutocomplete ? true,
withColor ? true,
withFastfetch ? true,
withMacchina ? true,
}:

let
binPath = [
neowofetch
] ++ lib.optional withFastfetch fastfetch ++ lib.optional withMacchina macchina;
in
rustPlatform.buildRustPackage rec {
pname = "hyfetch";
version = "1.99.0-unstable-2024-10-23";

src = fetchFromGitHub {
owner = "hykilpikonna";
repo = "hyfetch";
rev = "b5b49ecbc095ac20e49c0783121c885752df9001";
hash = "sha256-W1oMzLACGDvcl8du4L3TuUn79i6HFUFuPEJhc3IPD0E=";
};

# https://github.com/hykilpikonna/hyfetch/pull/361
#
# Upstream will call `neowofetch` with Bash (from the PATH) by default
# We know `neowofetch` has a shebang though, so run it directly to avoid
# adding Bash to the wrapper
#
# Yes, this introduces 2 warnings
postPatch = ''
substituteInPlace crates/hyfetch/src/neofetch_util.rs \
--replace-fail 'command.arg(neofetch_path)' 'let mut command = Command::new(neofetch_path)'
'';

cargoHash = "sha256-4Tz6hqzjlCT5PSa1AzWGU6mBHWxMcsJm9+Uzmsvurps=";

strictDeps = true;

nativeBuildInputs = [
installShellFiles
makeBinaryWrapper
];

cargoBuildNoDefaultFeatures = true;
cargoBuildFeatures =
lib.optional withAutocomplete "autocomplete"
++ lib.optional withColor "color"
++ lib.optional withMacchina "macchina";

cargoBuildFlags = [ "--package hyfetch" ];
cargoTestFlags = cargoBuildFlags;

postInstall = ''
installManPage docs/hyfetch.1
'';

postFixup = ''
wrapProgram "$out"/bin/hyfetch \
--prefix PATH : ${lib.makeBinPath binPath}
'';

passthru = {
updateScript = unstableGitUpdater { };
};

meta = {
description = "neofetch with pride flags <3";
longDescription = ''
HyFetch is a command-line system information tool fork of neofetch.
HyFetch displays information about your system next to your OS logo
in ASCII representation. The ASCII representation is then colored in
the pattern of the pride flag of your choice. The main purpose of
HyFetch is to be used in screenshots to show other users what
operating system or distribution you are running, what theme or
icon set you are using, etc.
'';
homepage = "https://github.com/hykilpikonna/HyFetch";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ getchoo ];
mainProgram = "hyfetch";
};
}
55 changes: 55 additions & 0 deletions pkgs/neowofetch/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{
lib,
bash,
hyfetch,
installShellFiles,
makeBinaryWrapper,
pciutils,
stdenvNoCC,
ueberzug,
withX11Support ? stdenvNoCC.hostPlatform.isLinux,
}:

stdenvNoCC.mkDerivation (finalAttrs: {
pname = "neowofetch";

inherit (hyfetch) version src;

strictDeps = true;

nativeBuildInputs = [
installShellFiles
makeBinaryWrapper
];

buildInputs = [ bash ];

dontConfigure = true;
dontBuild = true;

postInstall = ''
mv {neo,neowo}fetch
installBin neowofetch
mv docs/{neo,neowo}fetch.1
installManPage docs/neowofetch.1
'';

postFixup = ''
wrapProgram "$out"/bin/neowofetch \
--prefix PATH : ${lib.makeBinPath finalAttrs.passthru.binPath}
'';

passthru = {
binPath = [ pciutils ] ++ lib.optional withX11Support ueberzug;
};

meta = {
description = "Fast, highly customizable system info script (Maintained fork)";
homepage = "https://github.com/hykilpikonna/hyfetch";
changelog = "https://github.com/hykilpikonna/hyfetch/releases/tag/${finalAttrs.version}";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ getchoo ];
mainProgram = "neowofetch";
};
})

0 comments on commit f9516c0

Please sign in to comment.