Hi there! I’m having issues setting up hyprland with nixos via home-manager. Any help appreciated!
All files are stored in /etc/nixos
Basically, I’m having a (system managed) home configuration
Home-Configuraiton (hyprland.nix)
{config, pkgs, ... }:
{
wayland.windowManager.hyprland = {
enable = true;
package = pkgs.hyprland;
xwayland.enable = true;
systemd.enable = true;
settings = {
input = {
kb_layout = "de";
};
};
};
}
which will be imported in my home-manager.nix configuration
Home-Configuraiton (home-manager.nix)
{ config, lib, pkgs, jsonConfig, ... }:
let
home-manager-src = builtins.fetchTarball "https://github.com/nix-community/home-manager/archive/release-${jsonConfig.system.version}.tar.gz";
home-manager = import home-manager-src { inherit pkgs; };
hyprlandConfig = import ./home/hyprland.nix { inherit config lib pkgs; };
in
{
imports = [
(import "${home-manager-src}/nixos")
];
# Enable the home-manager command globally
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.backupFileExtension = "backup";
# Add home-manager binary to the system-wide environment
environment.systemPackages = with pkgs; [
home-manager.home-manager
];
# Configure home manager for the user
home-manager.users.${jsonConfig.user.username} = {
home.username = jsonConfig.user.username;
home.homeDirectory = "/home/${jsonConfig.user.username}";
home.stateVersion = jsonConfig.system.version;
...
imports = [
...
hyprlandConfig
];
};
}
which is part of my configuration.nix
System Configuration (configuration.nix)
{ config, lib, pkgs, ... }:
let
configFile = ./config.json;
jsonConfig = builtins.fromJSON (builtins.readFile configFile);
in
{
imports = [
(import ./home-manager.nix { inherit config lib pkgs jsonConfig; })
...
]
nixpkgs.config.allowUnfree = true;
system.stateVersion = jsonConfig.system.version;
}
Everytime, ~/.config/hypr/hyprland.conf
will be written, journalctrl shows the following error
Aug 19 20:10:56 PowerTower hm-activate-<user>[188251]: Creating home file links in /home/<user>
Aug 19 20:10:56 PowerTower hm-activate-<user>[188251]: Activating onFilesChange
Aug 19 20:10:56 PowerTower hm-activate-<user>[188426]: jq: parse error: Unmatched ']' at line 2, column 1
Aug 19 20:10:56 PowerTower hm-activate-<user>[188251]: Activating reloadSystemd
thus the systemd service fails to start
systemctl status home-manager-<user>.service
● home-manager-<user>.service - Home Manager environment for <user>
Loaded: loaded (/etc/systemd/system/home-manager-<user>.service; enabled; preset: enabled)
Active: active (exited) since Mon 2024-08-19 20:10:56 CEST; 8min ago
Process: 188251 ExecStart=/nix/store/8yp9zb8805nl91dpdzips42gx8v0v116-hm-setup-env /nix/store/c500ab1qxdf6gbvfmpnf9qfkqmsq22dm-home-manager-generation (code=exited, status=0/SUCCESS)
Main PID: 188251 (code=exited, status=0/SUCCESS)
IP: 0B in, 0B out
CPU: 424ms
Aug 19 20:10:56 PowerTower hm-activate-<user>[188251]: Activating writeBoundary
Aug 19 20:10:56 PowerTower hm-activate-<user>[188251]: Activating installPackages
Aug 19 20:10:56 PowerTower hm-activate-<user>[188251]: Activating linkGeneration
Aug 19 20:10:56 PowerTower hm-activate-<user>[188251]: Cleaning up orphan links from /home/<user>
Aug 19 20:10:56 PowerTower hm-activate-<user>[188251]: Creating profile generation 52
Aug 19 20:10:56 PowerTower hm-activate-<user>[188251]: Creating home file links in /home/<user>
Aug 19 20:10:56 PowerTower hm-activate-<user>[188251]: Activating onFilesChange
Aug 19 20:10:56 PowerTower hm-activate-<user>[188426]: jq: parse error: Unmatched ']' at line 2, column 1
Aug 19 20:10:56 PowerTower hm-activate-<user>[188251]: Activating reloadSystemd
Aug 19 20:10:56 PowerTower systemd[1]: Finished Home Manager environment for <user>.
I do not use jq
activily for anything, thus I don’t know where this error comes from, how to find out or how to fix it.
The only json related part in my config as that I’m using a file “config.json” as input to configure the username, email, hostname, keys and wheter or not to install some packages to easily manage multiple different setups. I could already rule this out as a potential cause.
Basically, i tried to follow this guide on how to configure hyprland Hyprland - NixOS Wiki
Also, even tough running sudo nixos-rebuild switch
triggers the issue the command it self exits normally.