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’).
|
|
|
|
|
|
2021-06-08 16:03:20 +00:00
|
|
|
|
{ inputs, hostName, config, pkgs, lib, ... }:
|
2020-10-28 11:44:08 +00:00
|
|
|
|
|
2021-05-24 10:54:34 +00:00
|
|
|
|
{
|
2021-07-28 17:37:14 +00:00
|
|
|
|
imports = [ ./cachix.nix ];
|
2021-05-24 08:33:02 +00:00
|
|
|
|
|
2020-11-24 13:06:10 +00:00
|
|
|
|
# Nix ######################################################################
|
2020-10-29 18:53:36 +00:00
|
|
|
|
system.stateVersion = "20.03"; # Leave this alone (see configuration.nix(5))
|
|
|
|
|
|
2020-11-16 16:04:18 +00:00
|
|
|
|
nixpkgs.config = {
|
|
|
|
|
allowUnfree = true;
|
|
|
|
|
joypixels.acceptLicense = true;
|
2022-04-07 20:09:23 +00:00
|
|
|
|
permittedInsecurePackages = [ "electron-13.6.9" ];
|
2020-11-16 16:04:18 +00:00
|
|
|
|
};
|
2021-03-28 15:18:13 +00:00
|
|
|
|
nixpkgs.overlays = [
|
|
|
|
|
# (self: super: { libvirt = (import (builtins.fetchTarball "https://github.com/NixOS/nixpkgs/archive/066676b839a217f6b1b5d8ab05842604d33b7258.tar.gz") {}).libvirt; })
|
|
|
|
|
];
|
2020-11-06 16:26:20 +00:00
|
|
|
|
|
2020-11-24 13:06:10 +00:00
|
|
|
|
nix = {
|
2021-05-20 11:26:13 +00:00
|
|
|
|
package = pkgs.nixUnstable;
|
|
|
|
|
extraOptions = ''
|
|
|
|
|
experimental-features = nix-command flakes
|
|
|
|
|
'';
|
2022-02-04 20:19:56 +00:00
|
|
|
|
settings.auto-optimise-store = true;
|
2020-11-24 13:06:10 +00:00
|
|
|
|
gc = {
|
|
|
|
|
automatic = true;
|
2021-10-30 21:31:59 +00:00
|
|
|
|
dates = "Saturday";
|
2020-11-24 13:06:10 +00:00
|
|
|
|
options = "--delete-older-than 14d";
|
|
|
|
|
};
|
2021-05-28 08:09:05 +00:00
|
|
|
|
registry = {
|
2021-09-22 12:31:11 +00:00
|
|
|
|
nixpkgs.flake = inputs.nixpkgs;
|
2021-05-28 08:09:05 +00:00
|
|
|
|
nur.flake = inputs.nur;
|
|
|
|
|
};
|
2020-11-24 13:06:10 +00:00
|
|
|
|
};
|
|
|
|
|
|
2020-11-16 16:02:48 +00:00
|
|
|
|
# Kernel ###################################################################
|
|
|
|
|
boot = {
|
|
|
|
|
extraModulePackages = with config.boot.kernelPackages; [ v4l2loopback ];
|
|
|
|
|
kernelModules = [ "v4l2loopback" ];
|
2021-03-04 11:16:15 +00:00
|
|
|
|
kernel.sysctl = {
|
|
|
|
|
"net.core.rmem_max" = 2500000;
|
|
|
|
|
"vm.swappiness" = 10;
|
|
|
|
|
};
|
2023-06-25 11:06:06 +00:00
|
|
|
|
supportedFilesystems = [ "btrfs" "ntfs" ];
|
2020-11-16 16:02:48 +00:00
|
|
|
|
};
|
2021-08-06 11:09:52 +00:00
|
|
|
|
powerManagement.cpuFreqGovernor = "schedutil";
|
2020-11-16 16:02:48 +00:00
|
|
|
|
|
2020-10-29 18:53:36 +00:00
|
|
|
|
# Users ####################################################################
|
|
|
|
|
users.users.jez = {
|
|
|
|
|
isNormalUser = true;
|
2021-09-10 11:43:08 +00:00
|
|
|
|
description = "Jez Cope";
|
2020-10-30 20:53:50 +00:00
|
|
|
|
group = "jez";
|
2021-04-02 13:23:56 +00:00
|
|
|
|
extraGroups = [ "wheel" "video" "audio" "networkmanager" ];
|
2021-09-23 09:52:09 +00:00
|
|
|
|
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
|
|
|
|
};
|
2020-10-30 20:53:50 +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
|
|
|
|
|
2021-08-25 14:02:48 +00:00
|
|
|
|
environment.shells = with pkgs; [ bashInteractive bash xonsh fish zsh ];
|
2023-04-29 19:31:12 +00:00
|
|
|
|
programs.zsh.enable = true;
|
2020-11-03 21:40:56 +00:00
|
|
|
|
|
2020-10-29 18:53:36 +00:00
|
|
|
|
# Networking ###############################################################
|
|
|
|
|
networking = {
|
2021-06-08 16:03:20 +00:00
|
|
|
|
inherit hostName;
|
2020-10-29 18:53:36 +00:00
|
|
|
|
useDHCP = false;
|
|
|
|
|
networkmanager.enable = true;
|
2021-08-30 19:54:53 +00:00
|
|
|
|
networkmanager.unmanaged = [ "interface-name:ve-*" ];
|
2020-11-03 21:41:10 +00:00
|
|
|
|
firewall = {
|
|
|
|
|
enable = true;
|
|
|
|
|
allowedTCPPorts = [
|
|
|
|
|
22000 # SyncThing
|
|
|
|
|
];
|
|
|
|
|
allowedUDPPorts = [
|
|
|
|
|
21027 # SyncThing
|
|
|
|
|
];
|
|
|
|
|
};
|
2021-08-30 19:54:53 +00:00
|
|
|
|
nat = {
|
|
|
|
|
enable = true;
|
|
|
|
|
externalInterface = "wlp37s0";
|
2021-09-01 20:40:35 +00:00
|
|
|
|
internalInterfaces = [ "ve-+" ];
|
2021-08-30 19:54:53 +00:00
|
|
|
|
};
|
2020-10-29 18:53:36 +00:00
|
|
|
|
};
|
2020-10-28 11:44:08 +00:00
|
|
|
|
|
2020-10-29 18:53:36 +00:00
|
|
|
|
services.avahi = {
|
|
|
|
|
enable = true;
|
|
|
|
|
nssmdns = true;
|
2020-11-21 15:40:27 +00:00
|
|
|
|
publish = {
|
|
|
|
|
enable = true;
|
|
|
|
|
addresses = true;
|
|
|
|
|
};
|
2020-10-29 18:53:36 +00:00
|
|
|
|
};
|
2020-10-28 11:44:08 +00:00
|
|
|
|
|
2020-10-29 18:53:36 +00:00
|
|
|
|
services.openssh.enable = true;
|
2021-03-09 09:22:50 +00:00
|
|
|
|
programs.mosh.enable = true;
|
2020-12-18 16:30:30 +00:00
|
|
|
|
|
|
|
|
|
# Bluetooth ################################################################
|
2022-10-07 14:07:06 +00:00
|
|
|
|
hardware.bluetooth.enable = true;
|
2020-12-18 16:30:30 +00:00
|
|
|
|
services.blueman.enable = true;
|
2020-10-28 11:44:08 +00:00
|
|
|
|
|
2020-10-29 18:53:36 +00:00
|
|
|
|
# Localisation #############################################################
|
2020-10-28 11:44:08 +00:00
|
|
|
|
time.timeZone = "Europe/London";
|
2020-10-29 18:53:36 +00:00
|
|
|
|
i18n.defaultLocale = "en_GB.UTF-8";
|
|
|
|
|
console = {
|
2020-11-10 08:38:15 +00:00
|
|
|
|
font = "ter-124n";
|
|
|
|
|
packages = [ pkgs.terminus_font ];
|
2020-10-29 18:53:36 +00:00
|
|
|
|
keyMap = "us";
|
|
|
|
|
};
|
2020-10-28 11:44:08 +00:00
|
|
|
|
|
2020-10-29 18:53:36 +00:00
|
|
|
|
# General ##################################################################
|
2020-10-28 11:44:08 +00:00
|
|
|
|
environment.systemPackages = with pkgs; [
|
2021-04-11 19:59:43 +00:00
|
|
|
|
cachix
|
2021-09-22 12:50:09 +00:00
|
|
|
|
zsh
|
2021-09-25 13:50:37 +00:00
|
|
|
|
xonsh
|
2021-04-11 19:59:43 +00:00
|
|
|
|
|
2020-11-21 15:40:27 +00:00
|
|
|
|
wget
|
|
|
|
|
vim
|
|
|
|
|
git
|
2021-05-24 09:28:10 +00:00
|
|
|
|
git-crypt
|
2020-11-21 15:40:27 +00:00
|
|
|
|
tree
|
|
|
|
|
iputils
|
|
|
|
|
ripgrep
|
2022-05-31 15:47:21 +00:00
|
|
|
|
usbutils
|
2023-06-05 19:52:42 +00:00
|
|
|
|
hdparm
|
2023-06-25 11:06:06 +00:00
|
|
|
|
smartmontools
|
|
|
|
|
cryptsetup
|
|
|
|
|
thin-provisioning-tools
|
2021-08-25 14:03:01 +00:00
|
|
|
|
|
2020-11-21 15:40:27 +00:00
|
|
|
|
refind
|
|
|
|
|
terminus_font
|
2021-10-20 17:56:05 +00:00
|
|
|
|
|
|
|
|
|
man-pages
|
2020-10-28 11:44:08 +00:00
|
|
|
|
];
|
|
|
|
|
|
2020-10-29 18:53:36 +00:00
|
|
|
|
documentation = {
|
|
|
|
|
man.generateCaches = true;
|
|
|
|
|
dev.enable = true;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
# Desktop environment ####################################################
|
|
|
|
|
hardware.opengl.driSupport32Bit = true;
|
|
|
|
|
|
|
|
|
|
services.xserver = {
|
|
|
|
|
enable = true;
|
|
|
|
|
layout = "us";
|
|
|
|
|
libinput.enable = true;
|
2021-11-18 17:15:08 +00:00
|
|
|
|
displayManager.gdm.enable = true;
|
2023-05-29 19:28:40 +00:00
|
|
|
|
displayManager.importedVariables =
|
|
|
|
|
[ "XDG_SESSION_TYPE" "XDG_CURRENT_DESKTOP" "XDG_SESSION_DESKTOP" ];
|
2021-10-20 17:56:30 +00:00
|
|
|
|
desktopManager.mate.enable = true;
|
2021-11-18 17:15:08 +00:00
|
|
|
|
desktopManager.gnome.enable = true;
|
|
|
|
|
desktopManager.gnome.flashback.enableMetacity = true;
|
2023-02-01 16:13:54 +00:00
|
|
|
|
windowManager.i3.enable = true;
|
2020-10-29 18:53:36 +00:00
|
|
|
|
};
|
|
|
|
|
programs.sway = {
|
|
|
|
|
enable = true;
|
|
|
|
|
wrapperFeatures.gtk = true;
|
|
|
|
|
};
|
2023-05-29 19:28:40 +00:00
|
|
|
|
programs.dconf.enable = true;
|
2020-10-29 18:53:36 +00:00
|
|
|
|
|
2021-02-08 17:04:36 +00:00
|
|
|
|
xdg.portal = {
|
|
|
|
|
enable = true;
|
2023-05-29 19:28:40 +00:00
|
|
|
|
wlr.enable = true;
|
2023-06-30 20:12:24 +00:00
|
|
|
|
xdgOpenUsePortal = false;
|
2021-02-08 17:04:36 +00:00
|
|
|
|
};
|
|
|
|
|
|
2020-10-29 18:53:36 +00:00
|
|
|
|
services.printing.enable = true;
|
|
|
|
|
|
2021-03-04 11:46:56 +00:00
|
|
|
|
services.flatpak.enable = true;
|
|
|
|
|
|
2021-02-08 17:04:15 +00:00
|
|
|
|
# Sound ####################################################################
|
2020-10-29 18:53:36 +00:00
|
|
|
|
sound.enable = true;
|
2021-02-08 17:04:15 +00:00
|
|
|
|
hardware.pulseaudio.enable = false;
|
|
|
|
|
services.pipewire = {
|
|
|
|
|
enable = true;
|
|
|
|
|
alsa.enable = true;
|
|
|
|
|
pulse.enable = true;
|
2021-06-24 19:23:27 +00:00
|
|
|
|
jack.enable = true;
|
2021-02-08 17:04:15 +00:00
|
|
|
|
};
|
2021-03-10 17:27:28 +00:00
|
|
|
|
security.rtkit.enable = true;
|
2020-10-29 18:53:36 +00:00
|
|
|
|
|
2020-11-06 09:41:04 +00:00
|
|
|
|
# Location #################################################################
|
2021-05-07 19:44:03 +00:00
|
|
|
|
location = {
|
|
|
|
|
provider = "manual";
|
|
|
|
|
# Somewhere roughly in the North of England
|
|
|
|
|
latitude = 54.0;
|
|
|
|
|
longitude = 1.0;
|
|
|
|
|
};
|
2020-11-06 09:41:04 +00:00
|
|
|
|
|
2020-10-29 18:53:36 +00:00
|
|
|
|
# Services #################################################################
|
2020-11-03 21:40:56 +00:00
|
|
|
|
services.accounts-daemon.enable = true;
|
|
|
|
|
|
2020-10-29 18:53:36 +00:00
|
|
|
|
services.pcscd = {
|
|
|
|
|
enable = true;
|
|
|
|
|
plugins = [ pkgs.ccid ]; # Needed for GPG + Yubikey
|
|
|
|
|
};
|
|
|
|
|
|
2023-06-30 20:12:47 +00:00
|
|
|
|
virtualisation = {
|
|
|
|
|
docker = {
|
|
|
|
|
enable = true;
|
|
|
|
|
autoPrune.enable = true;
|
|
|
|
|
};
|
|
|
|
|
libvirtd.enable = true;
|
|
|
|
|
waydroid.enable = true;
|
|
|
|
|
|
|
|
|
|
spiceUSBRedirection.enable = true;
|
2022-07-25 20:57:24 +00:00
|
|
|
|
};
|
2020-10-29 18:53:36 +00:00
|
|
|
|
users.groups.libvirtd.members = [ "jez" ];
|
|
|
|
|
|
2023-06-25 11:06:06 +00:00
|
|
|
|
services.smartd.enable = true;
|
2020-10-28 11:44:08 +00:00
|
|
|
|
|
2021-02-24 20:43:01 +00:00
|
|
|
|
# Hardware #################################################################
|
2023-06-25 11:07:15 +00:00
|
|
|
|
hardware.logitech.wireless.enable = true;
|
|
|
|
|
|
2023-07-08 19:54:38 +00:00
|
|
|
|
hardware.keyboard = {
|
|
|
|
|
qmk.enable = true;
|
|
|
|
|
zsa.enable = true;
|
|
|
|
|
};
|
2021-02-24 20:43:01 +00:00
|
|
|
|
|
2020-10-28 11:44:08 +00:00
|
|
|
|
}
|