feat: infuse

This commit is contained in:
2025-05-03 14:13:53 +08:00
parent 095d9ecb67
commit 36d63a667c
2 changed files with 28 additions and 21 deletions

View File

@@ -55,13 +55,15 @@
fenix.url = "github:nix-community/fenix"; fenix.url = "github:nix-community/fenix";
fenix.inputs.nixpkgs.follows = "nixpkgs"; fenix.inputs.nixpkgs.follows = "nixpkgs";
infuse.url = "git+https://codeberg.org/amjoseph/infuse.nix";
infuse.flake = false;
}; };
outputs = outputs =
{ {
self, self,
nixpkgs, nixpkgs,
nixos-wsl,
... ...
}@inputs: }@inputs:
let let
@@ -75,6 +77,15 @@
${hostname} = mkSystem hostname; ${hostname} = mkSystem hostname;
}) (builtins.attrNames (builtins.readDir ./config/hosts)) }) (builtins.attrNames (builtins.readDir ./config/hosts))
); );
lib = nixpkgs.lib.extend (
final: prev: {
inherit (inputs.home-manager.lib) hm;
inherit infuse;
my = import ./lib { lib = final; };
}
);
infuse = (import inputs.infuse { inherit (nixpkgs) lib; }).v1.infuse;
in in
{ {
packages = forAllSystems (system: import ./pkgs nixpkgs.legacyPackages.${system}); packages = forAllSystems (system: import ./pkgs nixpkgs.legacyPackages.${system});
@@ -99,18 +110,11 @@
} }
); );
overlays = import ./overlays { inherit inputs; }; overlays = import ./overlays { inherit inputs infuse; };
nixosConfigurations = forAllHosts ( nixosConfigurations = forAllHosts (
hostname: hostname:
let let
lib = import ./lib/stdlib-extended.nix (
nixpkgs.lib.extend (
final: prev: {
inherit (inputs.home-manager.lib) hm;
}
)
);
overlays = builtins.attrValues self.overlays ++ [ overlays = builtins.attrValues self.overlays ++ [
inputs.go-musicfox.overlays.default inputs.go-musicfox.overlays.default
inputs.omz.overlays.default inputs.omz.overlays.default
@@ -131,6 +135,9 @@
withHyprland = false; withHyprland = false;
}; };
}) })
(final: prev: {
inherit lib;
})
]; ];
home = { home = {
home-manager = { home-manager = {
@@ -140,9 +147,12 @@
inputs.stylix.homeManagerModules.stylix inputs.stylix.homeManagerModules.stylix
inputs.niri.homeModules.niri inputs.niri.homeModules.niri
# workaround for annoying stylix # workaround for annoying stylix
{ (
nixpkgs.overlays = lib.mkForce null; { lib, ... }:
} {
nixpkgs.overlays = lib.mkForce null;
}
)
]; ];
useGlobalPkgs = true; useGlobalPkgs = true;
}; };
@@ -157,7 +167,6 @@
inherit inherit
inputs inputs
outputs outputs
nixos-wsl
hostname hostname
; ;

View File

@@ -1,19 +1,17 @@
{ inputs, ... }: { inputs, infuse, ... }:
{ {
additions = final: prev: import ../pkgs prev; additions = final: prev: import ../pkgs prev;
modifications = final: prev: { modifications =
cage = prev.cage.overrideAttrs { final: prev:
patches = [ ./cage-specify-output-name.patch ]; infuse prev {
}; cage.__output.patches.__append = [ ./cage-specify-output-name.patch ];
qq = prev.qq.overrideAttrs { qq.__output.preInstall.__append = ''
preInstall = ''
gappsWrapperArgs+=( gappsWrapperArgs+=(
--prefix GTK_IM_MODULE : fcitx --prefix GTK_IM_MODULE : fcitx
) )
''; '';
}; };
};
# this allows us to access specific version of nixpkgs # this allows us to access specific version of nixpkgs
# by `pkgs.unstable`, `pkgs.stable` and `pkgs.master` # by `pkgs.unstable`, `pkgs.stable` and `pkgs.master`