2020-01-04 23:32:41 +01:00
|
|
|
# This file contains the configuration for my home desktop.
|
|
|
|
|
|
|
|
{ pkgs, ... }:
|
|
|
|
|
|
|
|
config: let
|
|
|
|
inherit (pkgs) lib;
|
|
|
|
|
|
|
|
nixpkgs = import pkgs.third_party.nixpkgsSrc {
|
|
|
|
config.allowUnfree = true;
|
|
|
|
};
|
2020-01-05 17:40:24 +01:00
|
|
|
|
|
|
|
lieer = (pkgs.third_party.lieer {});
|
2020-01-04 23:32:41 +01:00
|
|
|
in pkgs.lib.fix(self: {
|
|
|
|
hardware = {
|
|
|
|
pulseaudio.enable = true;
|
|
|
|
cpu.intel.updateMicrocode = true;
|
2020-02-05 00:41:33 +01:00
|
|
|
u2f.enable = true;
|
2020-01-04 23:32:41 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
boot = {
|
|
|
|
cleanTmpDir = true;
|
|
|
|
kernelModules = [ "kvm-intel" ];
|
|
|
|
|
|
|
|
loader = {
|
|
|
|
timeout = 3;
|
|
|
|
systemd-boot.enable = true;
|
|
|
|
efi.canTouchEfiVariables = false;
|
|
|
|
};
|
|
|
|
|
|
|
|
initrd = {
|
|
|
|
luks.devices.nugget-crypt.device = "/dev/disk/by-label/nugget-crypt";
|
|
|
|
availableKernelModules = [ "xhci_pci" "ehci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" ];
|
|
|
|
kernelModules = [ "dm-snapshot" ];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
nix = {
|
|
|
|
nixPath = [
|
|
|
|
"depot=/home/tazjin/depot"
|
|
|
|
"nixpkgs=${pkgs.third_party.nixpkgsSrc}"
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
|
|
|
nixpkgs.pkgs = nixpkgs;
|
|
|
|
|
|
|
|
networking = {
|
|
|
|
hostName = "nugget";
|
|
|
|
useDHCP = false;
|
|
|
|
interfaces.eno1.useDHCP = true;
|
|
|
|
interfaces.wlp7s0.useDHCP = true;
|
|
|
|
|
|
|
|
# Don't use ISP's DNS servers:
|
|
|
|
nameservers = [
|
|
|
|
"8.8.8.8"
|
|
|
|
"8.8.4.4"
|
|
|
|
];
|
|
|
|
|
|
|
|
# Open Chromecast-related ports & servedir
|
2020-01-19 02:44:40 +01:00
|
|
|
firewall.enable = false;
|
2020-01-04 23:32:41 +01:00
|
|
|
firewall.allowedTCPPorts = [ 4242 5556 5558 ];
|
2020-01-19 02:44:40 +01:00
|
|
|
|
|
|
|
# Connect to the WiFi to let the Chromecast work.
|
|
|
|
wireless.enable = true;
|
|
|
|
wireless.networks = {
|
|
|
|
"How do I computer?" = {
|
|
|
|
psk = "washyourface";
|
|
|
|
};
|
|
|
|
};
|
2020-01-04 23:32:41 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
# 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}") self.networking.nameservers)}
|
|
|
|
options edns0
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
time.timeZone = "Europe/London";
|
|
|
|
|
|
|
|
environment.systemPackages =
|
|
|
|
# programs from the depot
|
|
|
|
(with pkgs; [
|
2020-01-05 17:40:24 +01:00
|
|
|
lieer
|
2020-01-04 23:32:41 +01:00
|
|
|
ops.kontemplate
|
|
|
|
third_party.git
|
2020-01-19 20:34:39 +01:00
|
|
|
third_party.guile
|
2020-01-04 23:32:41 +01:00
|
|
|
tools.emacs
|
|
|
|
]) ++
|
|
|
|
|
|
|
|
# programs from nixpkgs
|
|
|
|
(with nixpkgs; [
|
|
|
|
age
|
|
|
|
bat
|
2020-01-18 12:29:18 +01:00
|
|
|
cachix
|
2020-01-04 23:32:41 +01:00
|
|
|
chromium
|
|
|
|
curl
|
|
|
|
direnv
|
|
|
|
dnsutils
|
|
|
|
exa
|
|
|
|
fd
|
|
|
|
gnupg
|
|
|
|
go
|
2020-01-19 02:44:40 +01:00
|
|
|
google-chrome
|
2020-01-05 02:32:15 +01:00
|
|
|
google-cloud-sdk
|
2020-01-04 23:32:41 +01:00
|
|
|
htop
|
2020-01-05 02:32:15 +01:00
|
|
|
imagemagick
|
2020-01-04 23:32:41 +01:00
|
|
|
jq
|
2020-01-20 23:31:03 +01:00
|
|
|
keybase-gui
|
2020-01-05 02:32:15 +01:00
|
|
|
kubectl
|
2020-01-19 19:56:44 +01:00
|
|
|
miller
|
2020-01-05 17:40:24 +01:00
|
|
|
msmtp
|
2020-01-07 23:26:01 +01:00
|
|
|
nix-prefetch-github
|
2020-01-04 23:32:41 +01:00
|
|
|
notmuch
|
|
|
|
openssh
|
|
|
|
openssl
|
|
|
|
pass
|
|
|
|
pavucontrol
|
|
|
|
pinentry
|
|
|
|
pinentry-emacs
|
|
|
|
pwgen
|
|
|
|
ripgrep
|
|
|
|
rustup
|
2020-01-07 23:26:01 +01:00
|
|
|
sbcl
|
2020-01-05 02:32:15 +01:00
|
|
|
scrot
|
2020-01-04 23:32:41 +01:00
|
|
|
spotify
|
|
|
|
tokei
|
|
|
|
tree
|
2020-01-25 21:39:54 +01:00
|
|
|
unzip
|
2020-01-04 23:32:41 +01:00
|
|
|
vlc
|
|
|
|
xclip
|
|
|
|
]);
|
|
|
|
|
|
|
|
fileSystems = {
|
|
|
|
"/".device = "/dev/disk/by-label/nugget-root";
|
|
|
|
"/boot".device = "/dev/disk/by-label/EFI";
|
|
|
|
"/home".device = "/dev/disk/by-label/nugget-home";
|
|
|
|
};
|
|
|
|
|
|
|
|
# Configure user account
|
|
|
|
users.extraUsers.tazjin = {
|
|
|
|
extraGroups = [ "wheel" "audio" ];
|
|
|
|
isNormalUser = true;
|
|
|
|
uid = 1000;
|
|
|
|
shell = nixpkgs.fish;
|
|
|
|
};
|
|
|
|
|
|
|
|
security.sudo = {
|
|
|
|
enable = true;
|
|
|
|
extraConfig = "wheel ALL=(ALL:ALL) SETENV: ALL";
|
|
|
|
};
|
|
|
|
|
|
|
|
fonts = {
|
|
|
|
fonts = with nixpkgs; [
|
|
|
|
corefonts
|
2020-01-19 17:38:32 +01:00
|
|
|
dejavu_fonts
|
2020-01-04 23:32:41 +01:00
|
|
|
input-fonts
|
2020-01-19 17:38:32 +01:00
|
|
|
jetbrains-mono
|
2020-01-04 23:32:41 +01:00
|
|
|
noto-fonts-cjk
|
|
|
|
noto-fonts-emoji
|
|
|
|
];
|
2020-01-19 17:38:32 +01:00
|
|
|
|
|
|
|
fontconfig = {
|
|
|
|
hinting.enable = true;
|
|
|
|
subpixel.lcdfilter = "light";
|
|
|
|
|
|
|
|
defaultFonts = {
|
|
|
|
monospace = [ "JetBrains Mono" ];
|
|
|
|
};
|
|
|
|
};
|
2020-01-04 23:32:41 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
# Configure location (Vauxhall, London) for services that need it.
|
|
|
|
location = {
|
|
|
|
latitude = 51.4819109;
|
|
|
|
longitude = -0.1252998;
|
|
|
|
};
|
|
|
|
|
|
|
|
programs.fish.enable = true;
|
|
|
|
|
|
|
|
services.redshift.enable = true;
|
|
|
|
services.openssh.enable = true;
|
2020-01-20 23:31:03 +01:00
|
|
|
services.keybase.enable = true;
|
2020-01-04 23:32:41 +01:00
|
|
|
|
|
|
|
services.xserver = {
|
|
|
|
enable = true;
|
|
|
|
layout = "us";
|
|
|
|
xkbOptions = "caps:super";
|
|
|
|
exportConfiguration = true;
|
|
|
|
videoDrivers = [ "nvidia" ];
|
|
|
|
|
|
|
|
displayManager = {
|
|
|
|
# Give EXWM permission to control the session.
|
|
|
|
sessionCommands = "${nixpkgs.xorg.xhost}/bin/xhost +SI:localuser:$USER";
|
|
|
|
|
|
|
|
lightdm.enable = true;
|
|
|
|
lightdm.greeters.gtk.clock-format = "%H·%M";
|
|
|
|
};
|
|
|
|
|
|
|
|
windowManager.session = pkgs.lib.singleton {
|
|
|
|
name = "exwm";
|
|
|
|
start = "${pkgs.tools.emacs}/bin/tazjins-emacs";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
# Do not restart the display manager automatically
|
|
|
|
systemd.services.display-manager.restartIfChanged = lib.mkForce false;
|
|
|
|
|
2020-01-05 17:40:24 +01:00
|
|
|
# Configure email setup
|
|
|
|
systemd.user.services.lieer-tazjin = {
|
|
|
|
description = "Synchronise mail@tazj.in via lieer";
|
|
|
|
script = "${lieer}/bin/gmi sync";
|
|
|
|
|
|
|
|
serviceConfig = {
|
|
|
|
WorkingDirectory = "%h/mail/account.tazjin";
|
|
|
|
Type = "oneshot";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
systemd.user.timers.lieer-tazjin = {
|
|
|
|
wantedBy = [ "timers.target" ];
|
|
|
|
|
|
|
|
timerConfig = {
|
|
|
|
OnActiveSec = "1";
|
|
|
|
OnUnitActiveSec = "180";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2020-01-04 23:32:41 +01:00
|
|
|
# ... and other nonsense.
|
|
|
|
system.stateVersion = "19.09";
|
|
|
|
})
|