cleanup names

This commit is contained in:
mjallen18
2025-08-26 20:28:55 -05:00
parent 02085e7ff1
commit d6ae29f16f
56 changed files with 1406 additions and 1336 deletions

View File

@@ -11,7 +11,7 @@
{
text = ''
-----BEGIN PGP PUBLIC KEY BLOCK-----
mQINBGipyhUBEADCal3wKbTCJHZ7qBTxe2zrJPGV9vu6V4+x/MBQq07jd33RrdgI
5R/YSviZLyTjY84xk+XTpxWe6PNxcrNlPrJgqR48UNYiG7rH2VWg073KQZaAEeX4
DRmfANtds9m9N9CadMv1XcHvVkEz+UlD3yYGNwrd1ZnWVBpUobIyZvFrVjpGBtOg
@@ -76,4 +76,4 @@
enableSshSupport = true;
};
};
}
}

View File

@@ -113,49 +113,49 @@ in
# Services
services = {
hyprpolkitagent.enable = true;
hyprpaper = {
enable = true;
settings = {
preload = [ "/run/wallpaper.jpg" ];
wallpaper = [
"DP-1, /run/wallpaper.jpg"
"DP-2, /run/wallpaper.jpg"
];
splash = false;
};
};
hypridle = {
enable = true;
settings = {
general = {
before_sleep_cmd = "loginctl lock-session"; # lock before suspend.
after_sleep_cmd = "hyprctl dispatch dpms on"; # to avoid having to press a key twice to turn on the display.
ignore_dbus_inhibit = false;
lock_cmd = "pidof hyprlock || hyprlock"; # avoid starting multiple hyprlock instances.
hyprpaper = {
enable = true;
settings = {
preload = [ "/run/wallpaper.jpg" ];
wallpaper = [
"DP-1, /run/wallpaper.jpg"
"DP-2, /run/wallpaper.jpg"
];
splash = false;
};
};
hypridle = {
enable = true;
settings = {
general = {
before_sleep_cmd = "loginctl lock-session"; # lock before suspend.
after_sleep_cmd = "hyprctl dispatch dpms on"; # to avoid having to press a key twice to turn on the display.
ignore_dbus_inhibit = false;
lock_cmd = "pidof hyprlock || hyprlock"; # avoid starting multiple hyprlock instances.
};
listener = [
# {
# timeout = 300; # 5min
# on-timeout = "brightnessctl -s set 10"; # set monitor backlight to minimum, avoid 0 on OLED monitor.
# on-resume = "brightnessctl -r"; # monitor backlight restore.
# }
{
timeout = 900; # 15 min
on-timeout = "loginctl lock-session"; # lock screen when timeout has passed
}
{
timeout = 930; # 15.5 min
on-timeout = "hyprctl dispatch dpms off"; # screen off when timeout has passed
on-resume = "hyprctl dispatch dpms on"; # screen on when activity is detected after timeout has fired.
}
{
timeout = 3600; # 1hr
on-timeout = "systemctl suspend"; # suspend pc
}
];
};
listener = [
# {
# timeout = 300; # 5min
# on-timeout = "brightnessctl -s set 10"; # set monitor backlight to minimum, avoid 0 on OLED monitor.
# on-resume = "brightnessctl -r"; # monitor backlight restore.
# }
{
timeout = 900; # 15 min
on-timeout = "loginctl lock-session"; # lock screen when timeout has passed
}
{
timeout = 930; # 15.5 min
on-timeout = "hyprctl dispatch dpms off"; # screen off when timeout has passed
on-resume = "hyprctl dispatch dpms on"; # screen on when activity is detected after timeout has fired.
}
{
timeout = 3600; # 1hr
on-timeout = "systemctl suspend"; # suspend pc
}
];
};
};
};
# Programs

View File

@@ -6,8 +6,6 @@
}:
let
cfg = config.mjallen.sops;
user = config.${namespace}.user.name;
in
{
imports = [ ./options.nix ];

View File

@@ -10,9 +10,9 @@ let
# Create a persistent directory for wallpapers
wallpaperDir = "/var/lib/wallpapers";
# Default fallback wallpaper (included in the system)
defaultWallpaper = pkgs.runCommand "default-wallpaper" {} ''
defaultWallpaper = pkgs.runCommand "default-wallpaper" { } ''
mkdir -p $out
cp ${pkgs.nixos-artwork.wallpapers.nineish-dark-gray}/share/backgrounds/nixos/nix-wallpaper-nineish-dark-gray.png $out/default.jpg
'';
@@ -22,10 +22,10 @@ let
WALLPAPER_DIR="${wallpaperDir}"
IMG_PATH="$WALLPAPER_DIR/current.jpg"
FALLBACK_PATH="$WALLPAPER_DIR/fallback.jpg"
# Ensure directory exists
mkdir -p "$WALLPAPER_DIR"
# Copy to the standard location for other services
ln -sf "$IMG_PATH" /run/wallpaper.jpg
@@ -58,10 +58,10 @@ let
WALLPAPER_DIR="${wallpaperDir}"
IMG_PATH="$WALLPAPER_DIR/current.jpg"
FALLBACK_PATH="$WALLPAPER_DIR/fallback.jpg"
# Ensure directory exists
mkdir -p "$WALLPAPER_DIR"
# Copy to the standard location for other services
ln -sf "$IMG_PATH" /run/wallpaper.jpg
@@ -89,7 +89,6 @@ let
'';
# Select the appropriate wallpaper script based on the configuration
wallpaper-script = if cfg.wallpaperSource == "nasa" then nasa-wallpaper else bing-wallpaper;
sddmThemeName = "sddm-astronaut-theme";
sddmThemePkg = pkgs.sddm-astronaut.override {
@@ -101,22 +100,22 @@ let
# The script to use based on the selected wallpaper source
wallpaper-command = if cfg.wallpaperSource == "nasa" then "nasa-wallpaper" else "bing-wallpaper";
# System activation script to ensure wallpaper is available early in boot
wallpaper-activation-script = ''
# Create wallpaper directory if it doesn't exist
mkdir -p ${wallpaperDir}
# Copy default wallpaper as fallback if it doesn't exist
if [ ! -f ${wallpaperDir}/fallback.jpg ]; then
cp ${defaultWallpaper}/default.jpg ${wallpaperDir}/fallback.jpg
fi
# If no current wallpaper exists, use the fallback
if [ ! -f ${wallpaperDir}/current.jpg ]; then
cp ${wallpaperDir}/fallback.jpg ${wallpaperDir}/current.jpg
fi
# Create symlink for Plymouth and SDDM
ln -sf ${wallpaperDir}/current.jpg /run/wallpaper.jpg
'';
@@ -130,10 +129,10 @@ in
nasa-wallpaper
pkgs.jq
];
# Add system activation script to ensure wallpaper is available early
system.activationScripts.wallpaper = wallpaper-activation-script;
# Configure Plymouth to use the same wallpaper
boot.plymouth = {
enable = true;
@@ -211,22 +210,25 @@ in
TimeoutSec = "10s"; # Limit how long we wait for network
};
};
# Create a service that runs very early in boot to ensure wallpaper is available
early-wallpaper-setup = {
enable = true;
description = "Setup wallpaper early in boot process";
wantedBy = [ "multi-user.target" "plymouth-start.service" ];
wantedBy = [
"multi-user.target"
"plymouth-start.service"
];
before = [ "plymouth-start.service" ];
script = ''
# Ensure wallpaper directory exists
mkdir -p ${wallpaperDir}
# If no current wallpaper exists, use the fallback
if [ ! -f ${wallpaperDir}/current.jpg ]; then
cp ${wallpaperDir}/fallback.jpg ${wallpaperDir}/current.jpg
fi
# Create symlink for Plymouth and SDDM
ln -sf ${wallpaperDir}/current.jpg /run/wallpaper.jpg
'';

View File

@@ -3,9 +3,12 @@ with lib;
{
options.mjallen.desktop.hyprland = {
enable = mkEnableOption "enable hyprland desktop environment";
wallpaperSource = mkOption {
type = types.enum [ "bing" "nasa" ];
type = types.enum [
"bing"
"nasa"
];
default = "bing";
description = "Source for the wallpaper (bing or nasa)";
};

View File

@@ -1,15 +1,13 @@
{ lib, pkgs, ... }:
{ pkgs, ... }:
{
fonts.packages =
with pkgs;
[
font-awesome
noto-fonts
noto-fonts-color-emoji
meslo-lgs-nf
pkgs.nerd-fonts.jetbrains-mono
];
# ++ builtins.filter lib.attrsets.isDerivation (builtins.attrValues pkgs.nerd-fonts); # ALL fonts
fonts.packages = with pkgs; [
font-awesome
noto-fonts
noto-fonts-color-emoji
meslo-lgs-nf
pkgs.nerd-fonts.jetbrains-mono
];
# ++ builtins.filter lib.attrsets.isDerivation (builtins.attrValues pkgs.nerd-fonts); # ALL fonts
fonts.fontconfig.defaultFonts = {
emoji = [

View File

@@ -1,4 +1,9 @@
{ lib, system, pkgs, ... }:
{
lib,
system,
pkgs,
...
}:
let
isArm = "aarch64-linux" == system;
in

View File

@@ -1,7 +1,7 @@
{ lib, namespace, ... }:
with lib;
let
inherit (lib.${namespace}) mkOpt mkBoolOpt;
inherit (lib.${namespace}) mkBoolOpt;
in
{
options.${namespace}.hardware.nvidia = {

View File

@@ -1,4 +1,10 @@
{ config, lib, pkgs, namespace, ... }:
{
config,
lib,
pkgs,
namespace,
...
}:
with lib;
let
cfg = config.${namespace}.services.home-assistant;
@@ -10,6 +16,8 @@ in
openFirewall = true;
configDir = "/var/lib/homeassistant";
configWritable = true; # todo
# All components
# extraComponents = config.services.home-assistant.package.availableComponents;
extraComponents = [
"adguard"
"apple_tv"
@@ -267,4 +275,4 @@ in
};
};
};
}
}

View File

@@ -1,4 +1,9 @@
{ config, lib, namespace, ... }:
{
config,
lib,
namespace,
...
}:
with lib;
let
cfg = config.${namespace}.services.home-assistant;
@@ -65,4 +70,4 @@ in
StateDirectory = "music-assistant";
};
};
}
}

View File

@@ -1,4 +1,9 @@
{ config, lib, namespace, ... }:
{
config,
lib,
namespace,
...
}:
with lib;
let
cfg = config.${namespace}.services.home-assistant;
@@ -58,4 +63,4 @@ in
};
};
};
}
}

View File

@@ -1,4 +1,9 @@
{ config, lib, namespace, ... }:
{
config,
lib,
namespace,
...
}:
{
nix = {
settings = {
@@ -10,7 +15,7 @@
"https://cache.nixos.org/"
];
trusted-public-keys = [
"nixos-raspberrypi.cachix.org-1:4iMO9LXa8BqhU+Rpg6LQKiGa2lsNh/j2oiYLNOQ5sPI="
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
];
@@ -32,7 +37,7 @@
nixpkgs = {
config = {
allowUnfree = lib.mkForce true;
cudaSupport =lib.mkDefault config.${namespace}.hardware.nvidia.enable;
cudaSupport = lib.mkDefault config.${namespace}.hardware.nvidia.enable;
allowUnsupportedSystem = true;
permittedInsecurePackages = [
# ...

View File

@@ -1,7 +1,7 @@
{ lib, namespace, ... }:
let
inherit (lib.mjallen) mkOpt mkBoolOpt;
in
in
with lib;
{
options.${namespace}.services.actual = {

View File

@@ -1,4 +1,9 @@
{ config, lib, namespace, ... }:
{
config,
lib,
namespace,
...
}:
with lib;
let
# inherit (lib.${namespace}) mkModule mkOpt mkBoolOpt enableForSystem;

View File

@@ -20,4 +20,4 @@
};
jvmOpts = "-Xms4092M -Xmx4092M -XX:+UseG1GC -XX:ParallelGCThreads=2 -XX:MinHeapFreeRatio=5 -XX:MaxHeapFreeRatio=10";
};
}
}

View File

@@ -2,27 +2,27 @@
with lib;
let
cfg = config.nas-samba;
sambaShares =
let
make =
name: share:
nameValuePair "${name}" {
path = share.sharePath;
public = if share.enableTimeMachine then "no" else "yes";
browseable = if share.browseable then "yes" else "no";
writable = "yes";
"force group" = "jallen-nas";
"read only" = if share.readOnly then "yes" else "no";
"guest ok" = if share.guestOk then "yes" else "no";
"create mask" = share.createMask;
"directory mask" = share.directoryMask;
"fruit:aapl" = if share.enableTimeMachine then "yes" else "no";
"fruit:time machine" = if share.enableTimeMachine then "yes" else "no";
"vfs objects" = "catia fruit streams_xattr";
"fruit:time machine max size" = share.timeMachineMaxSize;
};
in
mapAttrs' make cfg.shares;
sambaShares =
let
make =
name: share:
nameValuePair "${name}" {
path = share.sharePath;
public = if share.enableTimeMachine then "no" else "yes";
browseable = if share.browseable then "yes" else "no";
writable = "yes";
"force group" = "jallen-nas";
"read only" = if share.readOnly then "yes" else "no";
"guest ok" = if share.guestOk then "yes" else "no";
"create mask" = share.createMask;
"directory mask" = share.directoryMask;
"fruit:aapl" = if share.enableTimeMachine then "yes" else "no";
"fruit:time machine" = if share.enableTimeMachine then "yes" else "no";
"vfs objects" = "catia fruit streams_xattr";
"fruit:time machine max size" = share.timeMachineMaxSize;
};
in
mapAttrs' make cfg.shares;
in
{
imports = [ ./options.nix ];
@@ -67,7 +67,8 @@ in
"guest account" = "nobody";
"map to guest" = "bad user";
};
} // sambaShares;
}
// sambaShares;
};
};
}

