os/hosts/ryzensun/ryzensun.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

89 lines
2.9 KiB
Nix
Raw Permalink Normal View History

2022-11-20 22:14:21 +00:00
{
config,
pkgs,
lib,
flake,
2022-11-20 22:14:21 +00:00
...
}:
2024-06-12 23:59:25 +00:00
let
2021-06-22 00:47:43 +00:00
psCfg = config.pub-solar;
xdg = config.home-manager.users."${psCfg.user.name}".xdg;
2022-11-20 22:14:21 +00:00
in
{
2021-06-22 00:47:43 +00:00
config = {
age.secrets.docker-ci-runner-secrets = {
file = "${flake.self}/secrets/docker-ci-runner-secrets.age";
mode = "600";
owner = "999";
};
2021-10-24 23:43:19 +00:00
pub-solar.terminal-life.full = true;
#pub-solar.docker-ci-runner = {
# enable = false;
# runnerEnvironment = {
# DRONE_RUNNER_CAPACITY = "1";
# DRONE_RUNNER_LABELS = "hosttype:baremetal";
# };
# runnerVarsFile = config.age.secrets.docker-ci-runner-secrets.path;
#};
boot.kernelParams = [ "amd_pstate=active" ];
boot.binfmt.emulatedSystems = [ "aarch64-linux" ];
2024-06-12 23:59:25 +00:00
# Required for WakeOnLan
boot.initrd = {
availableKernelModules = [ "r8169" ];
network = {
enable = true;
udhcpc.enable = true;
flushBeforeStage2 = true;
2024-06-12 23:59:25 +00:00
ssh = {
enable = true;
# To prevent ssh clients from freaking out because a different host key is used,
# a different port for ssh is useful (assuming the same host has also a regular sshd running)
port = 2222;
# Please create this manually the first time.
# sudo ssh-keygen -t ed25519 -N "" -f /etc/secrets/initrd/ssh_host_ed25519_key
hostKeys = [ "/etc/secrets/initrd/ssh_host_ed25519_key" ];
authorizedKeys = psCfg.user.publicKeys;
};
postCommands = ''
# Automatically ask for the password on SSH login
echo 'cryptsetup-askpass || echo "Unlock was successful; exiting SSH session" && exit 1' >> /root/.profile
2024-06-12 23:59:25 +00:00
'';
};
};
2023-12-04 11:39:05 +00:00
services.fstrim.enable = true;
2023-11-12 19:55:12 +00:00
services.tailscale.enable = true;
2024-06-10 19:05:51 +00:00
services.openssh = {
enable = true;
openFirewall = true;
allowSFTP = true;
};
2023-11-12 19:55:12 +00:00
networking.hostName = "ryzensun";
2024-06-20 16:26:22 +00:00
hardware.keyboard.uhk.enable = true;
hardware.cpu.amd.updateMicrocode = true;
home-manager.users."${psCfg.user.name}".xdg.configFile = {
2021-10-24 22:30:11 +00:00
"sway/config.d/10-custom-keybindings.conf".source = ./.config/sway/config.d/custom-keybindings.conf;
2021-06-22 00:47:43 +00:00
"sway/config.d/autostart.conf".source = ./.config/sway/config.d/autostart.conf;
"sway/config.d/input-defaults.conf".source = ./.config/sway/config.d/input-defaults.conf;
"sway/config.d/screens.conf".source = ./.config/sway/config.d/screens.conf;
};
2022-07-08 12:13:41 +00:00
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. Its perfectly fine and recommended to leave
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "21.05"; # Did you read the comment?
2021-06-22 00:47:43 +00:00
};
}