Configure beryllium for usage

This commit is contained in:
Christopher Mühl 2025-09-18 19:07:50 +02:00
parent a043874145
commit 27b0b35774
No known key found for this signature in database
GPG key ID: E919B0F59E14FD47
13 changed files with 152 additions and 8 deletions

View file

@ -17,10 +17,10 @@ deploy:
}} }}
europium: europium:
nixos-rebuild switch --flake .#europium --target-host europium --build-host europium --use-remote-sudo nixos-rebuild switch --flake .#europium --target-host europium-deploy --build-host europium --use-remote-sudo
beryllium: beryllium:
nixos-rebuild switch --flake .#beryllium --target-host beryllium --build-host beryllium --use-remote-sudo nixos-rebuild switch --flake .#beryllium --target-host beryllium-deploy --build-host beryllium --use-remote-sudo
# Opens the elements configuration in the default editor # Opens the elements configuration in the default editor
edit: edit:

16
flake.lock generated
View file

@ -934,6 +934,21 @@
"type": "github" "type": "github"
} }
}, },
"quadlet": {
"locked": {
"lastModified": 1754008153,
"narHash": "sha256-MYT1mDtSkiVg343agxgBFsnuNU3xS8vRy399JXX1Vw0=",
"owner": "SEIAROTg",
"repo": "quadlet-nix",
"rev": "1b2d27d460d8c7e4da5ba44ede463b427160b5c4",
"type": "github"
},
"original": {
"owner": "SEIAROTg",
"repo": "quadlet-nix",
"type": "github"
}
},
"root": { "root": {
"inputs": { "inputs": {
"agenix": "agenix", "agenix": "agenix",
@ -947,6 +962,7 @@
"hyprland": "hyprland", "hyprland": "hyprland",
"musnix": "musnix", "musnix": "musnix",
"nixpkgs": "nixpkgs_4", "nixpkgs": "nixpkgs_4",
"quadlet": "quadlet",
"rose-pine-hyprcursor": "rose-pine-hyprcursor", "rose-pine-hyprcursor": "rose-pine-hyprcursor",
"snowfall": "snowfall", "snowfall": "snowfall",
"split-monitor-workspaces": "split-monitor-workspaces" "split-monitor-workspaces": "split-monitor-workspaces"

View file

@ -35,9 +35,17 @@
]; ];
beryllium.modules = [ beryllium.modules = [
copyparty.nixosModules.default copyparty.nixosModules.default
quadlet.nixosModules.quadlet
];
europium.modules = [
quadlet.nixosModules.quadlet
]; ];
}; };
homes.users."christopher@beryllium".modules = with inputs; [
quadlet.homeManagerModules.quadlet
];
# Configure nixpkgs when instantiating the package set # Configure nixpkgs when instantiating the package set
# TODO: This is already specified elsewhere. Still needed here? # TODO: This is already specified elsewhere. Still needed here?
channels-config = { channels-config = {
@ -110,6 +118,7 @@
inputs.hyprland.follows = "hyprland"; inputs.hyprland.follows = "hyprland";
}; };
quadlet.url = "github:SEIAROTg/quadlet-nix";
musnix.url = "github:musnix/musnix"; musnix.url = "github:musnix/musnix";
docker-compose-1.url = github:nixos/nixpkgs/b0f0b5c6c021ebafbd322899aa9a54b87d75a313; docker-compose-1.url = github:nixos/nixpkgs/b0f0b5c6c021ebafbd322899aa9a54b87d75a313;

View file

@ -0,0 +1,32 @@
{
pkgs,
config,
...
}: {
elements.secrets = {
rekeyPath = "christopher_beryllium";
key = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBUKDCjB0VpQubi8BfnYKbh4MIE1tcvKQesdoPE4NXAf";
needs = {
traefik-env = "traefik.env.age";
};
};
# virtualisation.quadlet.containers = {
# echo = {
# autoStart = true;
# serviceConfig = {
# RestartSec = "10";
# Restart = "always";
# };
# containerConfig = {
# image = "docker.io/mendhak/http-https-echo:31";
# publishPorts = ["127.0.0.1:8080:8080"];
# };
# };
# };
home.packages = with pkgs; [
helix
];
}

View file

@ -0,0 +1,8 @@
age-encryption.org/v1
-> ssh-ed25519 pySEWw kigbWfXfeb8YlBMpSWM+jDPtjYeAltdTORqPQ7kqnFg
P8j10qrMzjWZ91FVnn4sLugS/AcS2XrMr9TRal5gRVc
-> m0^G"4-grease p]TT RuLz
9HFjCiuy7w
--- j57VRBCbLMVDI2s7DnpBwTvVzzvqwMdXL6Ec/9Tg6MA
cDÍ_FT,hº³ }/<2F>;A8õüPýþØ%/:E)pè”Õ€
¾qý{J­ UÚë†kï¸n\8L}j'Ãî‰yaãJ

View file

@ -0,0 +1,8 @@
age-encryption.org/v1
-> ssh-ed25519 pySEWw yyra9wL+n2gFPpbmnkvbsxBverCR/r7yPSw3aCD0slk
65Vc/tQKzfsFC5smIqHmXA7NlSJLW8oXAYPYiX3bGcw
-> MV*6+^H-grease uV!LS]1* B5lCK], yjN7.
O1RM77BbFx0SsKlEXUVAJCswHGS1oKfX1ZvBNcF47W0o//6iiBHOWTvpaW15xVMZ
00g
--- XNgzqoXEkkzK8TE/A81FFduXsiDouJFXV/9o/m/bnss
Q1‡©0#ÍšÎi~d¹Ç~ïòEðlÔgG^OÕ,ÊP:¹¡Ö£¨ëø[if>•,@i<>|DJ¹åm)P8hé·2ÈVÃãüÑkš)ø7£>u@qò¡ Í#͈×<CB86>ïfå<>¨ä<C2A8>™Û¥+¡O,œa<C593>,ð%éátRË[7<>îN

