Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [root@sakura:/etc/nixos]# cat /etc/nixos/server.nix
- # Server configuration.
- { config, pkgs, ... }:
- {
- services = {
- lighttpd = {
- document-root = /srv/http;
- enableModules = [ "mod_simple_vhost" ];
- extraConfig = ''
- simple-vhost.server-root = "/srv/http"
- simple-vhost.default-host = "localhost"
- simple-vhost.document-root = "/htdocs"
- '';
- };
- gitea = {
- cookieSecure = true;
- repositoryRoot = "/srv/git";
- user = "git";
- appName = "Fireburn's Git";
- rootUrl = "https://git.fireburn.ru";
- };
- };
- users = {
- users = if config.services.gitea.enable == true then {
- git = {
- name = config.services.gitea.user;
- description = "Gitea Service";
- home = config.services.gitea.stateDir;
- createHome = true;
- useDefaultShell = true;
- isNormalUser = false;
- isSystemUser = true;
- };
- } else {};
- };
- }
- # vim: ts=2 sts=2 sw=2 et
- [root@sakura:/etc/nixos]# cat /etc/nixos/containers/web.nix
- { config, lib, pkgs, ... }:
- with lib;
- {
- imports = [
- ../server.nix
- ];
- boot.isContainer = true;
- networking = {
- hostName = mkDefault "web.fireburn.ru";
- useDHCP = false;
- firewall = {
- allowedTCPPorts = [ 80 443 ];
- };
- };
- services = {
- lighttpd = {
- enable = true;
- };
- };
- }
- [root@sakura:/etc/nixos]# cat /etc/nixos/configuration.nix
- # Site-specific configuration file.
- { config, pkgs, ... }:
- {
- imports =
- [
- # Common configuration
- ./common.nix
- # Uncomment for a server system
- #./server.nix
- # Uncomment for a desktop system
- ./desktop.nix
- ];
- # <snip!>
- containers = {
- gitea = (import containers/gitea.nix);
- };
- }
- [root@sakura:/etc/nixos]# nixos-rebuild test
- building Nix...
- building the system configuration...
- error: The option `containers.gitea.services' defined in `/etc/nixos/server.nix' does not exist.
- (use '--show-trace' to show detailed location information)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement