diff --git a/internal/nix/nix.go b/internal/nix/nix.go index 0db2068..1722a86 100644 --- a/internal/nix/nix.go +++ b/internal/nix/nix.go @@ -127,7 +127,7 @@ func (p *flakeLockParser) Parse(filename string, content []byte) (*core.Result, for name, node := range lock.Nodes { // Skip root node - if name == "root" { + if name == lock.Root { continue } diff --git a/manifests_test.go b/manifests_test.go index e28c380..331f461 100644 --- a/manifests_test.go +++ b/manifests_test.go @@ -38,6 +38,7 @@ func TestParseAllEcosystems(t *testing.T) { {"helm Chart.lock", "testdata/helm/Chart.lock", "helm", Lockfile}, {"helm requirements.yaml", "testdata/helm/legacy/requirements.yaml", "helm", Manifest}, {"helm requirements.lock", "testdata/helm/legacy/requirements.lock", "helm", Lockfile}, + {"nix flake.lock", "testdata/nix/flake.lock", "nix", Lockfile}, {"vagrant Vagrantfile", "testdata/vagrant/Vagrantfile", "vagrant", Manifest}, } diff --git a/testdata/nix/flake.lock b/testdata/nix/flake.lock index 8bf87bd..88dc013 100644 --- a/testdata/nix/flake.lock +++ b/testdata/nix/flake.lock @@ -55,7 +55,7 @@ "type": "github" } }, - "root": { + "project": { "inputs": { "flake-utils": "flake-utils", "home-manager": "home-manager", @@ -78,6 +78,6 @@ } } }, - "root": "root", + "root": "project", "version": 7 }