mirror of
https://github.com/genebean/dots.git
synced 2026-03-27 09:27:44 -04:00
Add hetznix01
This commit is contained in:
parent
0d868fc0aa
commit
a62a3d136a
9 changed files with 120 additions and 14 deletions
|
|
@ -92,6 +92,8 @@
|
||||||
};
|
};
|
||||||
specialArgs = { inherit inputs username hostname; };
|
specialArgs = { inherit inputs username hostname; };
|
||||||
modules = [
|
modules = [
|
||||||
|
disko.nixosModules.disko
|
||||||
|
|
||||||
home-manager.nixosModules.home-manager {
|
home-manager.nixosModules.home-manager {
|
||||||
home-manager = {
|
home-manager = {
|
||||||
extraSpecialArgs = { inherit genebean-omp-themes hostname username; };
|
extraSpecialArgs = { inherit genebean-omp-themes hostname username; };
|
||||||
|
|
@ -139,6 +141,7 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
nixosConfigurations = {
|
nixosConfigurations = {
|
||||||
|
hetznix01 = nixosHostConfig "aarch64-linux" "hetznix01" "gene";
|
||||||
nixnuc = nixosHostConfig "x86_64-linux" "nixnuc" "gene";
|
nixnuc = nixosHostConfig "x86_64-linux" "nixnuc" "gene";
|
||||||
rainbow-planet = nixosHostConfig "x86_64-linux" "rainbow-planet" "gene";
|
rainbow-planet = nixosHostConfig "x86_64-linux" "rainbow-planet" "gene";
|
||||||
};
|
};
|
||||||
|
|
|
||||||
7
modules/home-manager/hosts/hetznix01/gene.nix
Normal file
7
modules/home-manager/hosts/hetznix01/gene.nix
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
{ pkgs, genebean-omp-themes, ... }: {
|
||||||
|
home.stateVersion = "23.11";
|
||||||
|
imports = [
|
||||||
|
../../common/all-cli.nix
|
||||||
|
../../common/all-linux.nix
|
||||||
|
];
|
||||||
|
}
|
||||||
32
modules/hosts/nixos/hetznix01/default.nix
Normal file
32
modules/hosts/nixos/hetznix01/default.nix
Normal file
|
|
@ -0,0 +1,32 @@
|
||||||
|
{ inputs, config, disko, hostname, pkgs, sops-nix, username, ... }: {
|
||||||
|
imports = [
|
||||||
|
./hardware-configuration.nix
|
||||||
|
./disk-config.nix
|
||||||
|
];
|
||||||
|
|
||||||
|
system.stateVersion = "23.11";
|
||||||
|
|
||||||
|
networking = {
|
||||||
|
# Open ports in the firewall.
|
||||||
|
firewall.allowedTCPPorts = [ 22 ];
|
||||||
|
# firewall.allowedUDPPorts = [ ... ];
|
||||||
|
# Or disable the firewall altogether.
|
||||||
|
# firewall.enable = false;
|
||||||
|
|
||||||
|
hostId = "85d0e6cb"; # head -c4 /dev/urandom | od -A none -t x4
|
||||||
|
|
||||||
|
networkmanager.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
programs.mtr.enable = true;
|
||||||
|
|
||||||
|
users.users.${username} = {
|
||||||
|
isNormalUser = true;
|
||||||
|
description = "Gene Liverman";
|
||||||
|
extraGroups = [ "networkmanager" "wheel" ];
|
||||||
|
openssh.authorizedKeys.keys = [
|
||||||
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBjigwV0KnnaTnFmKjjvnULa5X+hvsy2FAlu+lUUY59f gene@rainbow-planet"
|
||||||
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIp42X5DZ713+bgbOO+GXROufUFdxWo7NjJbGQ285x3N bluerock"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
||||||
42
modules/hosts/nixos/hetznix01/disk-config.nix
Normal file
42
modules/hosts/nixos/hetznix01/disk-config.nix
Normal file
|
|
@ -0,0 +1,42 @@
|
||||||
|
# Example to create a bios compatible gpt partition
|
||||||
|
{ lib, ... }:
|
||||||
|
{
|
||||||
|
disko.devices = {
|
||||||
|
disk.disk1 = {
|
||||||
|
device = lib.mkDefault "/dev/sda";
|
||||||
|
type = "disk";
|
||||||
|
content = {
|
||||||
|
type = "gpt";
|
||||||
|
partitions = {
|
||||||
|
boot = {
|
||||||
|
name = "boot";
|
||||||
|
size = "1M";
|
||||||
|
type = "EF02";
|
||||||
|
};
|
||||||
|
esp = {
|
||||||
|
name = "ESP";
|
||||||
|
size = "500M";
|
||||||
|
type = "EF00";
|
||||||
|
content = {
|
||||||
|
type = "filesystem";
|
||||||
|
format = "vfat";
|
||||||
|
mountpoint = "/boot";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
root = {
|
||||||
|
name = "root";
|
||||||
|
size = "100%";
|
||||||
|
content = {
|
||||||
|
type = "filesystem";
|
||||||
|
format = "ext4";
|
||||||
|
mountpoint = "/";
|
||||||
|
mountOptions = [
|
||||||
|
"defaults"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
24
modules/hosts/nixos/hetznix01/hardware-configuration.nix
Normal file
24
modules/hosts/nixos/hetznix01/hardware-configuration.nix
Normal file
|
|
@ -0,0 +1,24 @@
|
||||||
|
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||||||
|
# and may be overwritten by future invocations. Please make changes
|
||||||
|
# to /etc/nixos/configuration.nix instead.
|
||||||
|
{ config, lib, pkgs, modulesPath, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports =
|
||||||
|
[ (modulesPath + "/profiles/qemu-guest.nix")
|
||||||
|
];
|
||||||
|
|
||||||
|
boot.initrd.availableKernelModules = [ "xhci_pci" "virtio_pci" "virtio_scsi" "usbhid" "sr_mod" ];
|
||||||
|
boot.initrd.kernelModules = [ ];
|
||||||
|
boot.kernelModules = [ ];
|
||||||
|
boot.extraModulePackages = [ ];
|
||||||
|
|
||||||
|
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
||||||
|
# (the default) this is the recommended approach. When using systemd-networkd it's
|
||||||
|
# still possible to use this option, but it's recommended to use it in conjunction
|
||||||
|
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
|
||||||
|
networking.useDHCP = lib.mkDefault true;
|
||||||
|
# networking.interfaces.enp1s0.useDHCP = lib.mkDefault true;
|
||||||
|
|
||||||
|
nixpkgs.hostPlatform = lib.mkDefault "aarch64-linux";
|
||||||
|
}
|
||||||
0
modules/hosts/nixos/hetznix01/secrets.yaml
Normal file
0
modules/hosts/nixos/hetznix01/secrets.yaml
Normal file
|
|
@ -114,6 +114,8 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
tailscale = {
|
tailscale = {
|
||||||
|
enable = true;
|
||||||
|
authKeyFile = config.sops.secrets.tailscale_key.path;
|
||||||
extraUpFlags = [
|
extraUpFlags = [
|
||||||
"--advertise-exit-node"
|
"--advertise-exit-node"
|
||||||
"--operator"
|
"--operator"
|
||||||
|
|
@ -136,6 +138,9 @@
|
||||||
owner = "${username}";
|
owner = "${username}";
|
||||||
path = "/home/${username}/.private-env";
|
path = "/home/${username}/.private-env";
|
||||||
};
|
};
|
||||||
|
tailscale_key = {
|
||||||
|
restartUnits = [ "tailscaled-autoconnect.service" ];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
{ pkgs, username, ... }: {
|
{ config, pkgs, username, ... }: {
|
||||||
imports = [
|
imports = [
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
../../../system/common/linux/flatpaks.nix
|
../../../system/common/linux/flatpaks.nix
|
||||||
|
|
@ -73,6 +73,8 @@
|
||||||
gvfs.enable = true; # Used by Nautilus
|
gvfs.enable = true; # Used by Nautilus
|
||||||
printing.enable = true; # Enable CUPS
|
printing.enable = true; # Enable CUPS
|
||||||
tailscale = {
|
tailscale = {
|
||||||
|
enable = true;
|
||||||
|
authKeyFile = config.sops.secrets.tailscale_key.path;
|
||||||
extraUpFlags = [
|
extraUpFlags = [
|
||||||
"--operator"
|
"--operator"
|
||||||
"${username}"
|
"${username}"
|
||||||
|
|
@ -120,6 +122,9 @@
|
||||||
owner = "${username}";
|
owner = "${username}";
|
||||||
path = "/home/${username}/.private-env";
|
path = "/home/${username}/.private-env";
|
||||||
};
|
};
|
||||||
|
tailscale_key = {
|
||||||
|
restartUnits = [ "tailscaled-autoconnect.service" ];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -52,21 +52,9 @@
|
||||||
|
|
||||||
services = {
|
services = {
|
||||||
openssh.enable = true;
|
openssh.enable = true;
|
||||||
tailscale = {
|
|
||||||
enable = true;
|
|
||||||
authKeyFile = config.sops.secrets.tailscale_key.path;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
sops = {
|
sops.age.sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ];
|
||||||
age.sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ];
|
|
||||||
secrets = {
|
|
||||||
tailscale_key = {
|
|
||||||
restartUnits = [ "tailscaled-autoconnect.service" ];
|
|
||||||
sopsFile = ../../hosts/nixos/${hostname}/secrets.yaml;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
time.timeZone = "America/New_York";
|
time.timeZone = "America/New_York";
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue