mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-04-10 19:26:52 +02:00
fix: create nixpkgs instance only in flake.nix, do not create it in any sub module or overlays
This commit is contained in:
11
flake.nix
11
flake.nix
@@ -97,7 +97,7 @@
|
|||||||
# However, the configuration name can also be specified using `sudo nixos-rebuild switch --flake /path/to/flakes/directory#<name>`.
|
# However, the configuration name can also be specified using `sudo nixos-rebuild switch --flake /path/to/flakes/directory#<name>`.
|
||||||
# The `nixpkgs.lib.nixosSystem` function is used to build this configuration, the following attribute set is its parameter.
|
# The `nixpkgs.lib.nixosSystem` function is used to build this configuration, the following attribute set is its parameter.
|
||||||
# Run `sudo nixos-rebuild switch --flake .#msi-rtx4090` in the flake's directory to deploy this configuration on any NixOS system
|
# Run `sudo nixos-rebuild switch --flake .#msi-rtx4090` in the flake's directory to deploy this configuration on any NixOS system
|
||||||
msi-rtx4090 = nixpkgs.lib.nixosSystem {
|
msi-rtx4090 = nixpkgs.lib.nixosSystem rec {
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
|
|
||||||
# The Nix module system can modularize configurations, improving the maintainability of configurations.
|
# The Nix module system can modularize configurations, improving the maintainability of configurations.
|
||||||
@@ -116,7 +116,14 @@
|
|||||||
#
|
#
|
||||||
# Only these four parameters can be passed by default.
|
# Only these four parameters can be passed by default.
|
||||||
# If you need to pass other parameters, you must use `specialArgs` by uncomment the following line
|
# If you need to pass other parameters, you must use `specialArgs` by uncomment the following line
|
||||||
specialArgs = inputs; # pass all inputs into all sub modules.
|
specialArgs = {
|
||||||
|
inherit inputs;
|
||||||
|
pkgs-stable = import inputs.nixpkgs-stable {
|
||||||
|
system = system; # refer the `system` parameter form outer scope recursively
|
||||||
|
# To use chrome, we need to allow the installation of non-free software
|
||||||
|
config.allowUnfree = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
modules = [
|
modules = [
|
||||||
./hosts/msi-rtx4090
|
./hosts/msi-rtx4090
|
||||||
|
|
||||||
|
|||||||
@@ -1,13 +1,10 @@
|
|||||||
{
|
{
|
||||||
pkgs,
|
pkgs,
|
||||||
nixpkgs-stable,
|
pkgs-stable,
|
||||||
...
|
...
|
||||||
}: let
|
}:
|
||||||
pkgs-stable = import nixpkgs-stable {
|
|
||||||
system = pkgs.system;
|
{
|
||||||
config.allowUnfree = true;
|
|
||||||
};
|
|
||||||
in {
|
|
||||||
# TODO vscode & chrome both have wayland support, but they don't work with fcitx5, need to fix it.
|
# TODO vscode & chrome both have wayland support, but they don't work with fcitx5, need to fix it.
|
||||||
programs = {
|
programs = {
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user