diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..7bd60b8 --- /dev/null +++ b/flake.nix @@ -0,0 +1,30 @@ +{ + inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-20.03"; + + outputs = { self, nixpkgs }: { + + nixosConfigurations.container = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + modules = + [ ({ pkgs, ... }: { + boot.isContainer = true; + + # Let 'nixos-version --json' know about the Git revision + # of this flake. + system.configurationRevision = nixpkgs.lib.mkIf (self ? rev) self.rev; + + # Network configuration. + networking.useDHCP = false; + networking.firewall.allowedTCPPorts = [ 80 ]; + + # Enable a web server. + services.httpd = { + enable = true; + adminAddr = "morty@example.org"; + }; + }) + ]; + }; + + }; +}