@@ -32,21 +32,23 @@ Include the nixos module in your configuration:
32
32
inputs = {
33
33
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable-small";
34
34
35
- nix-index-database.url = "github:nix-community/nix-index-database";
36
- nix-index-database.inputs.nixpkgs.follows = "nixpkgs";
35
+ nix-index-database = {
36
+ inputs.nixpkgs.follows = "nixpkgs";
37
+ url = "github:nix-community/nix-index-database";
38
+ };
37
39
};
38
40
39
41
outputs = { self, nixpkgs, nix-index-database, ... }: {
40
- nixosConfigurations = {
41
- my-nixos = nixpkgs.lib.nixosSystem {
42
- system = "x86_64-linux";
43
- modules = [
44
- ./configuration.nix
45
- nix-index-database.nixosModules.nix-index
46
- # optional to also wrap and install comma
47
- # { programs.nix-index-database. comma.enable = true; }
48
- ];
49
- } ;
42
+ nixosConfigurations.my-nixos = nixpkgs.lib.nixosSystem {
43
+ system = "x86_64-linux";
44
+
45
+ modules = [
46
+ ./configuration.nix
47
+ nix-index-database.nixosModules.nix-index
48
+
49
+ # Optionally wrap and install pkgs. comma.
50
+ { programs.nix-index-database.comma.enable = true; }
51
+ ] ;
50
52
};
51
53
};
52
54
}
@@ -61,21 +63,23 @@ You can then call `nix-locate` as usual, it will automatically use the database
61
63
inputs = {
62
64
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable-small";
63
65
64
- nix-index-database.url = "github:nix-community/nix-index-database";
65
- nix-index-database.inputs.nixpkgs.follows = "nixpkgs";
66
+ nix-index-database = {
67
+ inputs.nixpkgs.follows = "nixpkgs";
68
+ url = "github:nix-community/nix-index-database";
69
+ };
66
70
};
67
71
68
72
outputs = { self, nixpkgs, nix-index-database, ... }: {
69
- darwinConfigurations = {
70
- my-machine = nixpkgs.lib.nixosSystem {
71
- system = "x86_64-linux";
72
- modules = [
73
- ./configuration.nix
74
- nix-index-database.darwinModules.nix-index
75
- # optional to also wrap and install comma
76
- # { programs.nix-index-database. comma.enable = true; }
77
- ];
78
- } ;
73
+ darwinConfigurations.my-darwin = nixpkgs.lib.nixosSystem {
74
+ system = "x86_64-linux";
75
+
76
+ modules = [
77
+ ./configuration.nix
78
+ nix-index-database.darwinModules.nix-index
79
+
80
+ # Optionally wrap and install pkgs. comma.
81
+ { programs.nix-index-database.comma.enable = true; }
82
+ ] ;
79
83
};
80
84
};
81
85
}
@@ -93,32 +97,35 @@ You can then call `nix-locate` as usual, it will automatically use the database
93
97
``` nix
94
98
{
95
99
inputs = {
96
- # Specify the source of Home Manager and Nixpkgs.
97
100
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
101
+
98
102
home-manager = {
99
103
url = "github:nix-community/home-manager";
100
104
inputs.nixpkgs.follows = "nixpkgs";
101
105
};
102
106
103
- nix-index-database.url = "github:nix-community/nix-index-database";
104
- nix-index-database.inputs.nixpkgs.follows = "nixpkgs";
107
+ nix-index-database = {
108
+ inputs.nixpkgs.follows = "nixpkgs";
109
+ url = "github:nix-community/nix-index-database";
110
+ };
105
111
};
112
+
106
113
outputs = { nixpkgs, home-manager, nix-index-database, ... }:
107
114
let
108
115
system = "x86_64-linux";
109
116
pkgs = nixpkgs.legacyPackages.${system};
110
117
in {
111
- homeConfigurations.jdoe = home-manager.lib.homeManagerConfiguration {
118
+ homeConfigurations.my-home = home-manager.lib.homeManagerConfiguration {
112
119
inherit pkgs;
113
120
114
121
modules = [
115
122
nix-index-database.hmModules.nix-index
116
- # optional to also wrap and install comma
117
- # { programs.nix-index-database.comma.enable = true; }
123
+
124
+ # Optionally wrap and install pkgs.comma.
125
+ { programs.nix-index-database.comma.enable = true; }
118
126
];
119
127
};
120
128
};
121
-
122
129
}
123
130
```
124
131
0 commit comments