Re: [Nix-dev] [nix-dev] private NixOS modules
i think musnix is a nice example how to do this: https://github.com/musnix/musnix Quoting Sergey Mironov (2015-11-18 10:45:54) > Oh, Thanks. I really should re-read the manual :) > > Sergey > > 2015-11-18 12:16 GMT+03:00 Nicolas Pierron: > > Hi Sergey, > > > > We have a some documenation in the NixOS Manual [1] which explains how > > to do that. To make it short, your configuration.nix file should have > > an import attribute which is a list of additional modules that you > > want to include. > > So if you file configuration.nix looks something like (a), you want to > > convert it to something similar to (b) > > > > ** (a): > > { > > services.openssh.enable = true = …; > > … > > } > > > > ** (b): > > > > { > > imports = [ ./custom-service.nix ]; > > services.openssh.enable = true = …; > > … > > } > > > > [1] http://nixos.org/nixos/manual/index.html#sec-modularity > > > > On Wed, Nov 18, 2015 at 8:14 AM, Sergey Mironov wrote: > >> Nicolas, I didn't know about NIXOS_EXTRA_MODULE_PATH, thanks. > >> Could you explain other possible solution in a bit more details? How > >> can we include modified module list in configuration.nix? > >> > >> Regards, > >> Sergey > >> > >> 2015-11-17 17:43 GMT+03:00 Nicolas Pierron : > >>> Hi Sergey, > >>> > >>> I think you can set the NIXOS_EXTRA_MODULE_PATH [1] environment > >>> variable to achieve that. > >>> Otherwise, you can change your configuration.nix file to always > >>> include your new module list, and to include your own real-config.nix > >>> > >>> [1] > >>> https://github.com/NixOS/nixpkgs/blob/master/nixos/lib/eval-config.nix#L30 > >>> > >>> > >>> On Tue, Nov 17, 2015 at 2:04 PM, Sergey Mironov wrote: > Hi. I'd like to write a couple of NixOS modules which probably don't > look meaningful for large audience. Normally, we keep modules in > nixpkgs/nixos/modules directory and list them in module-list.nix file. > In my case, I'd like to put module in a private place (which is my git > repo which keeps nixpkgs as a Git submodule). Is it possible to > 'include' them in the public list to make them accessible from > per-system.nix files? > > As a result, I'd like to be able to write in configuration.nix > something like the following: > > services.my-custom-service = { > enable = true; > ... > } > > without including expression for my-custom-service in the public tree. > > Regards, > Sergey > ___ > nix-dev mailing list > nix-dev@lists.science.uu.nl > http://lists.science.uu.nl/mailman/listinfo/nix-dev > >>> > >>> > >>> > >>> -- > >>> Nicolas Pierron > >>> http://www.linkedin.com/in/nicolasbpierron - http://nbp.name/ > > > > > > > > -- > > Nicolas Pierron > > http://www.linkedin.com/in/nicolasbpierron - http://nbp.name/ > ___ > nix-dev mailing list > nix-dev@lists.science.uu.nl > http://lists.science.uu.nl/mailman/listinfo/nix-dev -- Rok Garbas - http://www.garbas.si signature.asc Description: signature ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev
Re: [Nix-dev] [nix-dev] private NixOS modules
Hi Sergey, We have a some documenation in the NixOS Manual [1] which explains how to do that. To make it short, your configuration.nix file should have an import attribute which is a list of additional modules that you want to include. So if you file configuration.nix looks something like (a), you want to convert it to something similar to (b) ** (a): { services.openssh.enable = true = …; … } ** (b): { imports = [ ./custom-service.nix ]; services.openssh.enable = true = …; … } [1] http://nixos.org/nixos/manual/index.html#sec-modularity On Wed, Nov 18, 2015 at 8:14 AM, Sergey Mironovwrote: > Nicolas, I didn't know about NIXOS_EXTRA_MODULE_PATH, thanks. > Could you explain other possible solution in a bit more details? How > can we include modified module list in configuration.nix? > > Regards, > Sergey > > 2015-11-17 17:43 GMT+03:00 Nicolas Pierron : >> Hi Sergey, >> >> I think you can set the NIXOS_EXTRA_MODULE_PATH [1] environment >> variable to achieve that. >> Otherwise, you can change your configuration.nix file to always >> include your new module list, and to include your own real-config.nix >> >> [1] >> https://github.com/NixOS/nixpkgs/blob/master/nixos/lib/eval-config.nix#L30 >> >> >> On Tue, Nov 17, 2015 at 2:04 PM, Sergey Mironov wrote: >>> Hi. I'd like to write a couple of NixOS modules which probably don't >>> look meaningful for large audience. Normally, we keep modules in >>> nixpkgs/nixos/modules directory and list them in module-list.nix file. >>> In my case, I'd like to put module in a private place (which is my git >>> repo which keeps nixpkgs as a Git submodule). Is it possible to >>> 'include' them in the public list to make them accessible from >>> per-system.nix files? >>> >>> As a result, I'd like to be able to write in configuration.nix >>> something like the following: >>> >>> services.my-custom-service = { >>> enable = true; >>> ... >>> } >>> >>> without including expression for my-custom-service in the public tree. >>> >>> Regards, >>> Sergey >>> ___ >>> nix-dev mailing list >>> nix-dev@lists.science.uu.nl >>> http://lists.science.uu.nl/mailman/listinfo/nix-dev >> >> >> >> -- >> Nicolas Pierron >> http://www.linkedin.com/in/nicolasbpierron - http://nbp.name/ -- Nicolas Pierron http://www.linkedin.com/in/nicolasbpierron - http://nbp.name/ ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev
Re: [Nix-dev] [nix-dev] private NixOS modules
Oh, Thanks. I really should re-read the manual :) Sergey 2015-11-18 12:16 GMT+03:00 Nicolas Pierron: > Hi Sergey, > > We have a some documenation in the NixOS Manual [1] which explains how > to do that. To make it short, your configuration.nix file should have > an import attribute which is a list of additional modules that you > want to include. > So if you file configuration.nix looks something like (a), you want to > convert it to something similar to (b) > > ** (a): > { > services.openssh.enable = true = …; > … > } > > ** (b): > > { > imports = [ ./custom-service.nix ]; > services.openssh.enable = true = …; > … > } > > [1] http://nixos.org/nixos/manual/index.html#sec-modularity > > On Wed, Nov 18, 2015 at 8:14 AM, Sergey Mironov wrote: >> Nicolas, I didn't know about NIXOS_EXTRA_MODULE_PATH, thanks. >> Could you explain other possible solution in a bit more details? How >> can we include modified module list in configuration.nix? >> >> Regards, >> Sergey >> >> 2015-11-17 17:43 GMT+03:00 Nicolas Pierron : >>> Hi Sergey, >>> >>> I think you can set the NIXOS_EXTRA_MODULE_PATH [1] environment >>> variable to achieve that. >>> Otherwise, you can change your configuration.nix file to always >>> include your new module list, and to include your own real-config.nix >>> >>> [1] >>> https://github.com/NixOS/nixpkgs/blob/master/nixos/lib/eval-config.nix#L30 >>> >>> >>> On Tue, Nov 17, 2015 at 2:04 PM, Sergey Mironov wrote: Hi. I'd like to write a couple of NixOS modules which probably don't look meaningful for large audience. Normally, we keep modules in nixpkgs/nixos/modules directory and list them in module-list.nix file. In my case, I'd like to put module in a private place (which is my git repo which keeps nixpkgs as a Git submodule). Is it possible to 'include' them in the public list to make them accessible from per-system.nix files? As a result, I'd like to be able to write in configuration.nix something like the following: services.my-custom-service = { enable = true; ... } without including expression for my-custom-service in the public tree. Regards, Sergey ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev >>> >>> >>> >>> -- >>> Nicolas Pierron >>> http://www.linkedin.com/in/nicolasbpierron - http://nbp.name/ > > > > -- > Nicolas Pierron > http://www.linkedin.com/in/nicolasbpierron - http://nbp.name/ ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev
Re: [Nix-dev] [nix-dev] private NixOS modules
Nicolas, I didn't know about NIXOS_EXTRA_MODULE_PATH, thanks. Could you explain other possible solution in a bit more details? How can we include modified module list in configuration.nix? Regards, Sergey 2015-11-17 17:43 GMT+03:00 Nicolas Pierron: > Hi Sergey, > > I think you can set the NIXOS_EXTRA_MODULE_PATH [1] environment > variable to achieve that. > Otherwise, you can change your configuration.nix file to always > include your new module list, and to include your own real-config.nix > > [1] https://github.com/NixOS/nixpkgs/blob/master/nixos/lib/eval-config.nix#L30 > > > On Tue, Nov 17, 2015 at 2:04 PM, Sergey Mironov wrote: >> Hi. I'd like to write a couple of NixOS modules which probably don't >> look meaningful for large audience. Normally, we keep modules in >> nixpkgs/nixos/modules directory and list them in module-list.nix file. >> In my case, I'd like to put module in a private place (which is my git >> repo which keeps nixpkgs as a Git submodule). Is it possible to >> 'include' them in the public list to make them accessible from >> per-system.nix files? >> >> As a result, I'd like to be able to write in configuration.nix >> something like the following: >> >> services.my-custom-service = { >> enable = true; >> ... >> } >> >> without including expression for my-custom-service in the public tree. >> >> Regards, >> Sergey >> ___ >> nix-dev mailing list >> nix-dev@lists.science.uu.nl >> http://lists.science.uu.nl/mailman/listinfo/nix-dev > > > > -- > Nicolas Pierron > http://www.linkedin.com/in/nicolasbpierron - http://nbp.name/ ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev
Re: [Nix-dev] [nix-dev] private NixOS modules
Hi Sergey, I think you can set the NIXOS_EXTRA_MODULE_PATH [1] environment variable to achieve that. Otherwise, you can change your configuration.nix file to always include your new module list, and to include your own real-config.nix [1] https://github.com/NixOS/nixpkgs/blob/master/nixos/lib/eval-config.nix#L30 On Tue, Nov 17, 2015 at 2:04 PM, Sergey Mironovwrote: > Hi. I'd like to write a couple of NixOS modules which probably don't > look meaningful for large audience. Normally, we keep modules in > nixpkgs/nixos/modules directory and list them in module-list.nix file. > In my case, I'd like to put module in a private place (which is my git > repo which keeps nixpkgs as a Git submodule). Is it possible to > 'include' them in the public list to make them accessible from > per-system.nix files? > > As a result, I'd like to be able to write in configuration.nix > something like the following: > > services.my-custom-service = { > enable = true; > ... > } > > without including expression for my-custom-service in the public tree. > > Regards, > Sergey > ___ > nix-dev mailing list > nix-dev@lists.science.uu.nl > http://lists.science.uu.nl/mailman/listinfo/nix-dev -- Nicolas Pierron http://www.linkedin.com/in/nicolasbpierron - http://nbp.name/ ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev
[Nix-dev] [nix-dev] private NixOS modules
Hi. I'd like to write a couple of NixOS modules which probably don't look meaningful for large audience. Normally, we keep modules in nixpkgs/nixos/modules directory and list them in module-list.nix file. In my case, I'd like to put module in a private place (which is my git repo which keeps nixpkgs as a Git submodule). Is it possible to 'include' them in the public list to make them accessible from per-system.nix files? As a result, I'd like to be able to write in configuration.nix something like the following: services.my-custom-service = { enable = true; ... } without including expression for my-custom-service in the public tree. Regards, Sergey ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev