My configuration.nix
{ config, pkgs, … }:
{
imports = [ ./hardware-configuration.nix
];
hardware = { pulseaudio.enable = false; # PulseAudio sound server for Linux
}
# Bootloader, Networking, TimeZone, Users
boot.loader = { grub.enable = true;
grub.device = "/dev/sda";
grub.useOSProber = true;
};
networking = { hostName = "nixos";
wireless.enable = true; # Enables wireless support via wpa_supplicant.
networkmanager.enable = true;
#firewall.enable = false;
#firewall.allowedTCPPorts = [ ... ];
#firewall.allowedUDPPorts = [ ... ];
};
# Set your time zone.
time.timeZone = "Europe/Luxembourg";
# Select internationalisation properties.
i18n.defaultLocale = "en_US.UTF-8";
# Services
security.rtkit.enable = true;
services = { xserver.enable = true; # Enable X11 windowing system.
printing.enable = true; # Enable CUPS to print documents.
openssh.enable = true; # Enable the OpenSSH daemon.
pipewire.enable = true; # Enable sound with pipewire.
};
services.xserver = { displayManager.lightdm.enable = true;
desktopManager.xfce.enable = true;
# Configure keymap in X11
layout = "us";
xkbVariant = "";
libinput.enable = true; # Enable touchpad support
};
services.pipewire = { alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
};
# Programs
programs = { gnupg.agent.enable = false;
gnupg.agent.enableSSHSupport = false;
mtr.enable = false; # Enable CUPS to print documents.
};
# Users. Don't forget to set a password with ‘passwd’.
users.users.user = { isNormalUser = true;
description = "user";
extraGroups = [ "networkmanager" "wheel" ];
packages = with pkgs; [];
};
# Packages
nixpkgs.config.allowUnfree = true;
nix.settings.experimental-features = ["nix-command" "flakes"];
# Environment System Packages
environment = { systemPackages = with pkgs; [ vim
wget
ungoogled-chromium
lf
vscodium
];
};
system = { stateVersion = "23.11"; }
}
After I use the command:
sudo nixos-rebuild switch --flake /etc/nixos#default
I get this error:
error:
… while calling the ‘seq’ builtin
at /nix/store/370qy3d3wg9zhbn5a3dcv6k1q1iigfh4-source/lib/modules.nix:322:18:
321| options = checked options;
322| config = checked (removeAttrs config [ "_module" ]);
| ^
323| _module = checked (config._module);
… while evaluating a branch condition
at /nix/store/370qy3d3wg9zhbn5a3dcv6k1q1iigfh4-source/lib/modules.nix:261:9:
260| checkUnmatched =
261| if config._module.check && config._module.freeformType == null && merged.unmatchedDefns != [] then
| ^
262| let
(stack trace truncated; use '--show-trace' to show the full trace)
error: syntax error, unexpected '=', expecting ';'
at /nix/store/xw7l0dzw1ffqmci5p6vldyjdjzkwnpv3-source/configuration.nix:19:17:
18|
19| boot.loader = {
| ^
20| grub.enable = true;
Is there anything I should learn on how to make posts on this forum ? Btw, I tried chatGPT and the docs, and it all seemed fine to me, they had the same example even. I really don’t know what to do anymore. Also, I’m new to NixOS.