This commit is contained in:
cy 2024-12-09 02:14:11 -05:00
parent 204034fac2
commit d45a4f2358
5 changed files with 60 additions and 106 deletions

View file

@ -1,15 +1,15 @@
{ { fetchurl
fetchurl, , stdenv
stdenv, , lib
lib, , buildFHSEnv
buildFHSEnv, , appimageTools
appimageTools, , writeShellScript
writeShellScript, , anki
anki, , undmg
undmg, , zstd
zstd, , cacert
cacert, , commandLineArgs ? [ ]
commandLineArgs ? [ ], ,
}: }:
let let

View file

@ -16,14 +16,16 @@
outputs = { self, nixpkgs, sops-nix, home-manager, ... }@inputs: outputs = { self, nixpkgs, sops-nix, home-manager, ... }@inputs:
let let
lib = nixpkgs.lib; lib = nixpkgs.lib;
in { in
{
nixosConfigurations = { nixosConfigurations = {
ytnix = lib.nixosSystem { ytnix = lib.nixosSystem {
specialArgs = { inherit inputs; }; specialArgs = { inherit inputs; };
modules = [ modules = [
./configuration.nix ./configuration.nix
sops-nix.nixosModules.sops sops-nix.nixosModules.sops
home-manager.nixosModules.home-manager { home-manager.nixosModules.home-manager
{
home-manager = { home-manager = {
useGlobalPkgs = true; useGlobalPkgs = true;
useUserPackages = true; useUserPackages = true;
@ -33,5 +35,6 @@
]; ];
}; };
}; };
formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.nixpkgs-fmt;
}; };
} }

View file

@ -10,7 +10,8 @@
boot.extraModulePackages = [ ]; boot.extraModulePackages = [ ];
fileSystems."/" = fileSystems."/" =
{ device = "/dev/disk/by-uuid/17870658-6118-46af-837f-70c9175e09c3"; {
device = "/dev/disk/by-uuid/17870658-6118-46af-837f-70c9175e09c3";
fsType = "btrfs"; fsType = "btrfs";
options = [ "subvol=root" "compress=zstd" ]; options = [ "subvol=root" "compress=zstd" ];
}; };
@ -18,25 +19,29 @@
boot.initrd.luks.devices."cryptroot".device = "/dev/disk/by-uuid/c6098a16-c8a6-4a97-8648-6f46ca919d13"; boot.initrd.luks.devices."cryptroot".device = "/dev/disk/by-uuid/c6098a16-c8a6-4a97-8648-6f46ca919d13";
fileSystems."/home" = fileSystems."/home" =
{ device = "/dev/disk/by-uuid/17870658-6118-46af-837f-70c9175e09c3"; {
device = "/dev/disk/by-uuid/17870658-6118-46af-837f-70c9175e09c3";
fsType = "btrfs"; fsType = "btrfs";
options = [ "subvol=home" "compress=zstd" ]; options = [ "subvol=home" "compress=zstd" ];
}; };
fileSystems."/nix" = fileSystems."/nix" =
{ device = "/dev/disk/by-uuid/17870658-6118-46af-837f-70c9175e09c3"; {
device = "/dev/disk/by-uuid/17870658-6118-46af-837f-70c9175e09c3";
fsType = "btrfs"; fsType = "btrfs";
options = [ "subvol=nix" "compress=zstd" "noatime" ]; options = [ "subvol=nix" "compress=zstd" "noatime" ];
}; };
fileSystems."/swap" = fileSystems."/swap" =
{ device = "/dev/disk/by-uuid/17870658-6118-46af-837f-70c9175e09c3"; {
device = "/dev/disk/by-uuid/17870658-6118-46af-837f-70c9175e09c3";
fsType = "btrfs"; fsType = "btrfs";
options = [ "subvol=swap" ]; options = [ "subvol=swap" ];
}; };
fileSystems."/boot" = fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/29B7-F46D"; {
device = "/dev/disk/by-uuid/29B7-F46D";
fsType = "vfat"; fsType = "vfat";
options = [ "fmask=0022" "dmask=0022" ]; options = [ "fmask=0022" "dmask=0022" ];
}; };

View file

@ -1,54 +0,0 @@
{
lib,
stdenv,
buildNpmPackage,
fetchFromGitHub,
chromium,
python3,
}:
buildNpmPackage {
pname = "single-file-cli";
version = "2.0.73";
src = fetchFromGitHub {
owner = "gildas-lormeau";
repo = "single-file-cli";
rev = "0b87ca9167f6cb2b036770d38e9b6bbfaf47abc5";
hash = "sha256-fMedP+wp1crHUj9/MVyG8XSsl1PA5bp7/HL4k+X0TRg=";
};
npmDepsHash = "sha256-nnOMBb9mHNhDejE3+Kl26jsrTRxSSg500q1iwwVUqP8=";
nativeCheckInputs = [chromium];
doCheck = stdenv.hostPlatform.isLinux;
postBuild = ''
patchShebangs ./single-file
'';
checkPhase = ''
runHook preCheck
${python3}/bin/python -m http.server --bind 127.0.0.1 &
pid=$!
./single-file \
--browser-headless \
--browser-executable-path chromium-browser\
http://127.0.0.1:8000
grep -F 'Page saved with SingleFile' 'Directory listing for'*.html
kill $pid
wait
runHook postCheck
'';
meta = {
description = "CLI tool for saving a faithful copy of a complete web page in a single HTML file";
homepage = "https://github.com/gildas-lormeau/single-file-cli";
license = lib.licenses.agpl3Only;
maintainers = with lib.maintainers; [n8henrie];
mainProgram = "single-file";
};
}