2023-12-03 10:17:55 -06:00
|
|
|
{
|
|
|
|
description = "figureine";
|
|
|
|
|
|
|
|
inputs = {
|
|
|
|
nixpkgs = {
|
2024-12-09 19:25:38 -06:00
|
|
|
url = "nixpkgs/nixos-24.11";
|
2023-12-03 10:17:55 -06:00
|
|
|
};
|
|
|
|
flake-utils = {
|
|
|
|
url = "github:numtide/flake-utils";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
outputs = {
|
|
|
|
self,
|
|
|
|
nixpkgs,
|
|
|
|
flake-utils,
|
|
|
|
...
|
2024-12-09 19:25:38 -06:00
|
|
|
}:
|
2023-12-03 10:17:55 -06:00
|
|
|
flake-utils.lib.eachDefaultSystem
|
|
|
|
(
|
|
|
|
system: let
|
|
|
|
pkgs = import nixpkgs {
|
|
|
|
inherit system;
|
|
|
|
};
|
|
|
|
in {
|
|
|
|
packages = {
|
|
|
|
figurine = let
|
|
|
|
pname = "figurine";
|
|
|
|
version = "1.3.0";
|
|
|
|
hash = "sha256-1q6Y7oEntd823nWosMcKXi6c3iWsBTxPnSH4tR6+XYs=";
|
|
|
|
vendorHash = "sha256-mLdAaYkQH2RHcZft27rDW1AoFCWKiUZhh2F0DpqZELw=";
|
|
|
|
src = pkgs.fetchFromGitHub {
|
|
|
|
inherit hash;
|
|
|
|
owner = "arsham";
|
|
|
|
repo = pname;
|
|
|
|
rev = "refs/tags/v${version}";
|
|
|
|
};
|
|
|
|
in
|
2024-12-09 19:25:38 -06:00
|
|
|
pkgs.buildGoModule {
|
2023-12-03 10:17:55 -06:00
|
|
|
inherit pname src version vendorHash;
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "";
|
|
|
|
homepage = "";
|
|
|
|
changelog = "";
|
|
|
|
license = pkgs.lib.licenses.asl20;
|
|
|
|
mainProgram = pname;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|
|
|
|
)
|
|
|
|
// {
|
|
|
|
nixosModules.figurine = {
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
pkgs,
|
|
|
|
...
|
|
|
|
}: let
|
|
|
|
cfg = config.services.figurine;
|
|
|
|
in {
|
|
|
|
options = {
|
|
|
|
services.figurine = lib.mkOption {
|
|
|
|
type = lib.types.submodule {
|
|
|
|
options = {
|
|
|
|
enable = lib.mkEnableOption "Enable figurine";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
config = lib.mkIf cfg.enable {
|
|
|
|
environment.etc = {
|
|
|
|
"fish/conf.d/figurine.fish".text = ''
|
|
|
|
status is-login; and begin
|
|
|
|
${self.packages.${pkgs.system}.figurine}/bin/figurine --font 3d.flf ${config.networking.hostName}
|
|
|
|
end
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
programs.bash.interactiveShellInit = ''
|
|
|
|
if [ $SHLVL -eq 1 ]
|
|
|
|
then
|
|
|
|
${self.packages.${pkgs.system}.figurine}/bin/figurine --font 3d.flf ${config.networking.hostName}
|
|
|
|
fi
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|