hinoirisetr 1.2.3

A daemon to dim the screen at night
Documentation
{
  description = "DevShell for hinoirisetr";

  inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
    flake-utils.url = "github:numtide/flake-utils";
    rust-overlay.url = "github:oxalica/rust-overlay";
  };

  outputs =
    {
      nixpkgs,
      rust-overlay,
      flake-utils,
      ...
    }:
    flake-utils.lib.eachDefaultSystem (
      system:
      let
        overlays = [ (import rust-overlay) ];
        pkgs = import nixpkgs {
          inherit system overlays;
        };
        rust = pkgs.rust-bin.stable.latest.default.override {
          extensions = [
            "rust-analyzer"
            "rust-src"
          ];
        };
      in
      {
        devShells.default = pkgs.mkShell rec {
          buildInputs = [
            rust
            pkgs.libnotify
            pkgs.pandoc
          ];

          shellHook = ''
            export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${builtins.toString (pkgs.lib.makeLibraryPath buildInputs)}";
          '';
        };

        packages.default = pkgs.rustPlatform.buildRustPackage {
          pname = "hinoirisetr";
          version = "1.2.1";

          src = ./.;

          cargoLock = {
            lockFile = ./Cargo.lock;
          };

          postFixup = ''
            patchelf $out/bin/hinoirisetr --add-rpath ${pkgs.libnotify}/lib
          '';

          postBuild = ''
            pandoc manpages/hinoirisetr.1.md -s -t man -o $out/share/man/man1/hinoirisetr.1
          '';

          preBuild = ''
            mkdir -p $out/share/man/man1
          '';

          nativeBuildInputs = [ pkgs.pandoc ];
          buildInputs = [ pkgs.libnotify ];
        };
      }
    );
}