Trying to update config with compartmentalized config files I am receiving an undefined variable ‘pkgs’ error.
Already doubled checked the syntax but did`t found the error. I am using this https://github.com/jluttine/nixos-configuration as reference.
This is the configuration.nix
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running ‘nixos-help’).
{ config, pkgs, ... }:
{
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
# Enable the KDE Desktop Environment.
./kde-configuration.nix
];
# Use the systemd-boot EFI boot loader.
boot.loader.systemd-boot.enable = true;
# Uses the most recent packages.
boot.kernelPackages = pkgs.linuxPackages_latest;
# Supposedly better for the SSD.
fileSystems."/".options = [ "noatime" "nodiratime" "discard" ];
# Use the GRUB 2 boot loader.
boot.loader.grub.enable = true;
boot.loader.grub.version = 2;
boot.loader.grub.device = "nodev";
boot.loader.grub.efiSupport = true;
boot.loader.efi.canTouchEfiVariables = true;
# Grub menu is painted really slowly on HiDPI, so we lower the
# resolution. Unfortunately, scaling to 1280x720 (keeping aspect
# ratio) doesn't seem to work, so we just pick another low one.
boot.loader.grub.gfxmodeEfi = "1024x768";
boot.loader.grub.enableCryptodisk = true;
boot.initrd.luks.devices = {
"root" = {
device = "/dev/disk/by-uuid/d83054a8-ef44-4e19-99a9-d498ba6a6d62";
preLVM = true;
allowDiscards = true;
};
};
# Networking set-up
networking.hostName = "T101"; # Define your hostname.
networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
networking.nameservers = [ "84.200.69.80" "84.200.70.40" ]; # DNS Watch
# Wi-fi corporate network set-up
networking.wireless.networks = {
"walCOR Seguros" = { # SSID with spaces and/or special characters
pskRaw = "------------------";
};
};
# The global useDHCP flag is deprecated, therefore explicitly set to false here.
# Per-interface useDHCP will be mandatory in the future, so this generated config
# replicates the default behaviour.
networking.useDHCP = false;
networking.interfaces.enp1s0.useDHCP = true;
networking.interfaces.wlp2s0.useDHCP = true;
# Configure network proxy if necessary
# networking.proxy.default = "http://user:password@proxy:port/";
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
# Select internationalisation properties.
i18n.console.font = "Lat2-Terminus16";
i18n. console.keyMap = "br-abnt2";
i18n.defaultLocale = "pt_BR.UTF-8";
# Set your time zone.
time.timeZone = "America/Campo_Grande";
# List packages installed in system profile. To search, run:
# $ nix search wget
# environment.systemPackages = with pkgs; [
# wget vim
# ];
# Some programs need SUID wrappers, can be configured further or are
# started in user sessions.
# programs.mtr.enable = true;
# programs.gnupg.agent = { enable = true; enableSSHSupport = true; };
# List services that you want to enable:
# Enable the OpenSSH daemon.
services.openssh.enable = true;
# Open ports in the firewall.
# networking.firewall.allowedTCPPorts = [ ... ];
# networking.firewall.allowedUDPPorts = [ ... ];
# Or disable the firewall altogether.
# networking.firewall.enable = false;
# Enable CUPS to print documents.
services.printing.enable = true;
# Enable sound.
sound.enable = true;
hardware.pulseaudio.enable = true;
# Loads GPU drivers on T-101 station.
nixpkgs.config.allowUnfree = true;
services.xserver.videoDrivers = [ "intel" "amdgpu" ];
# Enable the X11 windowing system.
services.xserver.enable = true;
services.xserver.layout = "br-abnt2";
services.xserver.xkbOptions = "eurosign:e";
# Enable touchpad support.
services.xserver.libinput.enable = true;
# 32 bit Open GL support.
hardware.opengl.driSupport32Bit = true;
# Fonts Settings.
fonts.enableFontDir = true;
fonts.enableGhostscriptFonts = true;
fonts.fonts = [ pkgs.inconsolata pkgs.unifont pkgs.font-awesome-ttf pkgs.source-code-pro pkgs.freefont_ttf pkgs.opensans-ttf pkgs.liberation_ttf pkgs.liberationsansnarrow pkgs.ttf_bitstream_vera pkgs.libertine pkgs.ubuntu_font_family pkgs.gentium pkgs.symbola ];
# Define a user account. Don't forget to set a password with ‘passwd’.
users.users.walter = {
isNormalUser = true;
extraGroups = [ "wheel" "disk" "audio" "video" "networkmanager" "systemd-journal" ]; # Enable ‘sudo’ for the user.
home = "/home/walter";
description = "Walter Queiroz";
uid = 1000;
};
# This value determines the NixOS release with which your system is to be
# compatible, in order to avoid breaking some software such as database
# servers. You should change this only after NixOS release notes say you
# should.
system.stateVersion = "19.09"; # Did you read the comment?
# Auto upgrade Always ON.
system.autoUpgrade.enable = true;
# Enable Tor Browser as Service - Security Reasons.
services.tor.enable = true;
services.tor.client.enable = true;
# Enable SmarCard Daemon.
services.pcscd.enable = true;
services.pcscd.plugins = [ pkgs.pcsclite pkgs.opensc pkgs.openssl pkgs.pcsctools pkgs.libusb pkgs.ccid pkgs.pcsc-cyberjack ];
# Fundamental core packages
environment.systemPackages = with pkgs; [
# Basic command line tools
bash
wget
file
gksu
git
hdf5
zip
unzip
htop
yle-dl
youtube-dl
nix-index
dnsutils
whois
coreutils
vbetool
killall
nethogs
# Gamin: a file and directory monitoring system
fam
# Basic image manipulation and handling stuff
imagemagick
ghostscript
# Text editors
vim
xclip # system clipboard support for vim
# VPN
pptp
openvpn
# File format conversions
pandoc
pdf2svg
# Screen brightness and temperature
redshift
# SSH filesystem
sshfsFuse
# Encryption key management
gnupg
# Yet another dotfile manager
yadm
gnupg1orig
# Password hash generator
mkpasswd
# Android
jmtpfs
gphoto2
libmtp
mtpfs
nix-prefetch-git
# Make NTFS filesystems (e.g., USB drives)
ntfs3g
# Encrypted USB sticks etc
cryptsetup
# GPG password entry from the terminal
pinentry
# GUI for sound control
pavucontrol
python3Packages.magic-wormhole
];
}
This is the kde-configuration.nix?
#Open ports for KDE Connect
{ networking.firewall.allowedTCPPortRanges = [ { from = 1714; to = 1764; } ];
networking.firewall.allowedUDPPortRanges = [ { from = 1717; to = 1764; } ];
}
# Use Plasma 5
{ services.xserver.desktopManager.plasma5.enable = true;
services.xserver.desktopManager.default = "plasma5"; #Deprecated
#services.xserver.displayManager.defaultSession = "plasma5";
}
# User packages for graphic environment.
{ environment.systemPackages = with pkgs;
[ kdeFrameworks.kwallet # Password manager for KDE
kdeApplications.kwalletmanager
kwalletcli
# Allow automatic unlocking of kwallet if the same password. This seems to
# work without installing kwallet-pam.
kwallet-pam
# ssh-add prompts a user for a passphrase using KDE. Not sure if it is used
# by anything? ssh-add just asks passphrase on the console.
#ksshaskpass
# Archives (e.g., tar.gz and zip)
ark
# GPG manager for KDE
kgpg
# This is needed for graphical dialogs used to enter GPG passphrases
pinentry-qt
kdeplasma-addons
# Screenshots
kdeApplications.spectacle
# Bluetooth
bluedevil
# Text editor
kate
# Torrenting
ktorrent
# Connect desktop and phone
kdeconnect
# Drop-down terminal
yakuake
# Printing and scanning
kdeApplications.print-manager
simple-scan
# Document readers
okular
# Browsers
firefox
chromium
tor
# Email
#kmail
thunderbird
# Office suit
libreoffice
# Photo/image editor
gwenview
digikam5
gimp-with-plugins
# Media player
vlc
# KDE apps
kdeFrameworks.kconfig
kdeFrameworks.kconfigwidgets
konsole
dolphin
kdeApplications.dolphin-plugins
];
}
This is the complete error:
[root@T101:~]# sudo nixos-rebuild switch --show-trace
error: while evaluating the attribute 'config' at /nix/var/nix/profiles/per-user/root/channels/nixos/nixos/lib/eval-config.nix:58:5:
while evaluating the attribute 'config' at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:87:25:
while evaluating 'yieldConfig' at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:74:29, called from /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:73:16:
while evaluating 'mergeModules' at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:190:26, called from /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:64:17:
while evaluating 'mergeModules'' at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:194:36, called from /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:191:5:
while evaluating 'flip' at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/trivial.nix:101:16, called from /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:237:6:
while evaluating 'byName' at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:217:25, called from /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:225:21:
while evaluating 'reverseList' at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/lists.nix:393:17, called from /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:64:38:
while evaluating 'filterModules' at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:93:31, called from /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:64:51:
while evaluating 'closeModules' at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:101:27, called from /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:62:16:
while evaluating anonymous function at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/lists.nix:116:29, called from undefined position:
while evaluating anonymous function at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:103:50, called from /nix/var/nix/profiles/per-user/root/channels/nixos/lib/lists.nix:116:32:
while evaluating 'unifyModuleSyntax' at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:118:34, called from /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:109:11:
while evaluating 'applyIfFunction' at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:144:29, called from /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:109:39:
while evaluating 'isFunction' at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/trivial.nix:296:16, called from /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:144:68:
undefined variable 'pkgs' at /etc/nixos/kde-configuration.nix:13:39
building Nix...
error: while evaluating the attribute 'config' at /nix/var/nix/profiles/per-user/root/channels/nixos/nixos/lib/eval-config.nix:58:5:
while evaluating the attribute 'config' at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:87:25:
while evaluating 'yieldConfig' at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:74:29, called from /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:73:16:
while evaluating 'mergeModules' at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:190:26, called from /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:64:17:
while evaluating 'mergeModules'' at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:194:36, called from /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:191:5:
while evaluating 'flip' at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/trivial.nix:101:16, called from /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:237:6:
while evaluating 'byName' at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:217:25, called from /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:225:21:
while evaluating 'reverseList' at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/lists.nix:393:17, called from /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:64:38:
while evaluating 'filterModules' at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:93:31, called from /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:64:51:
while evaluating 'closeModules' at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:101:27, called from /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:62:16:
while evaluating anonymous function at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/lists.nix:116:29, called from undefined position:
while evaluating anonymous function at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:103:50, called from /nix/var/nix/profiles/per-user/root/channels/nixos/lib/lists.nix:116:32:
while evaluating 'unifyModuleSyntax' at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:118:34, called from /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:109:11:
while evaluating 'applyIfFunction' at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:144:29, called from /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:109:39:
while evaluating 'isFunction' at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/trivial.nix:296:16, called from /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:144:68:
undefined variable 'pkgs' at /etc/nixos/kde-configuration.nix:13:39
building the system configuration...
error: while evaluating the attribute 'config.system.build.toplevel' at /nix/var/nix/profiles/per-user/root/channels/nixos/nixos/lib/eval-config.nix:58:5:
while evaluating the attribute 'config' at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:87:25:
while evaluating 'yieldConfig' at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:74:29, called from /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:73:16:
while evaluating 'mergeModules' at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:190:26, called from /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:64:17:
while evaluating 'mergeModules'' at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:194:36, called from /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:191:5:
while evaluating 'flip' at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/trivial.nix:101:16, called from /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:237:6:
while evaluating 'byName' at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:217:25, called from /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:225:21:
while evaluating 'reverseList' at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/lists.nix:393:17, called from /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:64:38:
while evaluating 'filterModules' at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:93:31, called from /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:64:51:
while evaluating 'closeModules' at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:101:27, called from /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:62:16:
while evaluating anonymous function at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/lists.nix:116:29, called from undefined position:
while evaluating anonymous function at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:103:50, called from /nix/var/nix/profiles/per-user/root/channels/nixos/lib/lists.nix:116:32:
while evaluating 'unifyModuleSyntax' at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:118:34, called from /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:109:11:
while evaluating 'applyIfFunction' at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:144:29, called from /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:109:39:
while evaluating 'isFunction' at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/trivial.nix:296:16, called from /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:144:68:
undefined variable 'pkgs' at /etc/nixos/kde-configuration.nix:13:39
It will be wonderful if some one of you guys figure what I am not able to identify.
Thanks.