Skip to content

Latest commit

 

History

History
148 lines (132 loc) · 3.41 KB

sputnik.md

File metadata and controls

148 lines (132 loc) · 3.41 KB
Error in user YAML: (<unknown>): mapping values are not allowed in this context at line 1 column 17
---
title: Systems :: Sputnik
---

This is the system configuration for my primary development PC.

/*
<<<license>>>
*/
{ config, pkgs, lib, ... }:

let secrets = import ./sputnik.secret.nix;
in {
  assertions = let
    hw = config.interface.hardware;
  in [
    <<<systems/sputnik/asserts>>>
  ];

  <<<systems/sputnik/networking>>>
  <<<systems/sputnik/user>>>
  <<<systems/sputnik/security>>>
  <<<systems/sputnik/kernel>>>
  <<<systems/sputnik/gui>>>
  <<<systems/sputnik/misc>>>
  <<<systems/sputnik/packages>>>
}

Assertions

The first thing we need to do is ensure that everything needed to run is included in the hardware configuration. This is accomplished through the following block:

# systems/sputnik/asserts
{ assertion = hw.networking;
  message = "This configuration requires networking to be configured!";
}
{ assertion = hw.gui;
  message = "This configuration requires graphical hardware to be configured!";
}

Networking

Now, we get to defining networking configurations. This is mostly done in hardware, but there are a few things to define here which are not hardware-specific.

# systems/sputnik/networking
networking = {
  inherit (secrets) firewall;
  hostName = lib.mkForce secrets.hostName;
};

User Configuration

Next, we'll set up system user configuration, such as the root user.

# systems/sputnik/user
users.mutableUsers = false;
users.users.root = {
  shell = pkgs.oksh;
  hashedPassword = secrets.hashedPasswords.root;
};

Security

Here, we set up a few security features such as doas and polkit.

# systems/sputnik/security
security.doas.enable = true;
security.polkit.enable = true;

services.clamav = {
  daemon.enable = true;
  updater = {
    enable = true;
    frequency = 4;
  };
};

services.openssh.enable = true;
programs.ssh.startAgent = true;

Kernel

Here, we set up the Linux kernel configuration. I personally use Xanmod for performance. I'll also set up other kernel-related items here.

# systems/sputnik/kernel
# TODO: Introduce a separate gaming specialisation so that I can use a hardened kernel by default.
boot.kernelPackages = pkgs.linuxPackages_xanmod;
virtualisation.docker.enable = true;

GUI

Here, we configure the X server and display manager.

# systems/sputnik/gui
services.xserver = {
  enable = true;
  layout = "us";

  displayManager.lightdm = {
    enable = true;
    greeters.gtk = {
      enable = true;
      theme = {
        package = pkgs.nordic;
        name = "Nordic";
      };
      iconTheme = {
        package = pkgs.numix-icon-theme-circle;
        name = "Numix-Circle";
      };
    };
  };
};

Miscellaneous

Here, we have everything which doesn't fit into a category cleanly.

# systems/sputnik/misc
documentation.man.generateCaches = true;
services.dbus.packages = with pkgs; [ dconf ];

virtualisation.libvirtd = {
    enable = true;
    qemu = {
        ovmf.enable = true;
    };
};

Packages

The set of packages to include with the system, most user utilities should be in the user configurations.

# systems/sputnik/packages
environment.systemPackages = with pkgs; [
  curl
  git
  htop
  lynx
  openal
  neovim-nightly
  pulseaudio
  tinycc
  transcrypt
  wget
];