summaryrefslogtreecommitdiff
path: root/3 Resources/Nix/Build images with Nix.md
blob: 3a02a05f56f10ef6fe55619944e0d916f195e42d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
---
tags:
  - nix
  - image
---
`nix-build '<nixpkgs/nixos/release.nix>'  -A iso_minimal.x86_64-linux --arg configuration ./nginx-test.nix -o ./result`

where nginx-test.nix is:
```
{ pkgs, ... }:
{
  security.acme.acceptTerms = true;
  security.acme.email = "jaspert.ras@gmail.com";
  services.nginx = {
    enable = true;
    recommendedGzipSettings = true;
    recommendedOptimisation = true;
    recommendedProxySettings = true;
    recommendedTlsSettings = true;
    virtualHosts."jras.nl" = {
      enableACME = true;
      forceSSL = true;
      locations."/".root = "${pkgs.nginx}/html";
    };
  };
}
```