add a helper function

This commit is contained in:
陈浩南 2023-06-24 22:00:28 +08:00
parent 84eebed2c0
commit b57feb23b6
2 changed files with 12 additions and 10 deletions

View File

@ -39,11 +39,7 @@
nur-xddxdd =
{
url = "github:xddxdd/nur-packages";
inputs =
{
flake-utils.follows = "flake-utils";
nixpkgs.follows = "nixpkgs-stable";
};
inputs = { flake-utils.follows = "flake-utils"; nixpkgs.follows = "nixpkgs-stable"; };
};
nix-vscode-extensions =
{
@ -68,11 +64,7 @@
plasma-manager =
{
url = "github:pjones/plasma-manager";
inputs =
{
nixpkgs.follows = "nixpkgs";
home-manager.follows = "home-manager";
};
inputs = { nixpkgs.follows = "nixpkgs"; home-manager.follows = "home-manager"; };
};
impermanence.url = "github:nix-community/impermanence";
};

10
lib/mkModules.nix Normal file
View File

@ -0,0 +1,10 @@
# Behaviors of these two NixOS modules would be different:
# { pkgs, ... }@inputs: { environment.systemPackages = [ pkgs.hello ]; }
# inputs: { environment.systemPackages = [ pkgs.hello ]; }
# The second one would failed to evaluate because nixpkgs would not pass pkgs to it.
# So that we wrote a wrapper to make it always works like the first one.
moduleList: { pkgs, ... }@inputs:
{
imports = builtins.map
( module: if ( ( builtins.typeOf module ) == "set" ) then module else module inputs ) moduleList;
}