Hi guys!
Im still new to nix and got most of the things working, but some basic nix-stuff simply refuses to cooperate, like nix-shell
. For example, when I execute nix-env --upgrade '*'
, I get the following error
error: anonymous function at /home/marc/git/dotfiles/nixos/configuration.nix:1:1 called without required argument 'config'
at /nix/store/kr54vf122h27ck1n86x54f0x355dag6h-nixos-23.05/nixos/pkgs/top-level/default.nix:74:10:
73| if lib.isFunction config0
74| then config0 { inherit pkgs; }
| ^
75| else config0;
(use '--show-trace' to show detailed location information)
(Yes I know this is not the intended way of how you do this on nixos → just an example
Nixos configuration:
{ config, pkgs, lib, ... }:
#let
# unstable = import <nixos-unstable> { config = { allowUnfree = true; }; };
#in
{
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
./suspend-and-hibernate.nix
./conan.nix
# ./tuxedo.nix
];
# acpid
services.acpid = {
enable = true;
};
# Bootloader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
# environment.systemPackages = with config.boot.kernelPackages;[ turbostat ];
environment.systemPackages = with pkgs; [
(python310.withPackages(ps: with ps; [ pandas numpy ]))
];
# Setup keyfile
boot.initrd.secrets = {
"/crypto_keyfile.bin" = null;
};
# Enable swap on luks
boot.initrd.luks.devices."luks-18911171-72fb-4967-82f8-161b16b6432a".device = "/dev/disk/by-uuid/18911171-72fb-4967-82f8-161b16b6432a";
boot.initrd.luks.devices."luks-18911171-72fb-4967-82f8-161b16b6432a".keyFile = "/crypto_keyfile.bin";
networking.hostName = "nixos"; # Define your hostname.
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
# Enable networking
networking.networkmanager.enable = true;
# Open ports for the Naviswiss External Dispaly --> Port 50051
networking.firewall.allowedTCPPortRanges = [ { from = 50051; to = 50051; } ];
networking.firewall.allowedUDPPortRanges = [ { from = 50051; to = 50051; } ];
# Set your time zone.
time.timeZone = "Europe/Zurich";
# Select internationalisation properties.
i18n.defaultLocale = "en_US.UTF-8";
# Enable the X11 windowing system.
services.xserver.enable = true;
# services.xserver.videoDrivers = [ "displaylink" "modesetting" ];
# Enable the GNOME Desktop Environment.
services.xserver.displayManager.gdm.enable = true;
services.xserver.desktopManager.gnome.enable = true;
# Enable hyperland
# hyprland
#programs.hyprland = {
# enable = true;
# xwayland = {
# enable = true;
# hidpi = false;
# };
#};
programs.waybar = {
enable = true;
package = pkgs.waybar.overrideAttrs (oldAttrs: {
mesonFlags = oldAttrs.mesonFlags ++ [ "-Dexperimental=true" ];
});
};
# Configure keymap in X11
services.xserver = {
layout = "de";
xkbVariant = "";
};
# Configure console keymap
console = {
useXkbConfig = true;
};
# Map CapsLock to Esc on single press and Ctrl on when used with multiple keys.
services.interception-tools = {
enable = true;
plugins = [ pkgs.interception-tools-plugins.caps2esc ];
udevmonConfig = ''
- JOB: "${pkgs.interception-tools}/bin/intercept -g $DEVNODE | ${pkgs.interception-tools-plugins.caps2esc}/bin/caps2esc | ${pkgs.interception-tools}/bin/uinput -d $DEVNODE"
DEVICE:
EVENTS:
EV_KEY: [KEY_CAPSLOCK, KEY_ESC]
'';
};
# Enable CUPS to print documents.
services.printing.enable = true;
# Enable sound with pipewire.
sound.enable = true;
hardware.pulseaudio.enable = false;
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
# If you want to use JACK applications, uncomment this
#jack.enable = true;
# use the example session manager (no others are packaged yet so this is enabled by default,
# no need to redefine it in your config for now)
#media-session.enable = true;
};
# Add docker support
virtualisation.docker.enable = true;
# virtualisation.docker.rootless = {
# enable = true;
# setSocketVariable = true;
# };
programs.nix-ld.enable = true;
services.udev = {
extraRules = ''
# User access to navigation unit USB devices.
# Cypress FX3
SUBSYSTEMS=="usb", ATTRS{idVendor}=="04b4", ATTRS{idProduct}=="00f3", MODE="0666"
# UVC Camera
SUBSYSTEMS=="usb", ATTRS{idVendor}=="04b4", ATTRS{idProduct}=="00f9", MODE="0666"
# Microchip HUB controller
SUBSYSTEMS=="usb", ATTRS{idVendor}=="0424", ATTRS{idProduct}=="2740", MODE="0666"
# Display
SUBSYSTEMS=="usb", ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="08a6", MODE="0666"
'';
};
services.upower.enable = true;
services.devmon.enable = true;
services.gvfs.enable = true;
services.udisks2.enable = true;
# enable the tailscale service
services.tailscale.enable = true;
# Allow unfree packages
nixpkgs.config.allowUnfree = true;
nix = {
package = pkgs.nixFlakes;
extraOptions = ''
experimental-features = nix-command flakes
'';
};
# Change default shell
users.defaultUserShell = pkgs.zsh;
programs.zsh.enable = true;
environment.shells = with pkgs; [ zsh ];
# Define a user account. Don't forget to set a password with ‘passwd’.
users.users.marc = {
isNormalUser = true;
description = "Hans Ruedi";
extraGroups = [ "networkmanager" "wheel" "docker" "storage" ];
packages = with pkgs; [
# Storage
cifs-utils
# Network
networkmanagerapplet
nettools
inetutils
tailscale
## VPN
networkmanager-l2tp
strongswan
# Frontend for X11
gnome3.gnome-tweaks
jumpapp
xorg.xhost
xdotool
wmctrl
xbindkeys
autorandr
arandr
xorg.xhost
polkit
# Frontend for wayland
kanshi #autorandr for wayland
wl-clipboard #clipboard for wayland
wev # wayland event viewer
wdisplays # wayland version of arandr
wlr-randr # wayland xrandr
wlrctl # Command line utility for miscellaneous wlroots Wayland extensions
# Hyprland
wofi
swaybg # the wallpaper
swayidle # the idle timeout
swaylock # locking the screen
wlogout # logout menu
wl-clipboard # copying and pasting
wf-recorder # creen recording
grim # taking screenshots
slurp # selecting a region to screenshot
mako # the notification daemon, the same as dunst
yad # a fork of zenity, for creating dialogs
# audio
alsa-utils # provides amixer/alsamixer/...
playerctl # Command-line utility and library for controlling media players that implement MPRIS
mpd # for playing system sounds
mpc-cli # command-line mpd client
ncmpcpp # a mpd client with a UI
networkmanagerapplet # provide GUI app: nm-connection-editor
# Development tools
vscode
git
gitg
gitkraken
gimp
docker
docker-compose
pandoc
rpi-imager
gparted
meld
glxinfo
kooha
masterpdfeditor
jetbrains-toolbox
shell_gpt
#unstable.jetbrains.clion
# Development environment
acpid # A daemon for delivering ACPI events to userspace programs
nodejs
patchelf
steam-run
stdenv
xvfb-run
fuse
pmutils # A small collection of scripts that handle suspend and resume on behalf of HAL
## CPP
cmake
gdb
gcc
gnumake
doxygen
python311Packages.pip
## Qt
qtcreator
# qt6.qtbase
qt5.full
qt6.full
# libsForQt5.full
# libsForQt5.base
# libsForQt5.qmake
# libsForQt5.qt5.qttools
# libsForQt5.qtutilities
# libsForQt5.qtstyleplugins
# libsForQt5.qt5.qtbase
# libsForQt5.qt5.qtsvg
# Power management testing
gnome.gnome-power-manager # Waybar applets
upower # Waybar applets
powertop
stress
geekbench_5
## Androie tools
android-tools
android-studio
scrcpy
# Terminal
kitty
zsh
neofetch
trash-cli
killall
neovim
s-tui
htop
tree
zip
unzip
xclip
toybox
jq # A lightweight and flexible command-line JSON processor
socat
# Generla stuff
google-chrome
firefox
_1password-gui
obsidian
discord
spotify
slack
libreoffice
drawio
gnome.nautilus
cinnamon.nemo-with-extensions
evince # default gnome pdf viewer
udisks # automount usb sticks
# Naviswiss
## Naviplan workflow dependencies
paraview
flatbuffers
flatcc
];
};
nixpkgs.config.permittedInsecurePackages = [
"nodejs-14.21.3"
"openssl-1.1.1u"
"electron-13.6.9"
"qtwebkit-5.212.0-alpha4"
];
# Fonts. Corefonts contain the webdings fonts needed by some Medivation documents, like the risk analysis
fonts.fonts = with pkgs; [
nerdfonts
corefonts
];
# List packages installed in system profile. To search, run:
# $ nix search wget
#environment.systemPackages = with pkgs; [
#];
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. It‘s perfectly fine and recommended to leave
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "23.05"; # Did you read the comment?
}
My NIX_PATH is as follows:
❯ echo $NIX_PATH
nixos-config=/home/marc/git/dotfiles/nixos/configuration.nix:nixpkgs=/nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs
Additional info:
- This also applies for other commands, like
nix-shell --packages nano
. - I symlinked the nixos folder (
/etc/nixos -> /home/marc/git/dotfiles/nixos
) -
nixos-rebuild switch
works just fine - Nixos version 23.05
If there is any info that might help, I’ll be happy to provide. Thanks a lot for your efforts