boxen/configuration.nix

143 lines
3.8 KiB
Nix
Raw Normal View History

2020-10-28 11:44:08 +00:00
# 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, lib, ... }:
2020-10-28 11:44:08 +00:00
let
2020-10-30 18:40:08 +00:00
local = import ./local.nix { inherit config pkgs lib; };
hostName = local.networking.hostName;
host-config = ./machines + "/${hostName}.nix";
optionalPath = path: lib.lists.optional (builtins.pathExists path) path;
in
2020-10-28 11:44:08 +00:00
{
imports =
[
<home-manager/nixos>
2020-10-28 11:44:08 +00:00
./hardware-configuration.nix
./local.nix
]
++ optionalPath host-config;
system.stateVersion = "20.03"; # Leave this alone (see configuration.nix(5))
2020-11-06 16:26:20 +00:00
nixpkgs.config.allowUnfree = true;
# Users ####################################################################
users.users.jez = {
isNormalUser = true;
group = "jez";
extraGroups = [ "wheel" "video" ];
shell = pkgs.zsh;
2020-10-30 19:32:32 +00:00
openssh.authorizedKeys.keyFiles = [ ./data/yubikey_ssh.pub ];
2020-10-28 11:44:08 +00:00
};
users.groups.jez = { };
2020-11-06 09:41:22 +00:00
users.users.elly.isNormalUser = true;
2020-10-28 11:44:08 +00:00
home-manager.users.jez = import ./home/jez/home.nix;
2020-11-03 21:40:56 +00:00
environment.shells = with pkgs; [ bashInteractive bash fish zsh ];
# Networking ###############################################################
networking = {
useDHCP = false;
networkmanager.enable = true;
2020-11-03 21:41:10 +00:00
firewall = {
enable = true;
allowedTCPPorts = [
22000 # SyncThing
];
allowedUDPPorts = [
21027 # SyncThing
];
};
};
2020-10-28 11:44:08 +00:00
services.avahi = {
enable = true;
nssmdns = true;
2020-11-02 13:27:34 +00:00
publish = { enable = true; addresses = true; };
};
2020-10-28 11:44:08 +00:00
services.openssh.enable = true;
2020-10-28 11:44:08 +00:00
# Security #################################################################
security.wrappers = {
ping = {
source = "${pkgs.iputils.out}/bin/ping";
owner = "nobody";
group = "nogroup";
capabilities = "cap_net_raw+ep";
};
};
2020-10-28 11:44:08 +00:00
# Localisation #############################################################
2020-10-28 11:44:08 +00:00
time.timeZone = "Europe/London";
i18n.defaultLocale = "en_GB.UTF-8";
console = {
font = "Lat2-Terminus16";
keyMap = "us";
};
2020-10-28 11:44:08 +00:00
# General ##################################################################
2020-10-28 11:44:08 +00:00
environment.systemPackages = with pkgs; [
wget vim git tree iputils
refind
2020-10-28 11:44:08 +00:00
];
documentation = {
man.generateCaches = true;
dev.enable = true;
};
# Desktop environment ####################################################
hardware.opengl.driSupport32Bit = true;
services.xserver = {
enable = true;
layout = "us";
libinput.enable = true;
2020-11-03 21:40:56 +00:00
displayManager.lightdm = {
enable = true;
greeters.enso.enable = true;
extraSeatDefaults = ''
greeter-hide-users = false
'';
};
desktopManager.gnome3.enable = true;
};
programs.sway = {
enable = true;
wrapperFeatures.gtk = true;
};
services.dbus.packages = [ pkgs.gnome3.dconf ];
services.printing.enable = true;
sound.enable = true;
hardware.pulseaudio.enable = true;
2020-11-06 09:41:04 +00:00
# Location #################################################################
location.provider = "geoclue2";
services.geoclue2.enable = true;
# Services #################################################################
2020-11-03 21:40:56 +00:00
services.accounts-daemon.enable = true;
services.pcscd = {
enable = true;
plugins = [ pkgs.ccid ]; # Needed for GPG + Yubikey
};
virtualisation.docker.enable = true;
virtualisation.libvirtd.enable = true;
users.groups.libvirtd.members = [ "jez" ];
# see https://github.com/xeji/nixpkgs/blob/1894a2ace97cc61cf833f712581d31cf2c650c35/pkgs/development/libraries/spice-gtk/default.nix#L39
security.wrappers.spice-client-glib-usb-acl-helper.source =
"${pkgs.spice_gtk}/bin/spice-client-glib-usb-acl-helper";
services.netdata.enable = true;
2020-10-28 11:44:08 +00:00
}