organization

This commit is contained in:
mjallen18
2024-02-24 23:08:52 -06:00
parent dc6ebf3cbb
commit f0e5baea4b
22 changed files with 811 additions and 205 deletions

View File

@@ -0,0 +1,86 @@
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page, on
# https://search.nixos.org/options and in the NixOS manual (`nixos-help`).
{ config, lib, pkgs, ... }:
let
user = "matt";
password = "$y$j9T$EkPXmsmIMFFZ.WRrBYCxS1$P0kwo6e4.WM5DsqUcEqWC3MrZp5KfCjxffraMFZWu06";
SSID = "Joeys Jungle";
SSIDpassword = "kR8v&3Qd";
interface = "wlan0";
timezone = "America/Chicago";
hostname = "nixos-pi4";
in {
imports =
[ # Include the results of the hardware scan.
./hardware-configuration-pi4.nix
./docker-pi4.nix
];
# Enable nix flakes and nix-command tools
nix.settings.experimental-features = [ "nix-command" "flakes" ];
boot = {
kernelPackages = pkgs.linuxKernel.packages.linux_rpi4;
initrd.availableKernelModules = [ "xhci_pci" "usbhid" "usb_storage" ];
loader = {
grub.enable = false;
generic-extlinux-compatible.enable = true;
};
};
# Set your time zone.
time.timeZone = "America/Chicago";
networking = {
hostName = hostname;
wireless = {
enable = true;
networks."${SSID}".psk = SSIDpassword;
interfaces = [ interface ];
};
};
environment.systemPackages = with pkgs; [
vim
raspberrypi-eeprom
htop
git
];
services.openssh.enable = true;
users = {
mutableUsers = false;
users."${user}" = {
isNormalUser = true;
initialHashedPassword = password;
extraGroups = [ "wheel" "docker" ];
};
};
virtualisation.docker.enable = true;
# This option defines the first version of NixOS you have installed on this particular machine,
# and is used to maintain compatibility with application data (e.g. databases) created on older NixOS versions.
#
# Most users should NEVER change this value after the initial install, for any reason,
# even if you've upgraded your system to a new NixOS release.
#
# This value does NOT affect the Nixpkgs version your packages and OS are pulled from,
# so changing it will NOT upgrade your system - see https://nixos.org/manual/nixos/stable/#sec-upgrading for how
# to actually do that.
#
# This value being lower than the current NixOS release does NOT mean your system is
# out of date, out of support, or vulnerable.
#
# Do NOT change this value unless you have manually inspected all the changes it would make to your configuration,
# and migrated your data accordingly.
#
# For more information, see `man configuration.nix` or https://nixos.org/manual/nixos/stable/options#opt-system.stateVersion .
system.stateVersion = "24.05"; # Did you read the comment?
}

33
hosts/pi4/docker-pi4.nix Normal file
View File

@@ -0,0 +1,33 @@
{ config, pkgs, ... }:
{
# Portainer
virtualisation.oci-containers.containers."portainer" = {
autoStart = true;
image = "portainer/portainer-ce";
ports = [ "8000:8000" "9443:9443" ];
volumes = [
"/var/run/docker.sock:/var/run/docker.sock"
"/media/T5/docker/config/portainer:/data"
];
};
# Jellyfin
virtualisation.oci-containers.containers."jellyfin" = {
autoStart = true;
image = "jellyfin/jellyfin";
volumes = [
"/media/T5/containers/jellyfin/config:/config"
"/media/T5/containers/jellyfin/cache:/cache"
"/media/T5/containers/jellyfin/log:/log"
"/media/T5/movies:/movies"
"/media/T5/tv:/tv"
];
ports = [ "8096:8096" ];
environment = {
JELLYFIN_LOG_DIR = "/log";
};
};
}

View File

@@ -0,0 +1,44 @@
# 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 + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "xhci_pci" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/ec969af6-d557-408a-a149-ba23d31fd8a2";
fsType = "ext4";
};
fileSystems."/media/T5" =
{ device = "/dev/disk/by-uuid/191ce486-899d-4718-81e3-5c9b3ea860e4";
fsType = "ext4";
};
fileSystems."/FIRMWARE" =
{ device = "/dev/disk/by-uuid/5A9F-FC90";
fsType = "vfat";
};
swapDevices =
[ { device = "/dev/disk/by-uuid/d9909ef7-c345-48f7-b210-ad7cbe72224b"; }
];
# 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.end0.useDHCP = lib.mkDefault true;
# networking.interfaces.wlan0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "aarch64-linux";
}