From 7395f525298d13a27d58f2d2afd795a7500e8fa1 Mon Sep 17 00:00:00 2001 From: Kat Huang Date: Tue, 22 Aug 2023 06:57:30 +0000 Subject: [PATCH] [NixOS] Disable nix overlay for jay-lenovo-wsl --- nixos/machines/jay-lenovo-wsl.nix | 1 + nixos/nix.nix | 62 +++++++++++++++++-------------- 2 files changed, 36 insertions(+), 27 deletions(-) diff --git a/nixos/machines/jay-lenovo-wsl.nix b/nixos/machines/jay-lenovo-wsl.nix index 1a448608..777c4ada 100644 --- a/nixos/machines/jay-lenovo-wsl.nix +++ b/nixos/machines/jay-lenovo-wsl.nix @@ -4,6 +4,7 @@ ../configuration.nix ]; + imalison.nixOverlay.enable = false; modules.wsl.enable = true; networking.hostName = "jay-lenovo-wsl"; diff --git a/nixos/nix.nix b/nixos/nix.nix index e4733250..fd1f6447 100644 --- a/nixos/nix.nix +++ b/nixos/nix.nix @@ -1,36 +1,44 @@ -{ inputs, specialArgs, config, ... }: +{ inputs, specialArgs, config, lib, ... }: { imports = [ inputs.home-manager.nixosModule ]; - home-manager.extraSpecialArgs = { - nixos = { - inherit specialArgs config; + + options = { + imalison.nixOverlay.enable = lib.mkOption { + default = true; + type = lib.types.bool; }; }; - home-manager.useGlobalPkgs = true; - home-manager.useUserPackages = true; - - nix = { - extraOptions = '' - experimental-features = nix-command flakes - ''; - registry.nixpkgs.flake = inputs.nixpkgs; - settings = { - keep-outputs = true; - keep-derivations = true; + config = { + home-manager.extraSpecialArgs = { + nixos = { + inherit specialArgs config; + }; }; - channel.enable = false; - nixPath = [ - "nixpkgs=${inputs.nixpkgs.outPath}" - ]; + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + + nix = { + extraOptions = '' + experimental-features = nix-command flakes + ''; + registry.nixpkgs.flake = inputs.nixpkgs; + settings = { + keep-outputs = true; + keep-derivations = true; + }; + channel.enable = false; + nixPath = [ + "nixpkgs=${inputs.nixpkgs.outPath}" + ]; + }; + + nixpkgs.overlays = [ + (import ./overlay.nix) + ] ++ (if config.imalison.nixOverlay.enable then [ inputs.nix.overlays.default ] else []); + + # Allow all the things + nixpkgs.config.allowUnfree = true; }; - - nixpkgs.overlays = with inputs; [ - nix.overlays.default - (import ./overlay.nix) - ]; - - # Allow all the things - nixpkgs.config.allowUnfree = true; }