Compare commits
3 commits
ba20ea4e2a
...
95063ba566
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
95063ba566 | ||
|
|
a589331d4b | ||
|
|
a2dee988be |
4 changed files with 33 additions and 17 deletions
2
Cargo.lock
generated
2
Cargo.lock
generated
|
|
@ -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 = 4
|
version = 3
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "adler"
|
name = "adler"
|
||||||
|
|
|
||||||
20
flake.nix
20
flake.nix
|
|
@ -3,18 +3,22 @@
|
||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||||
};
|
};
|
||||||
outputs = { self, nixpkgs }@inputs:
|
outputs =
|
||||||
|
{
|
||||||
|
self,
|
||||||
|
nixpkgs,
|
||||||
|
}@inputs:
|
||||||
let
|
let
|
||||||
supportedSystems = [ "x86_64-linux" ];
|
supportedSystems = [ "x86_64-linux" ];
|
||||||
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
|
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
|
||||||
#v I improved how you call in packages
|
# I improved how you call in packages
|
||||||
pkgs = forAllSystems (system:
|
pkgs = forAllSystems (
|
||||||
|
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 = { allowUnfreePredicate = pkg: builtins.elem (nixpkgs.lib.getName pkg) [
|
config = {
|
||||||
"unrar"
|
allowUnfree = true;
|
||||||
];
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
@ -27,8 +31,8 @@
|
||||||
default = pkgs.${system}.callPackage ./nix/devshell.nix { };
|
default = pkgs.${system}.callPackage ./nix/devshell.nix { };
|
||||||
});
|
});
|
||||||
nixConfig = {
|
nixConfig = {
|
||||||
#v I would have like this to work but it requires the nix user to set an option.
|
# I would have like this to work but it requires the nix user to set an option.
|
||||||
allowUnfree = true;
|
allowUnfree = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,23 @@
|
||||||
{ pkgs ? import <nixpkgs> { }, lib }:
|
{
|
||||||
|
unrar,
|
||||||
|
xz,
|
||||||
|
pkg-config,
|
||||||
|
rustPlatform,
|
||||||
|
lib,
|
||||||
|
}:
|
||||||
|
|
||||||
pkgs.rustPlatform.buildRustPackage rec {
|
rustPlatform.buildRustPackage {
|
||||||
pname = "sk_extract";
|
pname = "sk_extract";
|
||||||
version = "0.1.0";
|
version = "0.1.0";
|
||||||
cargoLock.lockFile = ../Cargo.lock;
|
cargoLock.lockFile = ../Cargo.lock;
|
||||||
src = pkgs.lib.cleanSource ../.;
|
src = lib.cleanSource ../.;
|
||||||
buildInputs = [ pkgs.xz pkgs.unrar ];
|
buildInputs = [
|
||||||
nativeBuildInputs = [ pkgs.xz pkgs.pkg-config ];
|
xz
|
||||||
# doCheck = false;
|
unrar
|
||||||
}
|
];
|
||||||
|
nativeBuildInputs = [
|
||||||
|
xz
|
||||||
|
pkg-config
|
||||||
|
];
|
||||||
|
doCheck = false;
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -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(
|
||||||
str::from_utf8(entry.header().identifier()).unwrap(),
|
std::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:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue