chore: update Nix configurations for Nixcloud and common hosts

- Add Nixcloud host configurations including networking, hardware, and system settings
- Refactor existing configurations for clarity and organization
- Remove unused podman configuration from home-manager
- Update SSH agent settings and session variables in Nixbook host
This commit is contained in:
Thiago Sposito 2025-10-17 17:18:35 -03:00
parent ab832834a8
commit e9a77fccb7
11 changed files with 240 additions and 39 deletions

View file

@ -0,0 +1,95 @@
{
config,
inputs,
lib,
pkgs,
...
}:
{
imports = [ ./users/nimbus/default.nix ];
boot.loader.systemd-boot.enable = true;
nixpkgs.overlays = [
(final: prev: {
libnitrokey = prev.libnitrokey.overrideAttrs (old: {
cmakeFlags = (old.cmakeFlags or [ ]) ++ [
"-DCMAKE_POLICY_VERSION_MINIMUM=3.5"
];
});
})
];
environment = {
shells = with pkgs; [ bash ];
etc = lib.mapAttrs' (name: value: {
name = "nix/path/${name}";
value.source = value.flake;
}) config.nix.registry;
systemPackages = with pkgs; [
ccid
exfat
file
fuse3
gcsfuse
git
gnupg
libnitrokey
libusb1
nix-ld
opensc
pciutils
pcsc-safenet
pcsclite
pcsctools
pkcs11helper
rclone
sops
wget
];
};
nix = {
registry = (lib.mapAttrs (_: flake: { inherit flake; })) (
(lib.filterAttrs (_: lib.isType "flake")) inputs
);
nixPath = [ "/etc/nix/path" ];
settings = {
download-buffer-size = "512M";
experimental-features = "nix-command flakes";
auto-optimise-store = true;
};
};
nixpkgs.config.allowUnfree = true;
programs = {
gnupg = {
agent = {
enableSSHSupport = true;
enable = true;
pinentryPackage = pkgs.pinentry-tty;
};
};
nix-ld = {
enable = true;
libraries = with pkgs; [
glibc
zlib
];
};
};
services = {
pcscd.enable = true;
# xserver.displayManager.sessionCommands =
# "${pkgs.xorg.xmodmap}/bin/xmodmap -e 'keycode 64 = Alt_L'";
udev.packages = [
pkgs.nitrokey-udev-rules
];
};
users.groups.scard = { };
time.timeZone = "America/Sao_Paulo";
}

View file

@ -0,0 +1,15 @@
{ ... }: {
imports = [
./hardware-configuration.nix
./networking.nix # generated at runtime by nixos-infect
];
boot.tmp.cleanOnBoot = true;
zramSwap.enable = true;
networking.hostName = "srv1065175";
networking.domain = "hstgr.cloud";
services.openssh.enable = true;
users.users.root.openssh.authorizedKeys.keys = [''ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCWstSULudWNwPQxyS2J7Qygw8CozDDy8WsPjsYzKPI9s0B/KLU0g1oX42bBvn4DgNpzGrpb6IGHpRQohStt7vcOxb9XpfhIOcIr45gU3k3lcPjh6vj8/ZoNQlRDIfxs83RDImvveYABuI/Hq42mLV1kI5qnQHaJxuW73AuYKNzE3Z3PUl5Kw6MgzSZ96QlpiQDn/js7ZTBF/YZ18kPh9E9O1y+EDhcJ4gn38rFIMYMG/KbJB22hYyYQHo0WkJlZ2jScnjv1op2yHPM4lfjOnnyL+LhOQLN8VrHayDWXtJcIW0nEKT+1R/7qkSH/5ELA2c/gznfkdTDzfG8+P3WAzNF openpgp:0xC25417F1 n3k0'' '''' ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICRAJaRuXqVeAs/Y5CeTbyc9lSbyvchkVqiML/yl6wbh thiago@Nixbook'' ];
system.stateVersion = "23.11";
}

View file

@ -0,0 +1,9 @@
{ modulesPath, ... }:
{
imports = [ (modulesPath + "/profiles/qemu-guest.nix") ];
boot.loader.grub.device = "/dev/sda";
boot.initrd.availableKernelModules = [ "ata_piix" "uhci_hcd" "xen_blkfront" "vmw_pvscsi" ];
boot.initrd.kernelModules = [ "nvme" ];
fileSystems."/" = { device = "/dev/sda1"; fsType = "ext4"; };
}

View file

@ -0,0 +1,35 @@
{ lib, ... }: {
# This file was populated at runtime with the networking
# details gathered from the active system.
networking = {
nameservers = [ "45.143.83.10"
"1.1.1.1"
"8.8.4.4"
];
defaultGateway = "72.61.129.254";
defaultGateway6 = {
address = "2a02:4780:66::1";
interface = "eth0";
};
dhcpcd.enable = false;
usePredictableInterfaceNames = lib.mkForce false;
interfaces = {
eth0 = {
ipv4.addresses = [
{ address="72.61.129.56"; prefixLength=24; }
];
ipv6.addresses = [
{ address="2a02:4780:66:9ac0::1"; prefixLength=48; }
{ address="fe80::9ce8:d4ff:feb5:50d7"; prefixLength=64; }
];
ipv4.routes = [ { address = "72.61.129.254"; prefixLength = 32; } ];
ipv6.routes = [ { address = "2a02:4780:66::1"; prefixLength = 128; } ];
};
};
};
services.udev.extraRules = ''
ATTR{address}=="9e:e8:d4:b5:50:d7", NAME="eth0"
'';
}