2023-10-16 20:42:10 +02:00
|
|
|
{ inputs, outputs, lib, pkgs, config, ... }:
|
|
|
|
{
|
|
|
|
imports = [
|
2023-11-17 15:03:25 +01:00
|
|
|
inputs.hardware.nixosModules.common-cpu-amd
|
|
|
|
inputs.hardware.nixosModules.common-gpu-amd
|
2023-12-25 14:17:30 +01:00
|
|
|
./disko.nix
|
2023-12-26 00:14:25 +01:00
|
|
|
inputs.ragenix.nixosModules.default
|
2023-12-25 14:17:30 +01:00
|
|
|
inputs.agenix-rekey.nixosModules.default
|
2023-10-16 20:42:10 +02:00
|
|
|
./network.nix
|
2023-10-23 07:47:06 +02:00
|
|
|
./wireguard.nix
|
2023-11-17 15:03:25 +01:00
|
|
|
./jellyfin.nix
|
2023-12-07 20:18:20 +01:00
|
|
|
./mindustry.nix
|
2024-04-13 12:37:24 +02:00
|
|
|
./home-assistant
|
2024-01-22 18:22:50 +01:00
|
|
|
./samba.nix
|
2024-06-09 23:18:11 +02:00
|
|
|
./ollama.nix
|
2023-10-16 20:42:10 +02:00
|
|
|
];
|
|
|
|
|
2023-12-25 14:17:30 +01:00
|
|
|
age.rekey = {
|
|
|
|
hostPubkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPopSTZ81UyKp9JSljCLp+Syk51zacjh9fLteqxQ6/aB";
|
|
|
|
masterIdentities = [ "${inputs.self}/secrets/privkey.age" ];
|
2024-04-13 12:37:24 +02:00
|
|
|
storageMode = "derivation";
|
|
|
|
# forceRekeyOnSystem = "aarch64-linux";
|
2023-12-25 14:17:30 +01:00
|
|
|
};
|
|
|
|
|
2023-10-16 20:42:10 +02:00
|
|
|
nixpkgs = {
|
|
|
|
hostPlatform = "x86_64-linux";
|
|
|
|
config = {
|
|
|
|
allowUnfree = true;
|
|
|
|
};
|
|
|
|
overlays = [
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
|
|
|
networking.hostName = "jeeves";
|
|
|
|
|
|
|
|
boot = {
|
|
|
|
loader.systemd-boot.enable = true;
|
|
|
|
kernelPackages = pkgs.linuxPackages_latest;
|
2024-04-13 12:37:24 +02:00
|
|
|
binfmt.emulatedSystems = [ "aarch64-linux" ];
|
|
|
|
initrd = {
|
|
|
|
availableKernelModules = [
|
|
|
|
"nvme"
|
|
|
|
];
|
|
|
|
# kernelModules = [
|
|
|
|
# "amdgpu"
|
|
|
|
# ];
|
|
|
|
};
|
2023-10-16 20:42:10 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
hardware.enableRedistributableFirmware = true;
|
|
|
|
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
|
|
|
|
|
|
|
nix = {
|
|
|
|
registry =
|
|
|
|
lib.mapAttrs
|
|
|
|
(_: value: {
|
|
|
|
flake = value;
|
|
|
|
})
|
|
|
|
inputs;
|
|
|
|
|
|
|
|
nixPath =
|
|
|
|
lib.mapAttrsToList
|
|
|
|
(key: value:
|
|
|
|
"${key}=${value.to.path}")
|
|
|
|
config.nix.registry;
|
|
|
|
|
|
|
|
settings = {
|
2023-12-25 20:13:48 +01:00
|
|
|
trusted-users = [
|
|
|
|
"root"
|
|
|
|
"jeeves"
|
|
|
|
];
|
|
|
|
|
2023-10-16 20:42:10 +02:00
|
|
|
experimental-features = "nix-command flakes";
|
|
|
|
auto-optimise-store = true;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
programs.zsh.enable = true;
|
|
|
|
|
|
|
|
environment.systemPackages = with pkgs; [
|
|
|
|
git
|
|
|
|
neovim
|
|
|
|
];
|
|
|
|
|
|
|
|
# NOTE: made with `mkpasswd -m sha-516`
|
2023-12-25 14:17:30 +01:00
|
|
|
age.secrets."jeeves.user.password" = {
|
|
|
|
rekeyFile = "${inputs.self}/secrets/home/jeeves/user/password.age";
|
2023-12-25 20:13:48 +01:00
|
|
|
generator = {
|
2024-01-25 16:39:43 +01:00
|
|
|
script = { pkgs, ... }: ''
|
2023-12-25 20:13:48 +01:00
|
|
|
${pkgs.mkpasswd}/bin/mkpasswd -m sha-516
|
|
|
|
'';
|
|
|
|
};
|
2023-12-25 14:17:30 +01:00
|
|
|
};
|
2023-11-17 15:03:25 +01:00
|
|
|
|
2023-10-16 20:42:10 +02:00
|
|
|
users = {
|
|
|
|
mutableUsers = true;
|
|
|
|
users = {
|
|
|
|
jeeves = {
|
|
|
|
isNormalUser = true;
|
|
|
|
shell = pkgs.zsh;
|
2023-12-25 14:17:30 +01:00
|
|
|
hashedPasswordFile = config.age.secrets."jeeves.user.password".path;
|
2023-10-16 20:42:10 +02:00
|
|
|
openssh.authorizedKeys.keys = [
|
|
|
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBj8ZGcvI80WrJWV+dNy1a3L973ydSNqtwcVHzurDUaW (none)"
|
|
|
|
];
|
|
|
|
extraGroups = [
|
|
|
|
"wheel"
|
|
|
|
"networkmanager"
|
|
|
|
"audio"
|
|
|
|
"docker"
|
2023-11-17 15:03:25 +01:00
|
|
|
"transmission"
|
2023-10-16 20:42:10 +02:00
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
# reo101.jellyfin = {
|
|
|
|
# enable = true;
|
|
|
|
# image = "docker.io/jellyfin/jellyfin:latest";
|
|
|
|
# volumes = [
|
|
|
|
# "/var/cache/jellyfin/config:/config"
|
|
|
|
# "/var/cache/jellyfin/cache:/cache"
|
|
|
|
# "/var/log/jellyfin:/log"
|
|
|
|
# "/data/media/jellyfin:/media:ro"
|
|
|
|
# ];
|
|
|
|
# ports = [
|
|
|
|
# "8096:8096"
|
|
|
|
# ];
|
|
|
|
# };
|
|
|
|
|
2023-12-25 14:17:30 +01:00
|
|
|
# security.sudo-rs = {
|
|
|
|
# enable = !config.security.sudo.enable;
|
|
|
|
# inherit (config.security.sudo) extraRules;
|
|
|
|
# };
|
|
|
|
security.sudo = {
|
|
|
|
enable = true;
|
2024-01-25 16:39:43 +01:00
|
|
|
extraRules = [
|
2023-12-25 14:17:30 +01:00
|
|
|
{
|
|
|
|
users = [
|
|
|
|
"jeeves"
|
|
|
|
];
|
|
|
|
commands = [
|
2024-01-25 16:39:43 +01:00
|
|
|
{
|
|
|
|
command = "ALL";
|
|
|
|
options = [ "NOPASSWD" ]; # "SETENV" # Adding the following could be a good idea
|
|
|
|
}
|
2023-12-25 14:17:30 +01:00
|
|
|
];
|
|
|
|
}
|
|
|
|
];
|
|
|
|
};
|
2023-10-16 20:42:10 +02:00
|
|
|
|
|
|
|
services.openssh = {
|
|
|
|
enable = true;
|
|
|
|
settings = {
|
|
|
|
PermitRootLogin = "no";
|
|
|
|
PasswordAuthentication = false;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
boot.plymouth = {
|
|
|
|
enable = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
# https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion
|
|
|
|
system.stateVersion = "23.05";
|
|
|
|
}
|