View File

@@ -74,16 +74,16 @@ in
restartUnits = [ "traefik.service" ];
};
"jallen-nas/traefik/cloudflare-dns-api-token" = {
sopsFile = (lib.snowfall.fs.get-file "secrets/nas-secrets.yaml");
sopsFile = (lib.snowfall.fs.get-file "secrets/nas-secrets.yaml");
};
"jallen-nas/traefik/cloudflare-zone-api-token" = {
sopsFile = (lib.snowfall.fs.get-file "secrets/nas-secrets.yaml");
sopsFile = (lib.snowfall.fs.get-file "secrets/nas-secrets.yaml");
};
"jallen-nas/traefik/cloudflare-api-key" = {
sopsFile = (lib.snowfall.fs.get-file "secrets/nas-secrets.yaml");
sopsFile = (lib.snowfall.fs.get-file "secrets/nas-secrets.yaml");
};
"jallen-nas/traefik/cloudflare-email" = {
sopsFile = (lib.snowfall.fs.get-file "secrets/nas-secrets.yaml");
sopsFile = (lib.snowfall.fs.get-file "secrets/nas-secrets.yaml");
};
};
templates = {

View File

@@ -1,4 +1,10 @@
{ config, lib, system, namespace, ... }:
{
config,
lib,
system,
namespace,
...
}:
let
defaultSops = (lib.snowfall.fs.get-file "secrets/secrets.yaml");
isx86 = system == "x86_64-linux";

View File

@@ -5,37 +5,40 @@ let
in
{
environment.systemPackages = with pkgs; [
nil
qemu
udisks2
unzip
] ++
(if isArm then
[ ]
else
[
acpilight
aha
aspell
aspellDicts.en
aspellDicts.en-computers
aspellDicts.en-science
brightnessctl
ddcui
ddcutil
ddccontrol
ddccontrol-db
efibootmgr
memtest86-efi
memtest86plus
os-prober
sbctl
tpm2-tools
tpm2-tss
winetricks
environment.systemPackages =
with pkgs;
[
nil
qemu
udisks2
unzip
]
);
++ (
if isArm then
[ ]
else
[
acpilight
aha
aspell
aspellDicts.en
aspellDicts.en-computers
aspellDicts.en-science
brightnessctl
ddcui
ddcutil
ddccontrol
ddccontrol-db
efibootmgr
memtest86-efi
memtest86plus
os-prober
sbctl
tpm2-tools
tpm2-tss
winetricks
]
);
# Time config
time = {

View File

@@ -52,7 +52,9 @@ in
hashedPassword = mkOpt (nullOr str) null "Hashed password for the user.";
hashedPasswordFile = mkOpt (nullOr path) defaultPasswordFile "Path to the password file for this user account";
hashedPasswordFile =
mkOpt (nullOr path) defaultPasswordFile
"Path to the password file for this user account";
mutableUsers = mkBoolOpt false "Whether users are mutable (can be modified after creation).";
};
@@ -104,20 +106,29 @@ in
assertions = [
{
assertion = (cfg.password != null) || (cfg.hashedPassword != null) || (cfg.hashedPasswordFile != null);
assertion =
(cfg.password != null) || (cfg.hashedPassword != null) || (cfg.hashedPasswordFile != null);
message = "User '${cfg.name}' requires at least one password method (password, hashedPassword, or hashedPasswordFile).";
}
{
assertion =
assertion =
let
passwordMethods = lib.count (x: x != null) [ cfg.password cfg.hashedPassword cfg.hashedPasswordFile ];
passwordMethods = lib.count (x: x != null) [
cfg.password
cfg.hashedPassword
cfg.hashedPasswordFile
];
in
passwordMethods <= 1;
message = "User '${cfg.name}' can only use one password method at a time. Found multiple: ${lib.concatStringsSep ", " (lib.filter (x: x != null) [
(if cfg.password != null then "password" else null)
(if cfg.hashedPassword != null then "hashedPassword" else null)
(if cfg.hashedPasswordFile != null then "hashedPasswordFile" else null)
])}";
message = "User '${cfg.name}' can only use one password method at a time. Found multiple: ${
lib.concatStringsSep ", " (
lib.filter (x: x != null) [
(if cfg.password != null then "password" else null)
(if cfg.hashedPassword != null then "hashedPassword" else null)
(if cfg.hashedPasswordFile != null then "hashedPasswordFile" else null)
]
)
}";
}
];
};

View File

@@ -6,4 +6,4 @@
podman.enable = lib.mkDefault true;
waydroid.enable = lib.mkDefault true;
};
}
}