Hello everbody! Quite new to nixos, so I hope I am not asking something obvious. I’d like to install Apache guacamole which can only be found in unstable. I followed this https://nlewo.github.io/nixos-manual-sphinx/development/replace-modules.xml.HTML part of the manual ending up with an import statement as follows
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
# Guacamole from unstable
# sudo nix-channel --add http://nixos.org/channels/nixos-unstable nixos-unstable
<nixos-unstable/nixos/modules/services/web-apps/guacamole-client.nix>
<nixos-unstable/nixos/modules/services/web-apps/guacamole-server.nix>
];
But when I add
services.guacamole-server.enable = true;
And try to rebuilt, I get an error: guacamole-server cannot be found in pkgs
Any hints what I am doing wrong?
1 Like
You will need to set services.guacamole-server.package
to the package in unstable
Something like this might work for that:
let
unstablePkgs = import "<nixos-unstable>" { };
in {
services.guacamole-server.package = unstablePkgs.guacamole-server;
}
You might need to do something similar for guacamole-client if you use that.
1 Like
Thanks will try that later.
1 Like
This might be a noob mistake but I get an error
error: syntax error, uexpected LET
If I put it closed to the service declaration
If I put it directly after {config…} I get
error: attempt to call something which is not a function but a set
(Google told me to try that)
Thanks for trying to help!
Carunga
September 5, 2023, 8:54am
5
So if anyone interested here is a working config:
{
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
# Guacamole from unstable
# sudo nix-channel --add http://nixos.org/channels/nixos-unstable nixos-unstable
<nixos-unstable/nixos/modules/services/web-apps/guacamole-client.nix>
<nixos-unstable/nixos/modules/services/web-apps/guacamole-server.nix>
];
nixpkgs.config = {
packageOverrides = pkgs: {
unstable = import <nixos-unstable> { # pass the nixpkgs config to the stable alias
config = config.nixpkgs.config;
};
};
};
services.guacamole-server.package = pkgs.unstable.guacamole-server;
services.guacamole-client.package = pkgs.unstable.guacamole-client;
services.guacamole-client.enable = true;
services.guacamole-server.enable = true;
If this way of doing things has disadvantages please let me know. I am trying to learn.