Skip to content

Commit

Permalink
packet: init
Browse files Browse the repository at this point in the history
  • Loading branch information
vaibhavsagar committed Aug 20, 2019
1 parent 5d291f4 commit e49e9a9
Show file tree
Hide file tree
Showing 7 changed files with 213 additions and 0 deletions.
92 changes: 92 additions & 0 deletions packet/configuration.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running ‘nixos-help’).

{ config, pkgs, ... }:

{
imports =
[ # Include the results of the hardware scan.
./packet.nix
];

# Use the GRUB 2 boot loader.
boot.loader.grub.enable = true;
boot.loader.grub.version = 2;
# boot.loader.grub.efiSupport = true;
# boot.loader.grub.efiInstallAsRemovable = true;
# boot.loader.efi.efiSysMountPoint = "/boot/efi";
# Define on which hard drive you want to install Grub.
# boot.loader.grub.device = "/dev/sda"; # or "nodev" for efi only

# networking.hostName = "nixos"; # Define your hostname.
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.

# Configure network proxy if necessary
# networking.proxy.default = "http://user:password@proxy:port/";
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";

# Select internationalisation properties.
# i18n = {
# consoleFont = "Lat2-Terminus16";
# consoleKeyMap = "us";
# defaultLocale = "en_US.UTF-8";
# };

# Set your time zone.
# time.timeZone = "Europe/Amsterdam";

# List packages installed in system profile. To search, run:
# $ nix search wget
# environment.systemPackages = with pkgs; [
# wget vim
# ];

# Some programs need SUID wrappers, can be configured further or are
# started in user sessions.
# programs.mtr.enable = true;
# programs.gnupg.agent = { enable = true; enableSSHSupport = true; };

# List services that you want to enable:

# Enable the OpenSSH daemon.
# services.openssh.enable = true;

# Open ports in the firewall.
# networking.firewall.allowedTCPPorts = [ ... ];
# networking.firewall.allowedUDPPorts = [ ... ];
# Or disable the firewall altogether.
# networking.firewall.enable = false;

# Enable CUPS to print documents.
# services.printing.enable = true;

# Enable sound.
# sound.enable = true;
# hardware.pulseaudio.enable = true;

# Enable the X11 windowing system.
# services.xserver.enable = true;
# services.xserver.layout = "us";
# services.xserver.xkbOptions = "eurosign:e";

# Enable touchpad support.
# services.xserver.libinput.enable = true;

# Enable the KDE Desktop Environment.
# services.xserver.displayManager.sddm.enable = true;
# services.xserver.desktopManager.plasma5.enable = true;

# Define a user account. Don't forget to set a password with ‘passwd’.
# users.users.jane = {
# isNormalUser = true;
# extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user.
# };

# This value determines the NixOS release with which your system is to be
# compatible, in order to avoid breaking some software such as database
# servers. You should change this only after NixOS release notes say you
# should.
system.stateVersion = "19.03"; # Did you read the comment?

}
7 changes: 7 additions & 0 deletions packet/packet.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{ imports = [
./packet/f4c36jygs5lzylc068ar4dc2fnr28avm-standard.nix
./packet/1n1hfficljybycq3q1a3cw0p3izprz8x-installed.nix
./packet/metadata.nix
./packet/host-id.nix
./packet/j6x8sp1l2gbc9nix39c6ssfrvplix34g-hardware.nix
]; }
21 changes: 21 additions & 0 deletions packet/packet/1n1hfficljybycq3q1a3cw0p3izprz8x-installed.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
boot.loader.grub.devices = [ "/dev/sda" ];
boot.loader.grub.extraConfig = ''
serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1
terminal_output serial console
terminal_input serial console
'';

fileSystems = {
"/" = {
device = "/dev/disk/by-label/nixos";
fsType = "ext4";
};
};

swapDevices = [
{
label = "swap";
}
];
}
4 changes: 4 additions & 0 deletions packet/packet/f4c36jygs5lzylc068ar4dc2fnr28avm-standard.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
boot.kernelModules = [ "dm_multipath" "dm_round_robin" "ipmi_watchdog" ];
services.openssh.enable = true;
}
1 change: 1 addition & 0 deletions packet/packet/host-id.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{ networking.hostId = "4726b5d9"; }
15 changes: 15 additions & 0 deletions packet/packet/j6x8sp1l2gbc9nix39c6ssfrvplix34g-hardware.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
nixpkgs.config.allowUnfree = true;

boot.initrd.availableKernelModules = [
"ehci_pci" "ahci" "usbhid" "sd_mod"
];

boot.kernelModules = [ "kvm-intel" ];
boot.kernelParams = [ "console=ttyS1,115200n8" ];
boot.extraModulePackages = [ ];

hardware.enableAllFirmware = true;

nix.maxJobs = 4;
}
73 changes: 73 additions & 0 deletions packet/packet/metadata.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
{
networking.hostName = "nixos";
networking.dhcpcd.enable = false;
networking.defaultGateway = {
address = "147.75.38.112";
interface = "bond0";
};
networking.defaultGateway6 = {
address = "2604:1380:0:3e00::";
interface = "bond0";
};
networking.nameservers = [
"147.75.207.207"
"147.75.207.208"
];

networking.bonds.bond0 = {
driverOptions = {
mode = "balance-tlb";
xmit_hash_policy = "layer3+4";
downdelay = "200";
updelay = "200";
miimon = "100";
};

interfaces = [
"enp0s20f0" "enp0s20f1"
];
};

networking.interfaces.bond0 = {
useDHCP = false;

ipv4 = {
routes = [
{
address = "10.0.0.0";
prefixLength = 8;
via = "10.99.19.0";
}
];
addresses = [
{
address = "147.75.38.113";
prefixLength = 31;
}
{
address = "10.99.19.1";
prefixLength = 31;
}
];
};

ipv6 = {
addresses = [
{
address = "2604:1380:0:3e00::1";
prefixLength = 127;
}
];
};
};

users.users.root.openssh.authorizedKeys.keys = [
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC19+d/67xRzzlzETcbM9ICHvzaCSxhovQDxXggs+ub8E8gC2vDImYoqoaefybHiGHXhOCPHuDRPWU4ZQTDjZxDEm7YgpCpFIQHZmxm3DxPb36hQOxCDcvUCmxKeyUacBe6IHu+PMuxf4nQuL1cFVtG076cuoFBOqgYsBpnQID6zfUQ1RIWgkIlKy/dCtCyILIcTbK6dOulC23IT0tGUF2gdkAuiglPO0SJTGL+cQQSdv86ZMoGczmna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odJ6fzSU30E1FW8Snu0BQ+q+IgPMCp8oFvxz2AUoHA47TOMOn9xWHqf+Nh63RXaYEF5HDAGWeDQl/w== vaibhavsagar@gmail.com"

];

users.users.root.initialHashedPassword = "$6$FjnEegAHdlvZYeWg$s2sXhCpkS.kJzECO51B.9/d2xq8YfxTpc01hl0YwoNlgSqaTJ4JMHW0YK3vJmJyA0quZqoFrOwFj6sN0wxQhV/";
}

0 comments on commit e49e9a9

Please sign in to comment.