BIN
secrets/smb-secrets.age Normal file

Binary file not shown.

Binary file not shown.

11
secrets/traefik.env.age Normal file
View file

@ -0,0 +1,11 @@
age-encryption.org/v1
-> X25519 bXMX40Vz9sJqcVcb3ote48FAUxB+GzTQ4rOP8rI8O34
KlAn7X9p9EqKxmiBOBg/apVLCSMAoOTsEF4BW8pBxng
-> piv-p256 Kmn3OQ A5tjfx5HhP+RRxXD3dQmuZnxezXp1SdmlGbhBazV8EMz
B/6jGDqQagB2ZSxC2WhZcDcu6YfJokHTR0DtrIJ45Tk
-> f!=YO-grease (YufTYP (VD px s8\X~Fzn
WYavDbOneKQ/pdc369k8fqDS2ITD+rQ
--- HE0AabwaJ9U/2CWSqIghcWxhIW9fwNCqCkZFhcb+xnU
é?”169C77jܲm0,ˆ¬¼ ' Ã
:“fxB¶âè<C3A2>¤ûð¢ëRÞ]¥b Š\÷ç7^¹k°h<C2B0>>ºƒæ–‰¤¾­üª¡|žÀ[ßxj ƒd
æU¼ÖÈ"erR»Y½Š±@6=4Øü}w

View file

@ -3,6 +3,7 @@
# NUC / HomeLab environment # NUC / HomeLab environment
{ {
lib, lib,
config,
pkgs, pkgs,
... ...
}: { }: {
@ -48,23 +49,72 @@
users = ["christopher"]; users = ["christopher"];
secrets = { secrets = {
key = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBUKDCjB0VpQubi8BfnYKbh4MIE1tcvKQesdoPE4NXAf"; key = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBUKDCjB0VpQubi8BfnYKbh4MIE1tcvKQesdoPE4NXAf";
needs = {
smbSecrets = "smb-secrets.age";
};
}; };
}; };
networking.firewall.enable = false;
networking.dhcpcd.IPv6rs = false;
users.users.christopher.linger = true; # autostart of quadlets before login
users.users.christopher.autoSubUidGidRange = true;
users.users.christopher.openssh.authorizedKeys.keys = ["ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMVKJfY6B9TsUPdPXy3tkqL42sJgJRz3NOOKTqhytMMf christopher@cobalt"]; users.users.christopher.openssh.authorizedKeys.keys = ["ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMVKJfY6B9TsUPdPXy3tkqL42sJgJRz3NOOKTqhytMMf christopher@cobalt"];
users.users.root.openssh.authorizedKeys.keys = ["ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMVKJfY6B9TsUPdPXy3tkqL42sJgJRz3NOOKTqhytMMf christopher@cobalt"];
services = { services = {
openssh.enable = true; openssh = {
openssh.ports = [7319]; enable = true;
openssh.settings.PasswordAuthentication = false; ports = [7319];
settings.PasswordAuthentication = false;
beszel-agent.enable = true;
beszel-agent.key = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMkUPOw28Cu2LMuzfmvjT/L2ToNHcADwGyGvSpJ4wH2T";
}; };
virtualisation.podman.enable = true; beszel-agent = {
enable = true;
key = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMkUPOw28Cu2LMuzfmvjT/L2ToNHcADwGyGvSpJ4wH2T";
};
};
boot.kernel.sysctl = {
# We require this so that a rootless traefik can bind to port 80.
"net.ipv4.ip_unprivileged_port_start" = "80";
};
# virtualisation.quadlet.enable = true;
virtualisation.podman = {
enable = true;
defaultNetwork.settings = {
dns_enabled = true;
# Override the default subnet as it overlaps with my LAN.
subnets = [
{
gateway = "172.16.0.1";
subnet = "172.16.0.0/16";
}
];
};
};
fileSystems."/mnt/nuc/_NAS_Media" = {
device = "//10.1.0.1/_NAS_Media";
fsType = "cifs";
options = let
automount_opts = "x-systemd.automount,noauto,x-systemd.idle-timeout=60,x-systemd.device-timeout=5s,x-systemd.mount-timeout=5s";
in ["${automount_opts},credentials=${config.age.secrets.smbSecrets.path},uid=100999,gid=10999,vers=1.0"];
};
fileSystems."/mnt/nuc/Ix" = {
device = "//10.1.0.1/Ix";
fsType = "cifs";
options = let
automount_opts = "x-systemd.automount,noauto,x-systemd.idle-timeout=60,x-systemd.device-timeout=5s,x-systemd.mount-timeout=5s";
in ["${automount_opts},credentials=${config.age.secrets.smbSecrets.path},uid=100999,gid=10999,vers=1.0"];
};
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
cifs-utils
helix
podman-compose podman-compose
]; ];
} }

View file

@ -14,4 +14,14 @@
virtualisation.virtualbox.guest.enable = true; virtualisation.virtualbox.guest.enable = true;
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
fileSystems."/mnt/external" = {
device = "/dev/disk/by-uuid/0fc53086-d326-4663-973c-aa224a3f8589";
fsType = "ext4";
options = [
"nofail"
"exec"
"users"
];
};
} }