mirror of
https://github.com/CHN-beta/nixos.git
synced 2024-10-23 15:08:45 +08:00
add a helper function
This commit is contained in:
parent
84eebed2c0
commit
b57feb23b6
12
flake.nix
12
flake.nix
@ -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
10
lib/mkModules.nix
Normal 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;
|
||||
}
|
Loading…
Reference in New Issue
Block a user