-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
42 lines (40 loc) · 1.3 KB
/
flake.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
{
description = "Display cute sharks in your terminal :3";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
systems.url = "github:nix-systems/default";
};
outputs = inputs @ {flake-parts, ...}:
flake-parts.lib.mkFlake {inherit inputs;} {
# https://github.com/nix-systems/nix-systems
systems = import inputs.systems;
perSystem = {pkgs, ...}: let
inherit (inputs.nixpkgs) lib;
in {
packages.default = let
blahaj-assets = pkgs.stdenv.mkDerivation {
name = "blahaj-assets";
src = lib.cleanSourceWith {
filter = name: _: let
baseName = baseNameOf (toString name);
in
! (lib.hasSuffix ".nix" baseName);
src = lib.cleanSource ./assets;
};
installPhase = ''
runHook preInstall
mkdir -p $out/usr/share/uwu
cp $src/* $out/usr/share/uwu
runHook postInstall
'';
};
in
pkgs.writeShellScriptBin ":3" ''
#!/bin/sh
img=$(find ${blahaj-assets}/usr/share/uwu -type f | shuf -n 1)
${pkgs.libsixel}/bin/img2sixel $img -w 300
'';
};
};
}