Summary: In my home-manager sway configuration, I can’t refer to “${pkgs.todocalmenu}/bin/todocalmenu” for a keybinding when I have another locally installed flake ‘keepmenu’ that can use that same reference successfully “${pkgs.keepmenu}/bin/keepmenu”. They are (near as I can tell) being built and installed the exact same way other than keepmenu is python and todocalmenu is a golang app.
Here’s my abbreviated config:
/flake.nix
{
description = "System configurations";
inputs = {
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05";
home-manager.url = "github:nix-community/home-manager/release-24.05";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
keepmenu.url = "github:firecat53/keepmenu";
keepmenu.inputs.nixpkgs.follows = "nixpkgs";
todocalmenu.url = "github:firecat53/todocalmenu";
todocalmenu.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = inputs@{
self,
nixpkgs,
nixpkgs-unstable,
home-manager,
...
}: let
inherit (self) outputs;
system = "x86_64-linux";
in {
nixosConfigurations = {
laptop = nixpkgs.lib.nixosSystem {
specialArgs = {
inherit inputs outputs;
};
};
};
}
/hosts/laptop/configuration.nix
{
inputs,
...
}:{
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
../../home-manager/home-manager.nix
inputs.home-manager.nixosModules.home-manager
];
home-manager.users.firecat53 = {
imports = [
../../home-manager/laptop.nix
];
};
....
/home-manager/home-manager.nix
{
inputs,
outputs,
pkgs,
...
}:{
# Home-manager configuration
home-manager = {
extraSpecialArgs = {
inherit inputs outputs pkgs ;
};
};
}
/home-manager/laptop.nix
{
config,
inputs,
sops-nix,
...
{
imports = [
./sway
];
programs.home-manager.enable = true;
home.stateVersion = "23.05";
}
/home-manager/sway/sway.nix
{
config,
lib,
pkgs,
...
}: let
mod = "Mod4";
mod1 = "Mod1";
in {
....
keybindings = let
todocalmenu = "todocalmenu -cmd bemenu -todo /home/firecat53/.local/share/calendars/todo";
keepmenu = "${pkgs.keepmenu}/bin/keepmenu";
in lib.mkOptionDefault {
"${mod}+${mod1}+k" = "exec ${keepmenu}";
"${mod}+${mod1}+t" = "exec ${todocalmenu}";
....
If I use nix repl
and then :lf .
, I can’t seem to find todocalmenu anywhere. If I change the above sway config to “${pkgs.todocalmenu}/bin/todocalmenu” I get the following error:
error:
… while calling the 'head' builtin
at /nix/store/mvz96grv31nxq69ldw5a5pn2qh1s6ca6-source/lib/attrsets.nix:1575:11:
1574| || pred here (elemAt values 1) (head values) then
1575| head values
| ^
1576| else
… while evaluating the attribute 'value'
at /nix/store/mvz96grv31nxq69ldw5a5pn2qh1s6ca6-source/lib/modules.nix:809:9:
808| in warnDeprecation opt //
809| { value = builtins.addErrorContext "while evaluating the option `${showOption loc}':" value;
| ^
810| inherit (res.defsFinal') highestPrio;
(stack trace truncated; use '--show-trace' to show the full trace)
error: attribute 'todocalmenu' missing
at /nix/store/3panizqjpn8dw3l364k9wi6lwrgblsim-source/home-manager/sway/sway.nix:152:28:
151| tmux = "${pkgs.tmux}/bin/tmux";
152| todocalmenu = "${pkgs.todocalmenu}/bin/todocalmenu -cmd bemenu -todo /home/firecat53/.local/share/calendars/todo";
| ^
153| vim = "${pkgs.vim}/bin/vim";
Any ideas??? Thanks!