some wip
This commit is contained in:
@@ -7,19 +7,21 @@
|
|||||||
{
|
{
|
||||||
den.aspects.rpi5 = {
|
den.aspects.rpi5 = {
|
||||||
includes = [
|
includes = [
|
||||||
modules.raspberry-pi
|
<modules/raspberry-pi/5>
|
||||||
modules.services.traefik
|
<modules/services/traefik>
|
||||||
];
|
];
|
||||||
nixos = {
|
nixos = {
|
||||||
users.users.doloro = {
|
users.users = {
|
||||||
isNormalUser = true;
|
doloro = {
|
||||||
extraGroups = [ "wheel" ];
|
isNormalUser = true;
|
||||||
openssh.authorizedKeys.keys = [
|
extraGroups = [
|
||||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIE/4h+WCBBW82puv8SMdUbkWymF4amEMuZitgFztB6oZ" # laptop pub key
|
"wheel"
|
||||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBaa6Z5qtBSLEz+A4fQGYPfkOISsRQlmKkVbcx2zxML7" # pc pub key
|
"docker"
|
||||||
];
|
];
|
||||||
initialPassword = "meowmeowmeow";
|
initialPassword = "meowmeowmeow";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
networking.hostName = "nixos-001-rp5";
|
networking.hostName = "nixos-001-rp5";
|
||||||
|
|
||||||
networking.firewall = {
|
networking.firewall = {
|
||||||
@@ -32,6 +34,7 @@
|
|||||||
allowedUDPPortRanges = [ ];
|
allowedUDPPortRanges = [ ];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
virtualisation.docker.enable = true;
|
||||||
virtualisation.oci-containers.backend = "docker";
|
virtualisation.oci-containers.backend = "docker";
|
||||||
|
|
||||||
services.openssh.enable = true;
|
services.openssh.enable = true;
|
||||||
|
|||||||
@@ -1,11 +1,26 @@
|
|||||||
{ den, __findFile, ... }:
|
{
|
||||||
|
den,
|
||||||
|
__findFile,
|
||||||
|
modules,
|
||||||
|
...
|
||||||
|
}:
|
||||||
{
|
{
|
||||||
# The single rpi5 i have running on the side of my desk
|
# The single rpi5 i have running on the side of my desk
|
||||||
|
den.aspects.doloro-server = {
|
||||||
|
includes = [ <modules/publicKeys/doloro> ];
|
||||||
|
};
|
||||||
den.hosts.aarch64-linux.rpi5 = {
|
den.hosts.aarch64-linux.rpi5 = {
|
||||||
|
includes = [ ];
|
||||||
users.doloro = {
|
users.doloro = {
|
||||||
includes = [ <modules/user/groups> ];
|
includes = [
|
||||||
|
<modules/user/groups>
|
||||||
|
<modules/publicKeys/doloro>
|
||||||
|
];
|
||||||
aspect = "doloro-server";
|
aspect = "doloro-server";
|
||||||
};
|
};
|
||||||
|
users.root = {
|
||||||
|
includes = [ <modules/publicKeys/doloro> ];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
18
config/modules/publickeys.nix
Normal file
18
config/modules/publickeys.nix
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
{ modules, ... }:
|
||||||
|
{
|
||||||
|
# Applys doloro's public keys to the users openssh
|
||||||
|
modules.publicKeys.provides = {
|
||||||
|
doloro =
|
||||||
|
{ user, host, ... }:
|
||||||
|
{
|
||||||
|
nixos = {
|
||||||
|
users.users.${user.userName} = {
|
||||||
|
openssh.authorizedKeys.keys = [
|
||||||
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIE/4h+WCBBW82puv8SMdUbkWymF4amEMuZitgFztB6oZ" # laptop pub key
|
||||||
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBaa6Z5qtBSLEz+A4fQGYPfkOISsRQlmKkVbcx2zxML7" # pc pub key
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -10,29 +10,32 @@
|
|||||||
raspberry-pi-nix.url = "github:nix-community/raspberry-pi-nix";
|
raspberry-pi-nix.url = "github:nix-community/raspberry-pi-nix";
|
||||||
};
|
};
|
||||||
modules.raspberry-pi = {
|
modules.raspberry-pi = {
|
||||||
# TODO, make this take an attr set which describes which rpi it is
|
provides = {
|
||||||
nixos =
|
"5" = {
|
||||||
{ pkgs, ... }:
|
nixos =
|
||||||
let
|
{ pkgs, ... }:
|
||||||
rpi-pi = inputs.raspberry-pi-nix;
|
let
|
||||||
in
|
rpi-pi = inputs.raspberry-pi-nix;
|
||||||
{
|
in
|
||||||
imports = [
|
{
|
||||||
rpi-pi.nixosModules.raspberry-pi
|
imports = [
|
||||||
rpi-pi.nixosModules.sd-image
|
rpi-pi.nixosModules.raspberry-pi
|
||||||
];
|
rpi-pi.nixosModules.sd-image
|
||||||
|
];
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
libraspberrypi
|
libraspberrypi
|
||||||
];
|
];
|
||||||
|
|
||||||
sdImage.compressImage = false;
|
sdImage.compressImage = false;
|
||||||
raspberry-pi-nix.board = "bcm2712"; # Rpi 5 - 64bit
|
raspberry-pi-nix.board = "bcm2712"; # Rpi 5 - 64bit
|
||||||
# We need to rebuild kernel for 6.12
|
# We need to rebuild kernel for 6.12
|
||||||
# raspberry-pi-nix.kernel-version = "v6_12_17";
|
# raspberry-pi-nix.kernel-version = "v6_12_17";
|
||||||
raspberry-pi-nix.uboot.enable = false;
|
raspberry-pi-nix.uboot.enable = false;
|
||||||
|
|
||||||
hardware.enableRedistributableFirmware = true;
|
hardware.enableRedistributableFirmware = true;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,11 +6,11 @@
|
|||||||
}:
|
}:
|
||||||
{
|
{
|
||||||
# Basic traefik
|
# Basic traefik
|
||||||
modules.services.traefik = {
|
modules.services.provides.traefik = {
|
||||||
services.traefik = {
|
nixos =
|
||||||
nixos =
|
{ config, ... }:
|
||||||
{ config, ... }:
|
{
|
||||||
{
|
services.traefik = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
staticConfigOptions = {
|
staticConfigOptions = {
|
||||||
@@ -46,6 +46,6 @@
|
|||||||
api.insecure = true;
|
api.insecure = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,16 +0,0 @@
|
|||||||
{ modules, ... }:
|
|
||||||
{
|
|
||||||
# Applys public keys and various root account config
|
|
||||||
modules.servers.rootAcc =
|
|
||||||
{ config, user, ... }:
|
|
||||||
{
|
|
||||||
nixos = {
|
|
||||||
users.users.root = {
|
|
||||||
openssh.authorizedKeys.keys = [
|
|
||||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIE/4h+WCBBW82puv8SMdUbkWymF4amEMuZitgFztB6oZ" # laptop pub key
|
|
||||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBaa6Z5qtBSLEz+A4fQGYPfkOISsRQlmKkVbcx2zxML7" # pc pub key
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user