Greetings!
I am brand new to NixOS. Please be gentle.
I read the tutorial on the Nix language basics. Since I have a foundational understanding of Python, I understood some of it. I think it’s really cool that functions have no names. They are all lambdas.
I am experimenting with the VBox .ova demo appliance provided on the download page. I got it running and installed some apps by making changes to /etc/nixos/configuration.nix
.
I got as far as installing chromium as well as (non-free) google-chrome, libreoffice, python, vim, and a few other apps.
Then I ventured forward exploring flakes to try to install and configure Hyprland. Big mistake. When I invoke $ sudo nixos-rebuild switch
, I get this error:
error: flake 'path:/etc/nixos' does not provide attribute 'packages.x86_64-linux.nixosConfigurations."nixos".config.system.build.nixos-rebuild', 'legacyPackages.x86_64-linux.nixosConfigurations."nixos".config.system.build.nixos-rebuild' or 'nixosConfigurations."nixos".config.system.build.nixos-rebuild'
I tried running these commands:
[demo@nixos:/etc/nixos]$ sudo nix-channel --update
unpacking channels...
[demo@nixos:/etc/nixos]$ sudo nix-env -u
[demo@nixos:/etc/nixos]$ sudo nix-channel --update nixpkgs
unpacking channels...
I noodled with the four configuration files inside /etc/nixos/ directory. I made small and large changes, where I added, commented out, re-added different lines one at time and running the above commands after each change which has not yet resolved the error.
I am determined to make this work.
I am sharing my configurations files below with the hope that more experienced users might be able to identify the trivial mistake I am making. Based on the configuration files below, what might you people suggest I try next?
/etc/nixos/configuration.nix
{ config, pkgs, ... }:
{
imports = [ <nixpkgs/nixos/modules/installer/virtualbox-demo.nix> ];
# nix.settings.experimental-features = [ "nix-command" "flakes" ];
nixpkgs.config.allowUnfree = true;
environment.systemPackages = with pkgs; [
# ... other packages ...
google-chrome
# thunar
vscode
qbittorrent
chromium
libreoffice
python312
# anaconda
sway
# i3
xdg-desktop-portal-hyprland
vim
];
services.xserver = {
enable = true;
desktopManager = {
xterm.enable = false;
xfce = {
enable = true;
noDesktop = true;
enableXfwm = false;
};
};
displayManager.defaultSession = "xfce";
};
programs.hyprland = {
# Install the packages from nixpkgs
enable = true;
# Whether to enable XWayland
xwayland.enable = true;
# Optional
# Whether to enable patching wlroots for better Nvidia support
# enableNvidiaPatches = true;
};
/etc/nixos/flake.nix
{
description = "A very basic flake";
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
outputs = { self, nixpkgs }: {
packages.x86_64-linux.hello = nixpkgs.legacyPackages.x86_64-linux.hello;
packages.x86_64-linux.default = self.packages.x86_64-linux.hello;
nixosConfigurations.mySystem = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [ ./configuration.nix ];
};
};
}
/etc/nixos/home.nix
{config, pkgs, ... }:
{
home.file."~/.config/hypr/hyprland.conf".text = ''
decoration {
shadow_offset = 0 5
col.shadow = rgba(00000099)
}
$mod = SUPER
bindm = $mod, mouse:272, movewindow
bindm = $mod, mouse:273, resizewindow
bindm = $mod ALT, mouse:272, resizewindow
'';
# ...
}
/etc/nixos/flake.lock
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1702312524,
"narHash": "sha256-gkZJRDBUCpTPBvQk25G0B7vfbpEYM5s5OZqghkjZsnE=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "a9bf124c46ef298113270b1f84a164865987a91c",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}