Skip to content

Instantly share code, notes, and snippets.

@ericsagnes
Created August 23, 2016 05:04
Show Gist options
  • Save ericsagnes/c968966a4bab0636fc8de918bbdc09e3 to your computer and use it in GitHub Desktop.
Save ericsagnes/c968966a4bab0636fc8de918bbdc09e3 to your computer and use it in GitHub Desktop.
# nixos-rebuild build-vm -I nixpkgs=/home/eric/Projects/nixos/nixpkgs -I nixos-config=/tmp/wireguard-conf.nix
{ config, pkgs, ... }:
{
imports =
[
<nixos/modules/installer/scan/not-detected.nix>
];
nix.maxJobs = 4;
nix.useSandbox = true;
security.sudo.enable = true;
users.extraUsers.alice = {
createHome = true;
home = "/home/alice";
description = "Alice";
extraGroups = [ "wheel" ];
isSystemUser = false;
useDefaultShell = true;
password = "alice";
};
networking.wireguard = {
interfaces.wg0 = {
ip = "192.168.4.5/24";
privateKey = "WEAuaVuhdyscyTCXVfBDJR6nf9zxD75jmJzrfhkyE3Y=";
peers = [
{ publicKey = "Uha1fHzOY6hPhq54fcrElVdNF/XQDzQ90rDT7+IqIgA=";
endpoint = "demo.wireguard.io:12912";
allowedIPs = [ "0.0.0.0/0" ];
persistentKeepalive = 25; }
];
};
};
hardware.enableAllFirmware = true;
sound.enable = false;
# Select internationalisation properties.
i18n = {
consoleFont = "lat9w-16";
consoleKeyMap = "jp106";
defaultLocale = "en_US.UTF-8";
};
services.xserver = {
enable = true;
layout = "jp";
videoDrivers = ["intel"];
desktopManager.default = "none";
desktopManager.xterm.enable = false;
displayManager.slim.enable = true;
windowManager.default = "i3";
windowManager.i3.enable = true;
};
time.timeZone = "Asia/Tokyo";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment