2024-07-29 00:35:14 +02:00
|
|
|
{ inputs, lib, pkgs, config, ... }:
|
2023-10-16 20:42:10 +02:00
|
|
|
{
|
|
|
|
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-10-16 20:42:10 +02:00
|
|
|
./network.nix
|
2023-10-23 07:47:06 +02:00
|
|
|
./wireguard.nix
|
2024-07-20 17:02:26 +02:00
|
|
|
./nginx.nix
|
2023-11-17 15:03:25 +01:00
|
|
|
./jellyfin.nix
|
2024-07-20 17:02:26 +02:00
|
|
|
./transmission.nix
|
2023-12-07 20:18:20 +01:00
|
|
|
./mindustry.nix
|
2024-07-19 00:37:37 +02:00
|
|
|
# ./home-assistant
|
2024-01-22 18:22:50 +01:00
|
|
|
./samba.nix
|
2024-07-27 12:04:48 +02:00
|
|
|
# ./steam.nix
|
2024-07-19 00:37:37 +02:00
|
|
|
# ./ollama.nix
|
2024-07-27 12:04:48 +02:00
|
|
|
# ./sunshine.nix
|
|
|
|
# ./photoprism.nix
|
|
|
|
# ./immich.nix
|
|
|
|
# ./nextcloud.nix
|
2024-08-27 22:31:43 +02:00
|
|
|
./paperless.nix
|
2023-10-16 20:42:10 +02:00
|
|
|
];
|
|
|
|
|
2024-07-27 12:04:48 +02:00
|
|
|
# services.kanidm = { };
|
|
|
|
|
2023-12-25 14:17:30 +01:00
|
|
|
age.rekey = {
|
2024-08-13 14:53:14 +02:00
|
|
|
# TODO: store in `meta`
|
2023-12-25 14:17:30 +01:00
|
|
|
hostPubkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPopSTZ81UyKp9JSljCLp+Syk51zacjh9fLteqxQ6/aB";
|
2024-07-19 00:35:55 +02:00
|
|
|
# masterIdentities = [ "${inputs.self}/secrets/privkey.age" ];
|
|
|
|
# storageMode = "local";
|
|
|
|
# localStorageDir = "${inputs.self}/secrets/rekeyed/${config.networking.hostName}";
|
2023-12-25 14:17:30 +01:00
|
|
|
};
|
|
|
|
|
2023-10-16 20:42:10 +02:00
|
|
|
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;
|
|
|
|
|
2024-06-09 23:18:41 +02:00
|
|
|
nix = let
|
|
|
|
flakeInputs = lib.filterAttrs (lib.const (lib.isType "flake")) inputs;
|
|
|
|
in {
|
|
|
|
# This will add each flake input as a registry
|
|
|
|
# To make nix3 commands consistent with your flake
|
|
|
|
registry = lib.mapAttrs (_: value: { flake = value; }) flakeInputs;
|
2023-10-16 20:42:10 +02:00
|
|
|
|
2024-06-09 23:18:41 +02:00
|
|
|
# This will additionally add your inputs to the system's legacy channels
|
|
|
|
# Making legacy nix commands consistent as well, awesome!
|
|
|
|
nixPath = lib.mapAttrsToList (key: value: "${key}=flake:${key}") flakeInputs;
|
2023-10-16 20:42:10 +02:00
|
|
|
|
|
|
|
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
|
2024-08-13 14:53:14 +02:00
|
|
|
# FIXME: cannot deploy neovim-nightly
|
|
|
|
# V neovim source
|
|
|
|
# > error: cannot add path '/nix/store/rhjznh5jdzdkzbnn0fhhvcf9rys0s59d-source' because it lacks a signature by a trusted key
|
|
|
|
# neovim
|
2023-10-16 20:42:10 +02:00
|
|
|
];
|
|
|
|
|
2024-07-19 00:37:37 +02:00
|
|
|
# NOTE: made with `mkpasswd -m sha-512`
|
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, ... }: ''
|
2024-07-19 00:37:37 +02:00
|
|
|
${pkgs.mkpasswd}/bin/mkpasswd -m sha-512
|
2023-12-25 20:13:48 +01:00
|
|
|
'';
|
|
|
|
};
|
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"
|
2024-07-19 00:37:37 +02:00
|
|
|
"input"
|
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";
|
|
|
|
}
|