2020-05-08 22:26:21 +00:00
|
|
|
{ pkgs, depot, lib, rebuilder, ... }:
|
|
|
|
let
|
2020-05-09 13:42:19 +00:00
|
|
|
inherit (lib) mkDefault;
|
2020-05-08 22:26:21 +00:00
|
|
|
in
|
|
|
|
{
|
|
|
|
hardware.enableRedistributableFirmware = true;
|
|
|
|
|
2020-05-08 23:03:21 +00:00
|
|
|
nix = {
|
|
|
|
nixPath = [ "depot=/home/lukegb/depot/" "nixpkgs=/home/lukegb/depot/third_party/nixpkgs/" ];
|
|
|
|
trustedUsers = [ "root" "@wheel" ];
|
2020-05-22 12:04:17 +00:00
|
|
|
binaryCaches = lib.mkForce [ "https://cache.nixos.org/" ];
|
2020-05-09 00:10:37 +00:00
|
|
|
trustedBinaryCaches = lib.mkForce [ "https://cache.nixos.org/" "s3://lukegb-nix-cache?endpoint=storage.googleapis.com&trusted=1" ];
|
2020-05-08 23:03:21 +00:00
|
|
|
};
|
2020-05-31 17:58:29 +00:00
|
|
|
nixpkgs.config = depot.third_party.nixpkgsConfig;
|
2020-05-08 22:26:21 +00:00
|
|
|
|
|
|
|
i18n.defaultLocale = "en_GB.UTF-8";
|
|
|
|
console.keyMap = "us";
|
|
|
|
|
|
|
|
time.timeZone = mkDefault "Etc/UTC";
|
|
|
|
|
|
|
|
environment.systemPackages = with pkgs; [
|
2020-05-09 17:15:12 +00:00
|
|
|
vim rxvt_unicode.terminfo rebuilder
|
|
|
|
(mercurial.overridePythonAttrs (origAttrs: {
|
2020-05-17 02:23:54 +00:00
|
|
|
propagatedBuildInputs = origAttrs.propagatedBuildInputs ++ [python3Packages.hg-evolve depot.nix.pkgs.hg-git];
|
2020-05-09 17:15:12 +00:00
|
|
|
}))
|
2020-05-08 22:26:21 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
networking.firewall = {
|
|
|
|
allowPing = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
users.mutableUsers = false;
|
|
|
|
users.users = let secrets = depot.ops.secrets; in {
|
|
|
|
root.hashedPassword = secrets.passwordHashes.root;
|
|
|
|
lukegb = {
|
|
|
|
isNormalUser = true;
|
|
|
|
uid = 1000;
|
|
|
|
extraGroups = [ "wheel" ];
|
|
|
|
hashedPassword = secrets.passwordHashes.lukegb;
|
|
|
|
};
|
2020-05-09 00:10:20 +00:00
|
|
|
deployer = {
|
|
|
|
isSystemUser = true;
|
|
|
|
uid = 1001;
|
|
|
|
hashedPassword = "NP";
|
2020-05-09 22:49:32 +00:00
|
|
|
useDefaultShell = true;
|
|
|
|
home = "/var/lib/deployer";
|
|
|
|
createHome = true;
|
2020-05-09 00:10:20 +00:00
|
|
|
openssh.authorizedKeys.keyFiles = [
|
|
|
|
../../secrets/deployer_ed25519.pub
|
|
|
|
];
|
|
|
|
};
|
2020-05-08 22:26:21 +00:00
|
|
|
};
|
2020-05-09 00:10:20 +00:00
|
|
|
security.sudo.extraRules = [{
|
|
|
|
users = [ "deployer" ];
|
|
|
|
commands = [{
|
|
|
|
command = "${rebuilder}/bin/rebuilder";
|
|
|
|
options = [ "NOPASSWD" ];
|
|
|
|
}];
|
|
|
|
}];
|
|
|
|
security.sudo.extraConfig = ''
|
|
|
|
Defaults:deployer !requiretty
|
|
|
|
'';
|
2020-05-08 22:26:21 +00:00
|
|
|
|
|
|
|
programs.mtr.enable = true;
|
|
|
|
services.openssh.enable = true;
|
|
|
|
|
|
|
|
boot = {
|
|
|
|
kernelModules = [ "tcp_bbr" ];
|
|
|
|
kernel.sysctl."net.ipv4.tcp_congestion_control" = "bbr";
|
|
|
|
kernel.sysctl."net.core.default_qdisc" = "fq_codel";
|
|
|
|
};
|
2020-05-11 16:30:13 +00:00
|
|
|
|
|
|
|
system.activationScripts.lukegb-hgrc = lib.stringAfter [ "users" "groups" ] ''
|
|
|
|
ln -sfn ${./hgrc} /home/lukegb/.hgrc
|
|
|
|
'';
|
2020-05-08 22:26:21 +00:00
|
|
|
}
|