stockholm/tv/2configs/default.nix

141 lines
3.4 KiB
Nix
Raw Normal View History

2022-12-09 01:31:56 +01:00
with import ./lib;
{ config, pkgs, ... }: {
2017-08-01 22:32:14 +02:00
boot.tmpOnTmpfs = true;
krebs.enable = true;
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);
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
./bash
2017-03-07 22:40:36 +01:00
./htop.nix
2020-08-19 02:30:51 +02:00
./nets/hkw.nix
./networkd.nix
2016-03-05 12:57:46 +01:00
./nginx
2023-01-04 16:17:42 +01:00
./nix.nix
./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;
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 = ''
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-02 20:12:06 +01:00
{
nixpkgs.config.allowUnfree = false;
}
{
2023-01-11 20:03:07 +01:00
environment.homeBinInPath = true;
environment.profileRelativeEnvVars.PATH = mkForce [ "/bin" ];
environment.systemPackages = with pkgs; [
rxvt_unicode.terminfo
];
2015-07-16 06:26:41 +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
#
# 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
}
{
services.journald.extraConfig = ''
SystemMaxUse=1G
RuntimeMaxUse=128M
'';
}
{
environment.systemPackages = [
2019-08-05 14:09:03 +02:00
pkgs.field
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
pkgs.nix-prefetch-scripts
2017-06-27 10:01:16 +02:00
pkgs.ovh-zone
pkgs.push
];
}
2015-07-11 16:55:22 +02: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
}