From 7e38c259fa6300a78206a8e8e17cd7276f143e82 Mon Sep 17 00:00:00 2001 From: Donovan Glover Date: Mon, 5 Jun 2023 23:07:04 -0400 Subject: [PATCH] meta: Replace joshuto package with overlay This actually took *forever*, but now that I know how to write nixpkgs overlays, any future ones I write should be relatively straight-forward. --- modules/joshuto/default.nix | 4 ++-- overlays/default.nix | 21 +++++++++++++++++++++ packages/joshuto/default.nix | 25 ------------------------- src/main.nix | 1 + 4 files changed, 24 insertions(+), 27 deletions(-) create mode 100644 overlays/default.nix delete mode 100644 packages/joshuto/default.nix diff --git a/modules/joshuto/default.nix b/modules/joshuto/default.nix index 2d64c84a..1b96d1a9 100644 --- a/modules/joshuto/default.nix +++ b/modules/joshuto/default.nix @@ -1,6 +1,6 @@ {pkgs, ...}: { - environment.systemPackages = [ - (pkgs.callPackage ../../packages/joshuto {}) + environment.systemPackages = with pkgs; [ + joshuto ]; home-manager.sharedModules = [ diff --git a/overlays/default.nix b/overlays/default.nix new file mode 100644 index 00000000..a18dc419 --- /dev/null +++ b/overlays/default.nix @@ -0,0 +1,21 @@ +{lib, ...}: { + nixpkgs.overlays = [ + (final: prev: { + joshuto = prev.joshuto.overrideAttrs (oldAttrs: rec { + version = "493af3185092036cbbae81ae620b101f66cf4e9a"; + src = final.fetchFromGitHub { + owner = "kamiyaa"; + repo = "joshuto"; + rev = "493af3185092036cbbae81ae620b101f66cf4e9a"; + sha256 = "sha256-jLlDMV03eFWDB1D6pFEq2MFAfoVwFTy8ZpweS9syDB0="; + }; + + cargoDeps = oldAttrs.cargoDeps.overrideAttrs (lib.const { + name = "joshuto.tar.gz"; + inherit src; + outputHash = "sha256-cDy7sccuZj+RNjaDGjqczGl//zgmMAifjv/ZMEO/yyY="; + }); + }); + }) + ]; +} diff --git a/packages/joshuto/default.nix b/packages/joshuto/default.nix deleted file mode 100644 index 66d180e9..00000000 --- a/packages/joshuto/default.nix +++ /dev/null @@ -1,25 +0,0 @@ -{ - lib, - rustPlatform, - fetchFromGitHub, -}: -rustPlatform.buildRustPackage rec { - pname = "joshuto"; - version = "493af3185092036cbbae81ae620b101f66cf4e9a"; - - src = fetchFromGitHub { - owner = "kamiyaa"; - repo = pname; - rev = version; - sha256 = "sha256-jLlDMV03eFWDB1D6pFEq2MFAfoVwFTy8ZpweS9syDB0="; - }; - - cargoSha256 = "sha256-dffKMgXhm4VpDSEzFW5d4oGCBKY/ppj1gx29Iw3Msc8="; - - meta = with lib; { - description = "Ranger-like terminal file manager written in Rust"; - homepage = "https://github.com/kamiyaa/joshuto"; - license = licenses.lgpl3Only; - maintainers = with maintainers; [figsoda totoroot]; - }; -} diff --git a/src/main.nix b/src/main.nix index 72708b26..7928b8c1 100644 --- a/src/main.nix +++ b/src/main.nix @@ -9,6 +9,7 @@ in { imports = [ "${VARIABLES.hostHardwareConfiguration}" + ../overlays ../modules ../containers/rar.nix ../containers/wine.nix