From deeedb8f065a081e080fdd853ce5fabe60afa85c Mon Sep 17 00:00:00 2001 From: Whovian9369 Date: Sat, 20 Jul 2024 04:40:23 -0400 Subject: [PATCH] Add a modified `nix-init` :) --- .../packages/nix-init/default_to_package.diff | 22 +++++++++++++++++++ home/pkgs_and_programs.nix | 5 +++++ 2 files changed, 27 insertions(+) create mode 100644 home/packages/nix-init/default_to_package.diff diff --git a/home/packages/nix-init/default_to_package.diff b/home/packages/nix-init/default_to_package.diff new file mode 100644 index 0000000..3c0462c --- /dev/null +++ b/home/packages/nix-init/default_to_package.diff @@ -0,0 +1,22 @@ +diff --git a/src/main.rs b/src/main.rs +index 27e20ec..c76417d 100644 +--- a/src/main.rs ++++ b/src/main.rs +@@ -439,7 +439,7 @@ async fn run() -> Result<()> { + + let (out_dir, out_path) = if let Ok(metadata) = metadata(&output) { + if metadata.is_dir() { +- let out_path = output.join("default.nix"); ++ let out_path = output.join("package.nix"); + if out_path.exists() && ask_overwrite(&mut editor, &out_path)? { + return Ok(()); + } +@@ -453,7 +453,7 @@ async fn run() -> Result<()> { + .map_or(false, |out_path| out_path.ends_with_str(b"/")) + { + let _ = create_dir_all(&output); +- (Some(output.as_ref()), output.join("default.nix")) ++ (Some(output.as_ref()), output.join("package.nix")) + } else { + let out_dir = output.parent(); + if let Some(out_dir) = out_dir { diff --git a/home/pkgs_and_programs.nix b/home/pkgs_and_programs.nix index a585457..0b94ee6 100644 --- a/home/pkgs_and_programs.nix +++ b/home/pkgs_and_programs.nix @@ -25,6 +25,10 @@ let patches = [ ./packages/new_rclone/patches/rclone_8ffe3e462cbf5688c37c54009db09d8dcb486860.diff ]; } ); + nix-init_packagenix = pkgs.nix-init.overrideAttrs (oldAttrs: rec { + patches = [ ./packages/nix-init/default_to_package.diff ]; + } + ); unnix_script = pkgs.writeShellApplication { name = "unnix"; /* runtimeInputs = [ sed ]; */ @@ -136,6 +140,7 @@ in my_packages.ird_tools my_packages.irdkit my_packages.new_rclone + my_packages.nix-init_packagenix # Yay for patched apps :) my_packages.nxtik my_packages.ps3dec my_packages.rom-properties