diff --git a/flake.nix b/flake.nix index b4d1141..64867f1 100755 --- a/flake.nix +++ b/flake.nix @@ -42,59 +42,7 @@ modules = [ (_: { nixpkgs.overlays = [ - (final: prev: { - kernel = import inputs.nixpkgs-desktop-kernel { - inherit system; - config = { - allowUnfree = true; - nvidia.acceptLicense = true; - }; - }; - - nbfc-linux = final.callPackage ./pkgs/nbfc-linux { }; - - extest = final.pkgsi686Linux.callPackage ./pkgs/extest { }; - - #mesa-radv-jupiter = final.callPackage ./pkgs/mesa-radv-jupiter { mesa-radv-jupiter' = prev.mesa-radv-jupiter; }; - - steamPackages = prev.steamPackages.overrideScope (finalScope: prevScope: { - steam = prevScope.steam.overrideAttrs (finalAttrs: prevAttrs: { - postInstall = prevAttrs.postInstall + '' - substituteInPlace $out/share/applications/steam.desktop --replace "steam %U" "LD_PRELOAD=${final.extest}/lib/libextest.so steam %U -silent" - ''; - }); - }); - - libvirt = prev.libvirt.override (prevAttrs: { enableXen = false; }); - - openvswitch = prev.openvswitch.override { kernel = null; }; - - virtiofsd = final.callPackage ./pkgs/qemu_7/virtiofsd.nix { - qemu = final.callPackage ./pkgs/qemu_7 { - inherit (final.darwin.apple_sdk.frameworks) CoreServices Cocoa Hypervisor vmnet; - inherit (final.darwin.stubs) rez setfile; - inherit (final.darwin) sigtool; - }; - }; - - distrobox = prev.distrobox.overrideAttrs (finalAttrs: prevAttrs: { - version = "git"; - src = final.fetchFromGitHub { - owner = "89luca89"; - repo = "distrobox"; - rev = "18053c254a83750c49c08e58df2e48a0f04aef48"; - hash = "sha256-Gqi9kot7omRrxQPy3PbpqvU3tb33pzIyMA33anzHSjw="; - }; - - patches = [ - ./patches/distrobox/relative-default-icon.patch - ]; - - installPhase = '' - ./install -P $out - ''; - }); - }) + (import ./overlay.nix { inherit inputs system; }) ]; nixpkgs = { diff --git a/home-manager/flake.nix b/home-manager/flake.nix index fc5fccd..2a030bd 100755 --- a/home-manager/flake.nix +++ b/home-manager/flake.nix @@ -50,24 +50,7 @@ (_: { nixpkgs.overlays = [ - (final: prev: { - duperemove = prev.duperemove.overrideAttrs (finalAttrs: prevAttrs: { - src = final.fetchFromGitHub { - owner = "markfasheh"; - repo = "duperemove"; - rev = "c389d3d5309ed5641aae8cb5d7a255019396bf86"; - hash = "sha256-5yyeHGttSlVro+j72VUBoscwIPd4scsQ8X2He4xWFJU="; - }; - - nativeBuildInputs = prevAttrs.nativeBuildInputs ++ [ final.libbsd final.xxHash ]; - - postPatch = '' - substituteInPlace Makefile --replace "--std=c23" "--std=c2x" - substituteInPlace results-tree.h --replace "// TODO: delete this" "#include \"list.h\"" - substituteInPlace results-tree.h --replace "struct list_head {" "struct list_head_b {" - ''; - }); - }) + (import ./overlay.nix { }) ]; home = { diff --git a/home-manager/overlay.nix b/home-manager/overlay.nix new file mode 100644 index 0000000..46e07d9 --- /dev/null +++ b/home-manager/overlay.nix @@ -0,0 +1,19 @@ +{}: +(final: prev: { + duperemove = prev.duperemove.overrideAttrs (finalAttrs: prevAttrs: { + src = final.fetchFromGitHub { + owner = "markfasheh"; + repo = "duperemove"; + rev = "c389d3d5309ed5641aae8cb5d7a255019396bf86"; + hash = "sha256-5yyeHGttSlVro+j72VUBoscwIPd4scsQ8X2He4xWFJU="; + }; + + nativeBuildInputs = prevAttrs.nativeBuildInputs ++ [ final.libbsd final.xxHash ]; + + postPatch = '' + substituteInPlace Makefile --replace "--std=c23" "--std=c2x" + substituteInPlace results-tree.h --replace "// TODO: delete this" "#include \"list.h\"" + substituteInPlace results-tree.h --replace "struct list_head {" "struct list_head_b {" + ''; + }); +}) diff --git a/overlay.nix b/overlay.nix new file mode 100644 index 0000000..82c10a5 --- /dev/null +++ b/overlay.nix @@ -0,0 +1,48 @@ +{ inputs +, system +}: +(final: prev: { + kernel = import inputs.nixpkgs-desktop-kernel { + inherit system; + config = { + allowUnfree = true; + nvidia.acceptLicense = true; + }; + }; + + nbfc-linux = final.callPackage ./pkgs/nbfc-linux { }; + + extest = final.pkgsi686Linux.callPackage ./pkgs/extest { }; + + #mesa-radv-jupiter = final.callPackage ./pkgs/mesa-radv-jupiter { mesa-radv-jupiter' = prev.mesa-radv-jupiter; }; + + steamPackages = prev.steamPackages.overrideScope (finalScope: prevScope: { + steam = prevScope.steam.overrideAttrs (finalAttrs: prevAttrs: { + postInstall = prevAttrs.postInstall + '' + substituteInPlace $out/share/applications/steam.desktop --replace "steam %U" "LD_PRELOAD=${final.extest}/lib/libextest.so steam %U -silent" + ''; + }); + }); + + libvirt = prev.libvirt.override (prevAttrs: { enableXen = false; }); + + openvswitch = prev.openvswitch.override { kernel = null; }; + + virtiofsd = final.callPackage ./pkgs/qemu_7/virtiofsd.nix { + qemu = final.callPackage ./pkgs/qemu_7 { + inherit (final.darwin.apple_sdk.frameworks) CoreServices Cocoa Hypervisor vmnet; + inherit (final.darwin.stubs) rez setfile; + inherit (final.darwin) sigtool; + }; + }; + + distrobox = prev.distrobox.overrideAttrs (finalAttrs: prevAttrs: { + version = "git"; + src = final.fetchFromGitHub { + owner = "89luca89"; + repo = "distrobox"; + rev = "3bac964bf0952674848dce170af8b41d743abe57"; + hash = "sha256-uPCnI52PjxZPPzoMqS3ayF+5lqvQqb8WmeP1BxAC2ZE="; + }; + }); +})