From 1b9fc87e77e8a0d0da805d5461f96fcc129b077a Mon Sep 17 00:00:00 2001
From: clerie <git@clerie.de>
Date: Sun, 6 Dec 2020 16:40:47 +0100
Subject: [PATCH] Initial commit

---
 configuration/common/default.nix        | 27 +++++++++++++++++++++++++
 hosts/carbon/configuration.nix          | 27 +++++++++++++++++++++++++
 hosts/carbon/hardware-configuration.nix | 23 +++++++++++++++++++++
 3 files changed, 77 insertions(+)
 create mode 100644 configuration/common/default.nix
 create mode 100644 hosts/carbon/configuration.nix
 create mode 100644 hosts/carbon/hardware-configuration.nix

diff --git a/configuration/common/default.nix b/configuration/common/default.nix
new file mode 100644
index 0000000..c1b32a0
--- /dev/null
+++ b/configuration/common/default.nix
@@ -0,0 +1,27 @@
+{ config, pkgs, lib, ... }:
+
+{
+  networking.domain = "net.clerie.de";
+
+  time.timeZone = "Europe/Berlin";
+
+  i18n.defaultLocale = "en_US.UTF-8";
+  console = {
+    keyMap = "de-latin1";
+  };
+
+  users.users.clerie = {
+    isNormalUser = true;
+    extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user.
+  };
+
+  environment.systemPackages = with pkgs; [
+    htop
+    tmux
+  ];
+
+  services.openssh.enable = true;
+  services.openssh.passwordAuthentication = false;
+  services.openssh.challengeResponseAuthentication = false;
+  services.openssh.permitRootLogin = lib.mkDefault "no";
+}
diff --git a/hosts/carbon/configuration.nix b/hosts/carbon/configuration.nix
new file mode 100644
index 0000000..bba9605
--- /dev/null
+++ b/hosts/carbon/configuration.nix
@@ -0,0 +1,27 @@
+{ config, pkgs, ... }:
+
+{
+  imports =
+    [
+      ./hardware-configuration.nix
+      ../../configuration/common
+    ];
+
+  boot.kernelParams = [ "console=ttyS0,115200n8" ];
+
+  boot.loader.grub.enable = true;
+  boot.loader.grub.version = 2;
+  boot.loader.grub.device = "/dev/sda";
+  boot.loader.grub.extraConfig = "
+    serial --speed=115200 --unit=0 --word=8 --parity=no --stop=1
+    terminal_input serial
+    terminal_output serial
+  ";
+
+  networking.hostName = "carbon";
+
+  networking.useDHCP = false;
+  networking.interfaces.enp1s0.useDHCP = true;
+
+  system.stateVersion = "21.03";
+}
diff --git a/hosts/carbon/hardware-configuration.nix b/hosts/carbon/hardware-configuration.nix
new file mode 100644
index 0000000..5de62c1
--- /dev/null
+++ b/hosts/carbon/hardware-configuration.nix
@@ -0,0 +1,23 @@
+# Do not modify this file!  It was generated by ‘nixos-generate-config’
+# and may be overwritten by future invocations.  Please make changes
+# to /etc/nixos/configuration.nix instead.
+{ config, lib, pkgs, modulesPath, ... }:
+
+{
+  imports =
+    [ (modulesPath + "/installer/scan/not-detected.nix")
+    ];
+
+  boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "ehci_pci" "usb_storage" "sd_mod" "sdhci_pci" ];
+  boot.initrd.kernelModules = [ ];
+  boot.kernelModules = [ "kvm-amd" ];
+  boot.extraModulePackages = [ ];
+
+  fileSystems."/" =
+    { device = "/dev/disk/by-uuid/26bd769b-e75c-40a6-beb5-a01539f5d210";
+      fsType = "ext4";
+    };
+
+  swapDevices = [ ];
+
+}