Hi everyone!
I’ve been using NixOS with relative comfort with Home manager. Recently though, I found myself not learning much about NixOS so I decided to find alternatives to set up NixOS on my desktop and my laptop. I want to share the exact same packages for coding but make a couple of variation for each system e.g. adjusting tmux sizes to fit each device screen properly. For that reason I’m learning about wrappers which seem to be the right solution to this problem however I’m embarrassed to say that I haven’t even been able to wrap my first package (yep, complete beginner here) even though I followed this guide, watched this video did lot of experiments, read articles and tutorials.
This is my code:
configuration.nix
# some config
users.users.wavesinaroom = {
isNormalUser = true;
extraGroups = [ "wheel" ];
packages = with pkgs; [
(import ../wrapped/hx/hx.nix)
tmux
helix
lazygit
glab
w3m
];
shell = pkgs.nushell;
};
# more config
../wrapped/hx/hx.nix
{pkgs,...}:
pkgs.symlinkJoin {
name = "hello";
paths = [ pkgs.hello ];
buildInputs = [ pkgs.makeWrapper];
postBuild = pkgs.writeShellScriptBin "hello ''
exec ${pkgs.hello}/bin/hello -t
''";
}
error: A definition for option `users.users.wavesinaroom.packages."[definition 1-entry 1]"' is not of type `package'
Can anyone point out what I’m doing wrong or missing here please?
I read that stdenv.mkDerivation is the right approach for making packages but it is not mentioned anywhere in the nix cookbook wrappers section, so I’m not sure if that’s actually helpful.