I’m trying to make my first derivation in home-manager config that builds a dotnet project.
{ pkgs, ... }:
{
home.packages = [
(pkgs.buildDotnetModule rec {
pname = "PowerShellEditorServices";
version = "4.1.0";
src = pkgs.fetchFromGitHub {
owner = "PowerShell";
repo = pname;
rev = "v${version}";
hash = "sha256-nOVPs/lnS3vm+mef796g5AnVV0UDoIeuifgkWCTNDyo=";
};
projectFile = "${pname}.sln";
nugetDeps = ./deps.nix;
})
];
}
As the Nixpkgs Reference Manual states:
When packaging a new application, you need to fetch its dependencies. Create an empty
deps.nix
, setnugetDeps = ./deps.nix
, then runnix-build -A package.fetch-deps
to generate a script that will build the lockfile for you.
But I am not sure how could I do this for a home-manager config. The following error raised for nix-build -A package.fetch-deps
error:
… from call site
at /home/sharpchen/.config/home-manager/packages/language-server/default.nix:1:1:
1| { pkgs, ... }:
| ^
2| {
error: function 'anonymous lambda' called without required argument 'pkgs'
at /home/sharpchen/.config/home-manager/packages/language-server/default.nix:1:1:
1| { pkgs, ... }:
| ^
2| {
Or am I following the wrong manual that actually guides for nixpkgs packaging only?