commit a8f30ffeb7c4023d5031854b0a7e7e41b495656e Author: Mikael Voss Date: Thu Nov 21 00:48:29 2024 +0100 Initial import diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a3d6222 --- /dev/null +++ b/.gitignore @@ -0,0 +1,7 @@ +# Hidden files +.* +!.git* + +# Nix +/result +/result-* diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..783699c --- /dev/null +++ b/flake.lock @@ -0,0 +1,134 @@ +{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flakey-profile": { + "locked": { + "lastModified": 1712898590, + "narHash": "sha256-FhGIEU93VHAChKEXx905TSiPZKga69bWl1VB37FK//I=", + "owner": "lf-", + "repo": "flakey-profile", + "rev": "243c903fd8eadc0f63d205665a92d4df91d42d9d", + "type": "github" + }, + "original": { + "owner": "lf-", + "repo": "flakey-profile", + "type": "github" + } + }, + "lix": { + "flake": false, + "locked": { + "lastModified": 1732056932, + "narHash": "sha256-3ubtSu0D+BUV5FKmBU7kTEXlI/okp/j1xC/ODC7LgTA=", + "rev": "b0d7a816135de1cd551b8a54f5497148bf59d81d", + "type": "tarball", + "url": "https://git.lix.systems/api/v1/repos/lix-project/lix/archive/b0d7a816135de1cd551b8a54f5497148bf59d81d.tar.gz?rev=b0d7a816135de1cd551b8a54f5497148bf59d81d" + }, + "original": { + "type": "tarball", + "url": "https://git.lix.systems/lix-project/lix/archive/main.tar.gz" + } + }, + "lix-module": { + "inputs": { + "flake-utils": "flake-utils", + "flakey-profile": "flakey-profile", + "lix": [ + "neoidiosyn", + "lix" + ], + "nixpkgs": [ + "neoidiosyn", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1731967274, + "narHash": "sha256-n6dPGRlMGdL8X5gviA6ZuRfUdbdD5KiNN/BpABA5YT0=", + "rev": "aa2846680fa9a2032939d720487942567fd9eb63", + "type": "tarball", + "url": "https://git.lix.systems/api/v1/repos/lix-project/nixos-module/archive/aa2846680fa9a2032939d720487942567fd9eb63.tar.gz?rev=aa2846680fa9a2032939d720487942567fd9eb63" + }, + "original": { + "type": "tarball", + "url": "https://git.lix.systems/lix-project/nixos-module/archive/main.tar.gz" + } + }, + "neoidiosyn": { + "inputs": { + "lix": "lix", + "lix-module": "lix-module", + "nixpkgs": "nixpkgs" + }, + "locked": { + "lastModified": 1732218822, + "narHash": "sha256-lB4w8JI5U6Fh+0ueKzFuluX1o4NxIg8BQNQAiesCXUw=", + "ref": "refs/heads/main", + "rev": "d165a27ec391aca1b4e347186b17dafaa006f93b", + "revCount": 1, + "type": "git", + "url": "https://woof.rip/mikael/neoidiosyn.git" + }, + "original": { + "type": "git", + "url": "https://woof.rip/mikael/neoidiosyn.git" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1731890469, + "narHash": "sha256-D1FNZ70NmQEwNxpSSdTXCSklBH1z2isPR84J6DQrJGs=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "5083ec887760adfe12af64830a66807423a859a7", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "neoidiosyn": "neoidiosyn" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..c292846 --- /dev/null +++ b/flake.nix @@ -0,0 +1,70 @@ +{ + inputs = { + neoidiosyn.url = "git+https://woof.rip/mikael/neoidiosyn.git"; + }; + + outputs = { self, neoidiosyn, ... }: let + inherit (neoidiosyn) lib; + in { + packages = lib.mapAttrs (system: pkgs: { + default = pkgs.callPackage ({ writeShellApplication, ffmpeg }: writeShellApplication { + name = "avif-preview"; + text = '' + w="''${1:-1280}" + h="''${2:-720}" + + exec ${lib.getExe ffmpeg} \ + -loglevel error \ + -hide_banner \ + -nostats \ + -i - \ + -map 0:v:0 \ + -frames:v 1 \ + -hwaccel:v auto \ + -filter:v "scale=w=min($w\\,iw):h=min($h\\,ih):interl=-1:force_original_aspect_ratio=decrease" \ + -pix_fmt yuva420p \ + -codec:v libsvtav1 \ + -svtav1-params tune2:enable-variance-boost=1:enable-overlays=1:enable-qm=1:qm-min=0:enable-tf=1 \ + -f avif \ + - + ''; + }) { + ffmpeg = pkgs.ffmpeg.override { + ffmpegVariant = "headless"; + + withAlsa = false; + withAom = false; + withAss = false; + withCodec2 = false; + withFontconfig = false; + withFreetype = false; + withGme = false; + withHarfbuzz = false; + withIconv = false; + withJxl = true; + withOpus = false; + withPlacebo = false; + withRist = false; + withSoxr = false; + withTheora = false; + withV4l2 = false; + withVoAmrwbenc = false; + withVorbis = false; + + withNetwork = false; + withBin = false; + buildFfmpeg = true; + withLib = false; + withDocumentation = false; + withStripping = true; + + svt-av1 = pkgs.svt-av1-psy; + }; + }; + }) neoidiosyn.legacyPackages; + + hydraJobs = lib.mapAttrs (system: packages: { + default = lib.hydraJob packages.default; + }) self.packages; + }; +}