diff --git a/.gitignore b/.gitignore index d75e8f6..c0cf45a 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ maim-utils-*.tar.gz +result diff --git a/default.nix b/default.nix new file mode 100644 index 0000000..18d342c --- /dev/null +++ b/default.nix @@ -0,0 +1,20 @@ +{ stdenv, scdoc, pipe-viewer, ...}: +stdenv.mkDerivation rec { + pname = "maim-utils"; + version = "v1.0"; + + src = ./.; + + buildInputs = [ scdoc ]; + + buildPhase = '' + scdoc < ${pname}.1.scd > ${pname}.1 + ''; + + installPhase = '' + mkdir -p $out/bin $out/share/{man/man1,zsh/site-functions} + cp ${pname} $out/bin/ + cp ${pname}.1 $out/share/man/man1/ + cp zsh.completion $out/share/zsh/site-functions/_${pname} + ''; +} diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..ba3ed4f --- /dev/null +++ b/flake.lock @@ -0,0 +1,26 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1693183237, + "narHash": "sha256-c7OtyBkZ/vZE/WosBpRGRtkbWZjDHGJP7fg1FyB9Dsc=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "ea5234e7073d5f44728c499192544a84244bf35a", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "ref": "nixos-23.05", + "type": "indirect" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..34dbcce --- /dev/null +++ b/flake.nix @@ -0,0 +1,14 @@ +{ + description = "Pipe-viewer-and-mpv wrapper"; + + inputs.nixpkgs.url = "nixpkgs/nixos-23.05"; + outputs = {self, nixpkgs }: + let + system = "x86_64-linux"; + pkgs = import nixpkgs { inherit system; }; + in { + packages.${system} = { + default = pkgs.callPackage ./default.nix {}; + }; + }; +}