Skip to content

Instantly share code, notes, and snippets.

Created June 15, 2014 01:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/307d2759b49c662a044a to your computer and use it in GitHub Desktop.
Save anonymous/307d2759b49c662a044a to your computer and use it in GitHub Desktop.
{ config, pkgs, ... }:
{
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
];
# Use the GRUB 2 boot loader.
boot.loader.grub.enable = true;
boot.loader.grub.version = 2;
# Define on which hard drive you want to install Grub.
boot.loader.grub.device = "/dev/sda";
networking.hostName = "nixos";
networking.firewall.allowPing = true;
networking.firewall.allowedTCPPorts = [ 80 443 ];
environment.systemPackages = [ pkgs.python ];
# List services that you want to enable:
services.nginx = {
enable = true;
config = ''
error_log /www/error.log;
events {}
http {
server {
access_log /www/access.log;
listen 80;
server_tokens off;
root /www/root;
}
}
'';
};
# Enable the OpenSSH daemon.
services.openssh.enable = true;
# Define a user account.
users.extraUsers.user = {
name = "user";
createHome = true;
home = "/home/user";
extraGroups = [ "wheel" ];
useDefaultShell = true;
openssh.authorizedKeys.keys = [ "ssh-rsa AAAA... user@host.local" ];
};
security.sudo.wheelNeedsPassword = false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment