diff --git a/host/x86_64-linux/home/Network.nix b/host/x86_64-linux/home/Network.nix index a4fb79a..9edb33a 100644 --- a/host/x86_64-linux/home/Network.nix +++ b/host/x86_64-linux/home/Network.nix @@ -194,7 +194,7 @@ in # Public SSH access. # ip46tables -I INPUT -j ACCEPT -i ${wan} -p tcp --dport 22143 - ''; + ''; }; }; } diff --git a/option/Wallpaper.nix b/option/Wallpaper.nix index 654baac..6d2e12a 100644 --- a/option/Wallpaper.nix +++ b/option/Wallpaper.nix @@ -22,14 +22,15 @@ let scheme = null; # Extract image from video. - videoImage = + videoPath = if video then pkgs.fetchurl { inherit url sha256; } else null; + image = if video then pkgs.runCommandNoCC "wallpaper-video-image" { } '' - ${pkgs.ffmpeg}/bin/ffmpeg -hide_banner -loglevel error -ss 00:00:00 -i ${cfg.videoPath} -frames:v 1 -q:v 1 Image.jpg + ${pkgs.ffmpeg}/bin/ffmpeg -hide_banner -loglevel error -ss 00:00:00 -i ${videoPath} -frames:v 1 -q:v 1 Image.jpg cp Image.jpg $out '' else - null; + pkgs.fetchurl { inherit url sha256; }; in { options.module.wallpaper = { @@ -38,7 +39,7 @@ in type = lib.types.bool; }; path = lib.mkOption { - default = if video then videoImage else pkgs.fetchurl { inherit url sha256; }; + default = image; type = lib.types.path; }; video = lib.mkOption { @@ -46,7 +47,7 @@ in type = lib.types.bool; }; videoPath = lib.mkOption { - default = if video then pkgs.fetchurl { inherit url sha256; } else null; + default = videoPath; type = with lib.types; nullOr path; }; scheme = lib.mkOption {