Compare commits

..

No commits in common. "95063ba566db81a0a40e49d9ba02060a93087562" and "ba20ea4e2aed4acc6047c23527ada1ad83670350" have entirely different histories.

4 changed files with 17 additions and 33 deletions

2
Cargo.lock generated
View file

@ -1,6 +1,6 @@
# This file is automatically @generated by Cargo. # This file is automatically @generated by Cargo.
# It is not intended for manual editing. # It is not intended for manual editing.
version = 3 version = 4
[[package]] [[package]]
name = "adler" name = "adler"

View file

@ -3,22 +3,18 @@
inputs = { inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
}; };
outputs = outputs = { self, nixpkgs }@inputs:
{
self,
nixpkgs,
}@inputs:
let let
supportedSystems = [ "x86_64-linux" ]; supportedSystems = [ "x86_64-linux" ];
forAllSystems = nixpkgs.lib.genAttrs supportedSystems; forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
# I improved how you call in packages #v I improved how you call in packages
pkgs = forAllSystems ( pkgs = forAllSystems (system:
system:
import nixpkgs { import nixpkgs {
inherit system; inherit system;
#v this can be adjusted to read args passed without impure later #v this can be adjusted to read args passed without impure later
config = { config = { allowUnfreePredicate = pkg: builtins.elem (nixpkgs.lib.getName pkg) [
allowUnfree = true; "unrar"
];
}; };
} }
); );
@ -31,8 +27,8 @@
default = pkgs.${system}.callPackage ./nix/devshell.nix { }; default = pkgs.${system}.callPackage ./nix/devshell.nix { };
}); });
nixConfig = { nixConfig = {
# I would have like this to work but it requires the nix user to set an option. #v I would have like this to work but it requires the nix user to set an option.
allowUnfree = true; allowUnfree = true;
}; };
}; };
} }

View file

@ -1,23 +1,11 @@
{ { pkgs ? import <nixpkgs> { }, lib }:
unrar,
xz,
pkg-config,
rustPlatform,
lib,
}:
rustPlatform.buildRustPackage { pkgs.rustPlatform.buildRustPackage rec {
pname = "sk_extract"; pname = "sk_extract";
version = "0.1.0"; version = "0.1.0";
cargoLock.lockFile = ../Cargo.lock; cargoLock.lockFile = ../Cargo.lock;
src = lib.cleanSource ../.; src = pkgs.lib.cleanSource ../.;
buildInputs = [ buildInputs = [ pkgs.xz pkgs.unrar ];
xz nativeBuildInputs = [ pkgs.xz pkgs.pkg-config ];
unrar # doCheck = false;
]; }
nativeBuildInputs = [
xz
pkg-config
];
doCheck = false;
}

View file

@ -396,7 +396,7 @@ pub fn extract_deb(input_path: &Path,) -> Result<(),io::Error>{
let mut entry = entry_result.unwrap(); let mut entry = entry_result.unwrap();
// Create a new file with the same name as the archive entry: // Create a new file with the same name as the archive entry:
let mut file = File::create( let mut file = File::create(
std::str::from_utf8(entry.header().identifier()).unwrap(), str::from_utf8(entry.header().identifier()).unwrap(),
).unwrap(); ).unwrap();
// The Entry object also acts as an io::Read, so we can easily copy the // The Entry object also acts as an io::Read, so we can easily copy the
// contents of the archive entry into the file: // contents of the archive entry into the file: