infra/nix/os/profiles/common/system.nix

65 lines
1.8 KiB
Nix
Raw Normal View History

2023-03-21 13:38:22 +01:00
{
config,
pkgs,
lib,
nodeName,
2023-03-21 13:38:22 +01:00
...
2023-02-07 18:23:51 +01:00
}: {
networking.hostName = builtins.elemAt (builtins.split "\\." nodeName) 0; # Define your hostname.
networking.domain = builtins.elemAt (builtins.split "(^[^\\.]+\.)" nodeName) 2;
2021-12-04 12:30:36 +01:00
nix.daemonCPUSchedPolicy = "idle";
nix.daemonIOSchedClass = "idle";
nix.settings.max-jobs = lib.mkDefault "auto";
nix.settings.cores = lib.mkDefault 0;
nix.settings.sandbox = true;
nix.nixPath = ["nixpkgs=${pkgs.path}"];
environment.etc."lvm/lvm.conf".text = ''
devices {
issue_discards = 1
}
'';
# Fonts, I18N, Date ...
2023-03-21 13:38:22 +01:00
fonts.fonts = [pkgs.corefonts];
console.font = "lat9w-16";
2023-03-21 13:38:22 +01:00
i18n = {defaultLocale = "en_US.UTF-8";};
time.timeZone = "Etc/UTC";
services.gpm.enable = true;
services.packagekit.enable = true;
services.openssh.enable = true;
networking.firewall.enable = true;
# Activation scripts for impure set up of paths in /
system.activationScripts.bin = ''
echo "setting up /bin..."
mkdir -p /bin
ln -sfT ${pkgs.bash}/bin/bash /bin/.bash
mv -Tf /bin/.bash /bin/bash
'';
# TODO: find out if this workaround is still required from nixos 20.03 onwards
# system.activationScripts.etcX11sessinos = ''
# echo "setting up /etc/X11/sessions..."
# mkdir -p /etc/X11
# ln -sfT ${config.services.xserver.displayManager.session.desktops} /etc/X11/.sessions
# mv -Tf /etc/X11/.sessions /etc/X11/sessions
# '';
system.activationScripts.lib64 = ''
echo "setting up /lib64..."
mkdir -p /lib64
ln -sfT ${pkgs.glibc}/lib/ld-linux-x86-64.so.2 /lib64/.ld-linux-x86-64.so.2
mv -Tf /lib64/.ld-linux-x86-64.so.2 /lib64/ld-linux-x86-64.so.2
'';
programs.zsh.enable = true;
users.defaultUserShell = pkgs.zsh;
2023-03-21 13:38:22 +01:00
environment.pathsToLink = ["/share/zsh"];
2022-01-15 20:34:30 +01:00
programs.fuse.userAllowOther = true;
}