about summary refs log tree commit diff
path: root/ops/nixos/default.nix
diff options
context:
space:
mode:
authorVincent Ambo <Vincent Ambo>2020-01-04T22·32+0000
committerVincent Ambo <Vincent Ambo>2020-01-04T22·50+0000
commit63dc41bcf38d7463e90b9c888f59ea8087d2f4cb (patch)
treedc94b0a4af994f69e9b0b6f4c89ce56979760558 /ops/nixos/default.nix
parent496648f237d90a7d183a61267736d34596afd825 (diff)
feat(ops/nixos): Check in updated system configuration for 'nugget' r/329
This is the rebrand of the desktop machine, now running a config
straight out of the depot.
Diffstat (limited to 'ops/nixos/default.nix')
-rw-r--r--ops/nixos/default.nix53
1 files changed, 10 insertions, 43 deletions
diff --git a/ops/nixos/default.nix b/ops/nixos/default.nix
index c73a1ac734..02a42425fd 100644
--- a/ops/nixos/default.nix
+++ b/ops/nixos/default.nix
@@ -1,48 +1,15 @@
 { 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";
-  };
+  inherit (pkgs) lib;
+  inherit (builtins) foldl';
+
+  systemFor = configs: (pkgs.third_party.nixos {
+    configuration = lib.fix(config:
+      foldl' lib.recursiveUpdate {} (map (c: c config) configs)
+    );
+  }).system;
 in {
-  stallo = third_party.nixos {
-    configuration = lib.recursiveUpdate configuration stallo;
-  };
+  # TODO(tazjin): rename 'pkgs' -> 'depot'?
+  nuggetSystem = systemFor [ pkgs.ops.nixos.nugget ];
 }