Open theurgi opened 5 days ago
Do you have your nixos/hm config anywhere?
Sure. I'm using a flakes-based setup with Home Manager integrated via the flake, not as a separate tool.
~/nixos-config
├── flake.nix
├── machines
│ ├── machine-p
│ ├── machine-x
│ ├── machine-y
│ └── machine-z
├── modules
│ ├── desktop
│ │ ├── hyprland.nix
│ │ ├── notifications.nix
│ │ ├── stylix.nix
│ │ └── thunar.nix
│ ├── development
│ ├── hardware
│ ├── keyboard
│ ├── networking
│ ├── security
│ ├── services
│ ├── shell
│ ├── system
│ ├── themes
│ └── virtualization
├── overlays
└── users
├── home-manager
│ ├── admin
│ │ ├── default.nix
│ │ └── git.nix
│ ├── shared
│ │ ├── hypridle.nix
│ │ ├── hyprland.nix
│ │ ├── hyprlock.nix
│ │ ├── hyprpaper.nix
│ │ └── etc...
│ ├── user-x
│ │ ├── default.nix
│ │ └── git.nix
│ ├── user-y
│ │ ├── default.nix
│ │ └── git.nix
│ └── user-z
│ ├── default.nix
│ └── git.nix
└── profiles
~/nixos-config/flake.nix
{
description = "NixOS configuration";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
nixvim = {
url = "github:nix-community/nixvim";
inputs.nixpkgs.follows = "nixpkgs";
};
stylix.url = "github:danth/stylix";
nur.url = "github:nix-community/NUR";
};
outputs = {
self,
nixpkgs,
home-manager,
nixvim,
stylix,
nur,
...
} @ inputs: let
supportedSystems = ["x86_64-linux" "aarch64-linux"];
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
stateVersion = "24.05";
# Function to get the last part of the hostname (e.g., "z" from "machine-z")
getHostSuffix = hostName: let
parts = builtins.split "-" hostName;
in
builtins.elemAt parts (builtins.length parts - 1);
importNUR = pkgs:
import nur {
nurpkgs = pkgs;
inherit pkgs;
};
mkSystem = {
system,
hostname,
hasAdmin ? false,
}: let
pkgs = import nixpkgs {
inherit system;
config.allowUnfree = true;
overlays = import ./overlays {inherit inputs;};
};
nurPkgs = importNUR pkgs;
in
nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = {
inherit inputs pkgs stateVersion nurPkgs;
};
modules = [
# Machine-specific configuration
./machines/${hostname}
# Home Manager module
stylix.nixosModules.stylix
home-manager.nixosModules.home-manager
({config, ...}: {
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.backupFileExtension = "backup";
home-manager.extraSpecialArgs = {
inherit nixvim stylix stateVersion nurPkgs;
};
home-manager.users =
{
user = import ./users/home-manager/user-${getHostSuffix hostname}/default.nix;
}
// (
if hasAdmin
then {
admin = import ./users/home-manager/admin/default.nix;
}
else {}
);
})
];
};
in {
nixosConfigurations = {
machine-x = mkSystem {
system = "x86_64-linux";
hostname = "machine-x";
hasAdmin = false;
};
machine-y = mkSystem {
system = "x86_64-linux";
hostname = "machine-y";
hasAdmin = true;
};
machine-z = mkSystem {
system = "x86_64-linux";
hostname = "machine-z";
hasAdmin = true;
};
machine-p = mkSystem {
system = "aarch64-linux";
hostname = "machine-p";
hasAdmin = true;
};
};
# Standalone Home Manager configuration
homeConfigurations = forAllSystems (system: let
pkgs = nixpkgs.legacyPackages.${system};
nurPkgs = importNUR pkgs;
in {
"user@machine-x" = home-manager.lib.homeManagerConfiguration {
inherit pkgs;
extraSpecialArgs = {
inherit nixvim stylix stateVersion nurPkgs;
};
modules = [./users/home-manager/user-x/default.nix];
};
"user@machine-y" = home-manager.lib.homeManagerConfiguration {
inherit pkgs;
extraSpecialArgs = {
inherit nixvim stylix stateVersion nurPkgs;
};
modules = [./users/home-manager/user-y/default.nix];
};
"user@machine-z" = home-manager.lib.homeManagerConfiguration {
inherit pkgs;
extraSpecialArgs = {
inherit nixvim stylix stateVersion nurPkgs;
};
modules = [./users/home-manager/user-z/default.nix];
};
"admin" = home-manager.lib.homeManagerConfiguration {
inherit pkgs;
extraSpecialArgs = {
inherit nixvim stylix stateVersion nurPkgs;
};
modules = [./users/home-manager/admin/default.nix];
};
});
};
}
~/nixos-config/machines/machine-z/default.nix
{...}: {
imports = [
# Machine-specific configurations
./machine-specific/boot.nix
./machine-specific/hardware-configuration.nix
./machine-specific/intel.nix
./machine-specific/swap.nix
./machine-specific/users.nix
# Desktop Environment
../../modules/desktop/hyprland.nix
../../modules/desktop/notifications.nix
../../modules/desktop/stylix.nix
../../modules/desktop/thunar.nix
# etc ...
];
}
~/nixos-config/users/home-manager/user-z/default.nix
{
config,
pkgs,
stylix,
stateVersion,
...
}: let
myThemesSessionVariables =
if config ? myThemes
then config.myThemes.sessionVariables
else {};
in {
imports = [
../shared/hypridle.nix
../shared/hyprland.nix
../shared/hyprlock.nix
../shared/hyprpaper.nix
# etc ...
];
programs.home-manager.enable = true;
home.username = "user";
home.homeDirectory = "/home/user";
home.sessionVariables =
{
BROWSER = "librewolf";
FILE_MANAGER = "yazi";
NIXOS_VERSION = stateVersion;
TERMINAL = "kitty";
}
// myThemesSessionVariables;
home.stateVersion = stateVersion;
}
~/nixos-config/users/home-manager/shared/hyprland.nix
Both hyprland
and hyprpaper
work without issues and generate configs in ~/.config/hypr/
{pkgs, ...}: {
home.packages = with pkgs; [
grim
slurp
wl-clipboard
];
wayland.windowManager.hyprland = {
enable = true;
settings = {
monitor = [
"eDP-1,2880x1800@60,0x0,2"
];
exec-once = [
"mako"
"waybar"
];
input = {
kb_layout = "us";
follow_mouse = 1;
touchpad = {
natural_scroll = false;
disable_while_typing = true;
};
};
general = {
gaps_in = 3;
gaps_out = 6;
border_size = 2;
"layout" = "dwindle";
};
animations = {
enabled = false;
};
decoration = {
blur = {
enabled = false;
};
drop_shadow = false;
};
debug = {
disable_logs = false;
};
};
};
}
I've just checked, and there doesn't seem to be any issue with the modules themselves. For example, checking the diff between hypridle and hyprpaper, the only differences are the names and the example config.
Now I'm checking the obvious, but have you enabled hypridle/hyprlock?
What happens if you put the hyprlock settings in its extraConfig
?
Now I'm checking the obvious, but have you enabled hypridle/hyprlock?
Yes, programs.hyprlock.enable = true
and services.hypridle.enable = true
were both originally set if that's what you're asking.
Moving all hyprlock settings to the extraConfig
did work -- hyprlock is functional, which hyprlock
now returns /etc/profiles/per-user/admin/bin/hyprlock
, and there's a generated config at ~/.config/hypr/hyprlock.conf
.
However, there doesn't appear to be an extraConfig
option for hypridle and it's still not found and generates no config after rebuilding the system.
Correction: The hypridle config is generated at ~/.config/hypr/hypridle.conf
without needing the extraConfig
but the executable is still not in my path and the service is still not found:
admin@machine-z ~
❯ ls /nix/store | rg hypridle
0bxazkddh9vlf708x3grkxvd8pz1x0li-hypridle-0.1.2
28g46b8p4hll15nwrw1iszvsgg7ddd77-hm_hyprhypridle.conf
akqffmrgvnh35fc1blfc75n40id3y3w8-hypridle-0.1.2
hdgb95i2g1l7z30slgc0z8v3xlyxglqz-hypridle.service.drv
jq5r1pfx9cww7xcljzhg6awv03jgg8fc-hypridle-0.1.2.drv
k1y1z0wsqwggydghnr50p7p4nd1fpn7a-hypridle.service
md2d79am59a7wkavc76348rmlw9yz7dr-hypridle-0.1.2.drv
xmrszayh6f4812rgja0g8id8r55xmcsh-hm_hyprhypridle.conf.drv
admin@machine-z ~
❯ which hypridle
hypridle not found
admin@machine-z ~
❯ systemctl status hypridle
Unit hypridle.service could not be found.
Are you following the right branch?
Is there an existing issue for this?
Issue description
I'm having issues getting
hyprlock
andhypridle
to work in my NixOS setup using Home Manager. I'm able to build the system without any errors and the packages are present in the Nix store, but the commands and services are not found, and no configuration is generated.Potentially related issues:
What I've Tried:
which
~/.config/hypr/
System Information:
Service Status:
No Configs Generated:
Nix Store:
Configuration:
Maintainer CC
@khaneliman @fufexan
System information