2022-12-09 01:31:56 +01:00
|
|
|
with import ./lib;
|
2017-08-01 22:34:14 +02:00
|
|
|
{ config, pkgs, ... }: {
|
2017-08-01 22:32:14 +02:00
|
|
|
boot.tmpOnTmpfs = true;
|
|
|
|
|
2015-07-24 21:27:19 +02:00
|
|
|
krebs.enable = true;
|
|
|
|
|
2017-07-06 21:47:47 +02:00
|
|
|
krebs.build.user = config.krebs.users.tv;
|
2015-11-06 22:36:01 +01:00
|
|
|
|
2023-02-02 16:50:29 +01:00
|
|
|
networking.hostId = mkDefault (hashToLength 8 config.networking.hostName);
|
2015-07-25 01:38:26 +02:00
|
|
|
networking.hostName = config.krebs.build.host.name;
|
|
|
|
|
2015-07-11 16:55:22 +02:00
|
|
|
imports = [
|
2015-11-08 11:53:29 +01:00
|
|
|
<secrets>
|
2015-12-28 19:43:31 +01:00
|
|
|
./backup.nix
|
2017-06-04 15:06:22 +02:00
|
|
|
./bash
|
2017-03-07 22:40:36 +01:00
|
|
|
./htop.nix
|
2020-08-19 02:30:51 +02:00
|
|
|
./nets/hkw.nix
|
2022-06-21 21:25:33 +02:00
|
|
|
./networkd.nix
|
2016-03-05 12:57:46 +01:00
|
|
|
./nginx
|
2023-01-04 16:17:42 +01:00
|
|
|
./nix.nix
|
2019-04-20 18:54:58 +02:00
|
|
|
./pki
|
2016-07-23 12:18:46 +02:00
|
|
|
./ssh.nix
|
2016-07-23 13:11:50 +02:00
|
|
|
./sshd.nix
|
2015-11-01 13:28:16 +01:00
|
|
|
./vim.nix
|
2016-07-23 13:19:44 +02:00
|
|
|
./xdg.nix
|
2015-07-11 16:55:22 +02:00
|
|
|
{
|
2015-11-08 11:53:29 +01:00
|
|
|
users = {
|
|
|
|
defaultUserShell = "/run/current-system/sw/bin/bash";
|
|
|
|
mutableUsers = false;
|
|
|
|
users = {
|
|
|
|
tv = {
|
2016-02-21 06:56:57 +01:00
|
|
|
inherit (config.krebs.users.tv) home uid;
|
2015-11-08 11:53:29 +01:00
|
|
|
isNormalUser = true;
|
2016-02-13 19:57:45 +01:00
|
|
|
extraGroups = [ "tv" ];
|
2015-11-08 11:53:29 +01:00
|
|
|
};
|
2015-07-11 16:55:22 +02:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|
|
|
|
{
|
2020-07-14 22:04:02 +02:00
|
|
|
i18n.defaultLocale = mkDefault "C.UTF-8";
|
2015-07-11 16:55:22 +02:00
|
|
|
security.sudo.extraConfig = ''
|
2022-12-09 04:42:09 +01:00
|
|
|
Defaults env_keep+="SSH_CLIENT _CURRENT_DESKTOP_NAME"
|
2015-07-25 01:06:13 +02:00
|
|
|
Defaults mailto="${config.krebs.users.tv.mail}"
|
2016-02-17 22:28:02 +01:00
|
|
|
Defaults !lecture
|
2015-07-11 16:55:22 +02:00
|
|
|
'';
|
|
|
|
time.timeZone = "Europe/Berlin";
|
|
|
|
}
|
2016-02-27 15:13:44 +01:00
|
|
|
|
2016-02-02 20:12:06 +01:00
|
|
|
{
|
|
|
|
nixpkgs.config.allowUnfree = false;
|
|
|
|
}
|
2015-07-16 06:35:19 +02:00
|
|
|
{
|
2023-01-11 20:03:07 +01:00
|
|
|
environment.homeBinInPath = true;
|
|
|
|
|
2015-11-06 21:54:53 +01:00
|
|
|
environment.profileRelativeEnvVars.PATH = mkForce [ "/bin" ];
|
|
|
|
|
2015-07-16 06:35:19 +02:00
|
|
|
environment.systemPackages = with pkgs; [
|
|
|
|
rxvt_unicode.terminfo
|
|
|
|
];
|
2015-07-16 06:26:41 +02:00
|
|
|
|
2015-07-29 15:31:34 +02:00
|
|
|
environment.shellAliases = mkForce {
|
2015-07-11 16:55:22 +02:00
|
|
|
gp = "${pkgs.pari}/bin/gp -q";
|
|
|
|
df = "df -h";
|
|
|
|
du = "du -h";
|
|
|
|
|
|
|
|
# TODO alias cannot contain #\'
|
|
|
|
# "ps?" = "ps ax | head -n 1;ps ax | fgrep -v ' grep --color=auto ' | grep";
|
|
|
|
|
|
|
|
ls = "ls -h --color=auto --group-directories-first";
|
|
|
|
dmesg = "dmesg -L --reltime";
|
2015-11-01 13:28:16 +01:00
|
|
|
view = "vim -R";
|
2015-07-11 16:55:22 +02:00
|
|
|
};
|
|
|
|
|
2015-11-08 12:28:53 +01:00
|
|
|
environment.variables = {
|
2017-09-06 00:45:55 +02:00
|
|
|
NIX_PATH = mkForce (concatStringsSep ":" [
|
|
|
|
"secrets=/var/src/stockholm/null"
|
|
|
|
"/var/src"
|
|
|
|
]);
|
2015-11-08 12:28:53 +01:00
|
|
|
};
|
2015-07-11 16:55:22 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
services.cron.enable = false;
|
|
|
|
services.ntp.enable = false;
|
2016-07-03 21:35:34 +02:00
|
|
|
services.timesyncd.enable = true;
|
2015-07-11 16:55:22 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
boot.kernel.sysctl = {
|
|
|
|
# Enable IPv6 Privacy Extensions
|
2021-12-07 21:57:45 +01:00
|
|
|
#
|
|
|
|
# XXX use mkForce here because since NixOS 21.11 there's a collision in
|
|
|
|
# net.ipv6.conf.default.use_tempaddr, and boot.kernel.sysctl incapable
|
|
|
|
# of merging.
|
|
|
|
#
|
|
|
|
# XXX net.ipv6.conf.all.use_tempaddr is set because it was mentioned in
|
|
|
|
# https://tldp.org/HOWTO/Linux+IPv6-HOWTO/ch06s05.html
|
|
|
|
# TODO check if that is really necessary, otherwise we can rely solely
|
|
|
|
# on networking.tempAddresses in the future (when nothing is <21.11)
|
|
|
|
"net.ipv6.conf.all.use_tempaddr" = mkForce 2;
|
|
|
|
"net.ipv6.conf.default.use_tempaddr" = mkForce 2;
|
2015-07-11 16:55:22 +02:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2016-02-01 17:40:25 +01:00
|
|
|
{
|
|
|
|
tv.iptables.enable = true;
|
2016-02-07 03:09:14 +01:00
|
|
|
tv.iptables.accept-echo-request = "internet";
|
2016-02-01 17:40:25 +01:00
|
|
|
}
|
|
|
|
|
2016-07-03 21:30:46 +02:00
|
|
|
{
|
|
|
|
services.journald.extraConfig = ''
|
|
|
|
SystemMaxUse=1G
|
|
|
|
RuntimeMaxUse=128M
|
|
|
|
'';
|
|
|
|
}
|
|
|
|
|
2016-02-13 17:58:02 +01:00
|
|
|
{
|
|
|
|
environment.systemPackages = [
|
2019-08-05 14:09:03 +02:00
|
|
|
pkgs.field
|
2016-02-13 17:58:02 +01:00
|
|
|
pkgs.get
|
2017-08-01 11:30:16 +02:00
|
|
|
pkgs.git
|
2018-10-07 16:37:06 +02:00
|
|
|
pkgs.git-crypt
|
2017-11-02 21:14:21 +01:00
|
|
|
pkgs.git-preview
|
2017-08-01 11:30:16 +02:00
|
|
|
pkgs.hashPassword
|
2017-06-27 10:01:16 +02:00
|
|
|
pkgs.htop
|
2017-07-12 23:55:42 +02:00
|
|
|
pkgs.kpaste
|
2016-02-13 17:58:02 +01:00
|
|
|
pkgs.nix-prefetch-scripts
|
2017-06-27 10:01:16 +02:00
|
|
|
pkgs.ovh-zone
|
2016-02-13 17:58:02 +01:00
|
|
|
pkgs.push
|
|
|
|
];
|
|
|
|
}
|
2015-07-11 16:55:22 +02:00
|
|
|
];
|
2023-01-11 20:08:56 +01:00
|
|
|
|
|
|
|
nixpkgs.overlays =
|
|
|
|
mkAfter (optional config.hardware.video.hidpi.enable (self: super: {
|
|
|
|
alacritty-tv = super.alacritty-tv.override {
|
|
|
|
variant = "hidpi";
|
|
|
|
};
|
|
|
|
}));
|
2015-07-11 16:55:22 +02:00
|
|
|
}
|