From a2dee988be740e58ef3231f4d3ccc047f8931ba5 Mon Sep 17 00:00:00 2001 From: Jermeiah S Date: Sat, 28 Jun 2025 20:57:35 -0400 Subject: [PATCH 1/3] wip --- Cargo.lock | 2 +- src/lib/extractors.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 76d4169..852b126 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,6 +1,6 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 4 +version = 3 [[package]] name = "adler" diff --git a/src/lib/extractors.rs b/src/lib/extractors.rs index cb7cd09..bd64e86 100644 --- a/src/lib/extractors.rs +++ b/src/lib/extractors.rs @@ -396,7 +396,7 @@ pub fn extract_deb(input_path: &Path,) -> Result<(),io::Error>{ let mut entry = entry_result.unwrap(); // Create a new file with the same name as the archive entry: let mut file = File::create( - str::from_utf8(entry.header().identifier()).unwrap(), + std::str::from_utf8(entry.header().identifier()).unwrap(), ).unwrap(); // The Entry object also acts as an io::Read, so we can easily copy the // contents of the archive entry into the file: From a589331d4bbd36c694dd2a5c1e488734276e4a1d Mon Sep 17 00:00:00 2001 From: Jermeiah S Date: Sat, 28 Jun 2025 21:03:02 -0400 Subject: [PATCH 2/3] improved derrivation to be idomatic --- nix/default.nix | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/nix/default.nix b/nix/default.nix index 72061d5..2cc0815 100644 --- a/nix/default.nix +++ b/nix/default.nix @@ -1,11 +1,23 @@ -{ pkgs ? import { }, lib }: +{ + unrar, + xz, + pkg-config, + rustPlatform, + lib, +}: -pkgs.rustPlatform.buildRustPackage rec { +rustPlatform.buildRustPackage { pname = "sk_extract"; version = "0.1.0"; cargoLock.lockFile = ../Cargo.lock; - src = pkgs.lib.cleanSource ../.; - buildInputs = [ pkgs.xz pkgs.unrar ]; - nativeBuildInputs = [ pkgs.xz pkgs.pkg-config ]; -# doCheck = false; -} \ No newline at end of file + src = lib.cleanSource ../.; + buildInputs = [ + xz + unrar + ]; + nativeBuildInputs = [ + xz + pkg-config + ]; + doCheck = false; +} From 95063ba566db81a0a40e49d9ba02060a93087562 Mon Sep 17 00:00:00 2001 From: Jermeiah S Date: Sat, 28 Jun 2025 21:03:33 -0400 Subject: [PATCH 3/3] enabled generic allow unfree for sanity --- flake.nix | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/flake.nix b/flake.nix index 2f60c79..045c4e9 100644 --- a/flake.nix +++ b/flake.nix @@ -3,18 +3,22 @@ inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; }; - outputs = { self, nixpkgs }@inputs: + outputs = + { + self, + nixpkgs, + }@inputs: let supportedSystems = [ "x86_64-linux" ]; forAllSystems = nixpkgs.lib.genAttrs supportedSystems; - #v I improved how you call in packages - pkgs = forAllSystems (system: + # I improved how you call in packages + pkgs = forAllSystems ( + system: import nixpkgs { inherit system; #v this can be adjusted to read args passed without impure later - config = { allowUnfreePredicate = pkg: builtins.elem (nixpkgs.lib.getName pkg) [ - "unrar" - ]; + config = { + allowUnfree = true; }; } ); @@ -27,8 +31,8 @@ default = pkgs.${system}.callPackage ./nix/devshell.nix { }; }); 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; }; }; -} \ No newline at end of file +}