about summary refs log tree commit diff
path: root/ops/nixos/default.nix
diff options
context:
space:
mode:
authorVincent Ambo <tazjin@google.com>2020-01-04T15·08+0000
committerVincent Ambo <Vincent Ambo>2020-01-04T22·50+0000
commit1d687c53031277f72a5273b01dab9d4bf37bb862 (patch)
treeb09f359e4e950bc0d655db1241daae932142bf60 /ops/nixos/default.nix
parent3638048c9bd3b1cc46685bb8a6a0c36c6532fdb5 (diff)
chore(ops/nixos): Move NixOS configuration one level up r/327
Diffstat (limited to 'ops/nixos/default.nix')
-rw-r--r--ops/nixos/default.nix48
1 files changed, 48 insertions, 0 deletions
diff --git a/ops/nixos/default.nix b/ops/nixos/default.nix
new file mode 100644
index 0000000000..c73a1ac734
--- /dev/null
+++ b/ops/nixos/default.nix
@@ -0,0 +1,48 @@
+{ pkgs, ... }:
+
+let
+  inherit (pkgs) third_party lib;
+  configuration = rec {
+    boot.loader.systemd-boot.enable = true;
+    boot.loader.efi.canTouchEfiVariables = true;
+    boot.cleanTmpDir = true;
+    hardware.pulseaudio.enable = true;
+    hardware.cpu.intel.updateMicrocode = true;
+    time.timeZone = "Europe/London";
+
+    networking = {
+      # Don't use ISP's DNS servers:
+      nameservers = [
+        "8.8.8.8"
+        "8.8.4.4"
+      ];
+
+      # Open Chromecast-related ports & servedir
+      firewall.allowedTCPPorts = [ 3000 5556 5558 ];
+    };
+
+    # Generate an immutable /etc/resolv.conf from the nameserver settings
+    # above (otherwise DHCP overwrites it):
+    environment.etc."resolv.conf" = with lib; with pkgs; {
+      source = writeText "resolv.conf" ''
+        ${concatStringsSep "\n" (map (ns: "nameserver ${ns}") networking.nameservers)}
+        options edns0
+      '';
+    };
+
+    nixpkgs.config.allowUnfree = true;
+  };
+
+  # Desktop at home
+  stallo = {
+    networking.hostName = "stallo";
+    services.xserver.videoDrivers = [ "nvidia" ];
+    boot.initrd.luks.devices.stallo-luks.device = "/dev/disk/by-uuid/b484cf1e-a27b-4785-8bd6-fa85a004b073";
+
+    fileSystems."/".device = "/dev/disk/by-label/stallo-root";
+  };
+in {
+  stallo = third_party.nixos {
+    configuration = lib.recursiveUpdate configuration stallo;
+  };
+}