Skip to content

Instantly share code, notes, and snippets.

@jpf
Last active September 5, 2019 18:36
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 jpf/26f5f105eeccd6c8785a86af5d02fc98 to your computer and use it in GitHub Desktop.
Save jpf/26f5f105eeccd6c8785a86af5d02fc98 to your computer and use it in GitHub Desktop.
{ config, pkgs, ... }:
let
chatServer = "chat.example.com";
in
{
imports = [
./hardware-configuration.nix
];
boot.loader.grub.enable = true;
boot.loader.grub.version = 2;
networking.usePredictableInterfaceNames = false;
environment.systemPackages = with pkgs; [
inetutils
mtr
sysstat
vim
emacs
lsof
jq
git
];
services.nginx = {
enable = true;
virtualHosts."${chatServer}" = {
addSSL = true;
enableACME = true;
locations."/" = {
proxyPass = "http://localhost:8065/";
};
};
};
services.openssh = {
enable = true;
passwordAuthentication = false;
};
services.mattermost = {
enable = true;
siteUrl = "https://${chatServer}/";
};
networking.firewall.allowedTCPPorts = [ 22 80 443 ];
users.users.nato = {
isNormalUser = true;
home = "/home/user1";
description = "User1";
extraGroups = [ "wheel" "networkmanager" ];
openssh.authorizedKeys.keys = [ "ssh-rsa AAAAexample1" ];
};
users.users.joel = {
isNormalUser = true;
home = "/home/joel";
description = "Joel";
extraGroups = [ "wheel" "networkmanager" ];
openssh.authorizedKeys.keys = [ "ssh-rsa AAAA0example2" ];
};
}
{ config, lib, pkgs, ... }:
{
imports =
[ <nixpkgs/nixos/modules/profiles/qemu-guest.nix>
];
boot.kernelParams = [ "console=ttyS0,19200n8" ];
boot.loader.grub.extraConfig = ''
serial --speed=19200 --unit=0 --word=8 --parity=no --stop=1;
terminal_input serial;
terminal_output serial
'';
boot.loader.grub.device = "nodev";
boot.loader.timeout = 10;
boot.initrd.availableKernelModules = [ "virtio_pci" "ahci" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/sda";
fsType = "ext4";
};
swapDevices =
[ { device = "/dev/sdb"; }
];
nix.maxJobs = lib.mkDefault 2;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment