-
Notifications
You must be signed in to change notification settings - Fork 1
/
flake.nix
33 lines (31 loc) · 1.03 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
{
description = "Kaomoji Generator";
inputs.flake-utils.url = "github:numtide/flake-utils";
inputs.mods.url = "github:OleMussmann/mods";
outputs = { self, nixpkgs, flake-utils, mods }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
my-name = "kaomoji";
mods_bin = mods.packages.${system}.default;
dependencies = with pkgs; [ mods_bin gum xclip ];
kaomoji = (pkgs.writeScriptBin my-name (builtins.readFile ./kaomoji.sh)).overrideAttrs(old: {
buildCommand = "${old.buildCommand}\n patchShebangs $out";
});
in rec {
packages.default = packages.kaomoji;
packages.kaomoji = pkgs.symlinkJoin {
name = my-name;
paths = [ kaomoji ];
buildInputs = [ pkgs.makeWrapper ];
postBuild =
let
dependency_path = pkgs.lib.makeBinPath dependencies;
in
''
wrapProgram "$out/bin/${my-name}" --prefix PATH : "$out/bin:${dependency_path}"
'';
};
}
);
}