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

@@ -51,7 +51,7 @@ rec {
localAddress ? "127.0.0.1", localAddress ? "127.0.0.1",
port ? "80", port ? "80",
bindMounts ? { }, bindMounts ? { },
config ? { } config ? { },
}: }:
{ lib, ... }: { lib, ... }:
{ {

View File

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

View File

@@ -12,7 +12,7 @@ let
wallpaperDir = "/var/lib/wallpapers"; wallpaperDir = "/var/lib/wallpapers";
# Default fallback wallpaper (included in the system) # Default fallback wallpaper (included in the system)
defaultWallpaper = pkgs.runCommand "default-wallpaper" {} '' defaultWallpaper = pkgs.runCommand "default-wallpaper" { } ''
mkdir -p $out mkdir -p $out
cp ${pkgs.nixos-artwork.wallpapers.nineish-dark-gray}/share/backgrounds/nixos/nix-wallpaper-nineish-dark-gray.png $out/default.jpg cp ${pkgs.nixos-artwork.wallpapers.nineish-dark-gray}/share/backgrounds/nixos/nix-wallpaper-nineish-dark-gray.png $out/default.jpg
''; '';
@@ -89,7 +89,6 @@ let
''; '';
# Select the appropriate wallpaper script based on the configuration # 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"; sddmThemeName = "sddm-astronaut-theme";
sddmThemePkg = pkgs.sddm-astronaut.override { sddmThemePkg = pkgs.sddm-astronaut.override {
@@ -216,7 +215,10 @@ in
early-wallpaper-setup = { early-wallpaper-setup = {
enable = true; enable = true;
description = "Setup wallpaper early in boot process"; 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" ]; before = [ "plymouth-start.service" ];
script = '' script = ''
# Ensure wallpaper directory exists # Ensure wallpaper directory exists

View File

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

View File

@@ -1,8 +1,6 @@
{ lib, pkgs, ... }: { pkgs, ... }:
{ {
fonts.packages = fonts.packages = with pkgs; [
with pkgs;
[
font-awesome font-awesome
noto-fonts noto-fonts
noto-fonts-color-emoji noto-fonts-color-emoji

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -1,4 +1,9 @@
{ config, lib, namespace, ... }: {
config,
lib,
namespace,
...
}:
{ {
nix = { nix = {
settings = { settings = {
@@ -32,7 +37,7 @@
nixpkgs = { nixpkgs = {
config = { config = {
allowUnfree = lib.mkForce true; allowUnfree = lib.mkForce true;
cudaSupport =lib.mkDefault config.${namespace}.hardware.nvidia.enable; cudaSupport = lib.mkDefault config.${namespace}.hardware.nvidia.enable;
allowUnsupportedSystem = true; allowUnsupportedSystem = true;
permittedInsecurePackages = [ permittedInsecurePackages = [
# ... # ...

View File

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

View File

@@ -67,7 +67,8 @@ in
"guest account" = "nobody"; "guest account" = "nobody";
"map to guest" = "bad user"; "map to guest" = "bad user";
}; };
} // sambaShares; }
// sambaShares;
}; };
}; };
} }

View File

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

View File

@@ -5,13 +5,16 @@ let
in in
{ {
environment.systemPackages = with pkgs; [ environment.systemPackages =
with pkgs;
[
nil nil
qemu qemu
udisks2 udisks2
unzip unzip
] ++ ]
(if isArm then ++ (
if isArm then
[ ] [ ]
else else
[ [

View File

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

View File

@@ -1,4 +1,4 @@
with import <nixpkgs> {}; with import <nixpkgs> { };
writeShellApplication { writeShellApplication {
name = "test-image"; name = "test-image";

View File

@@ -3,7 +3,6 @@
# https://search.nixos.org/options and in the NixOS manual (`nixos-help`). # https://search.nixos.org/options and in the NixOS manual (`nixos-help`).
{ {
config,
namespace, namespace,
... ...
}: }:

View File

@@ -3,7 +3,6 @@
# https://search.nixos.org/options and in the NixOS manual (`nixos-help`). # https://search.nixos.org/options and in the NixOS manual (`nixos-help`).
{ {
config,
namespace, namespace,
... ...
}: }:

View File

@@ -1,4 +1,9 @@
{ config, lib, namespace, ... }: {
config,
lib,
namespace,
...
}:
let let
user = config.${namespace}.user.name; user = config.${namespace}.user.name;
desktopSopsFile = (lib.snowfall.fs.get-file "secrets/desktop-secrets.yaml"); desktopSopsFile = (lib.snowfall.fs.get-file "secrets/desktop-secrets.yaml");

View File

@@ -0,0 +1,79 @@
# 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,
modulesPath,
...
}:
{
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [
"xhci_pci"
"nvme"
"ahci"
"usbhid"
"uas"
];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ];
fileSystems."/" = lib.mkForce {
device = "none";
fsType = "tmpfs";
options = [ "mode=755" ];
};
fileSystems."/boot" = lib.mkForce {
device = "UUID=0FCB-EC63"; # "/dev/disk/by-partlabel/disk-main-ESP";
fsType = "vfat";
options = [
"fmask=0022"
"dmask=0022"
];
};
fileSystems."/var/log" = lib.mkForce {
device = "UUID=88d9c058-757d-c06e-0fb7-a612f2db8a7a"; # "/dev/disk/by-partlabel/disk-main-root";
fsType = "bcachefs";
options = [ "X-mount.subdir=log" ];
};
fileSystems."/root" = lib.mkForce {
device = lib.mkDefault "UUID=88d9c058-757d-c06e-0fb7-a612f2db8a7a"; # "/dev/disk/by-partlabel/disk-main-root";
fsType = "bcachefs";
options = [ "X-mount.subdir=root" ];
};
fileSystems."/etc" = lib.mkForce {
device = lib.mkDefault "UUID=88d9c058-757d-c06e-0fb7-a612f2db8a7a"; # "/dev/disk/by-partlabel/disk-main-root";
fsType = "bcachefs";
options = [ "X-mount.subdir=etc" ];
};
fileSystems."/nix" = lib.mkForce {
device = lib.mkDefault "UUID=88d9c058-757d-c06e-0fb7-a612f2db8a7a"; # "/dev/disk/by-partlabel/disk-main-root";
fsType = "bcachefs";
options = [
"X-mount.subdir=nix"
"verbose"
];
};
fileSystems."/home" = lib.mkForce {
device = lib.mkDefault "UUID=88d9c058-757d-c06e-0fb7-a612f2db8a7a"; # "/dev/disk/by-partlabel/disk-main-root";
fsType = "bcachefs";
options = [ "X-mount.subdir=home" ];
};
swapDevices = [ ];
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

View File

@@ -1,8 +1,4 @@
{ lib, ... }: { lib, ... }:
let
defaultSops = (lib.snowfall.fs.get-file "secrets/nuc-secrets.yaml");
sharedSops = (lib.snowfall.fs.get-file "secrets/secrets.yaml");
in
{ {
# Permission modes are in octal representation (same as chmod), # Permission modes are in octal representation (same as chmod),
# the digits represent: user|group|others # the digits represent: user|group|others

View File

@@ -1,63 +0,0 @@
# 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" "nvme" "ahci" "usbhid" "uas" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ];
fileSystems."/" = lib.mkForce
{ device = "none";
fsType = "tmpfs";
options = [ "mode=755" ];
};
fileSystems."/boot" = lib.mkForce
{ device = "UUID=0FCB-EC63"; # "/dev/disk/by-partlabel/disk-main-ESP";
fsType = "vfat";
options = [ "fmask=0022" "dmask=0022" ];
};
fileSystems."/var/log" = lib.mkForce
{ device = "UUID=88d9c058-757d-c06e-0fb7-a612f2db8a7a"; # "/dev/disk/by-partlabel/disk-main-root";
fsType = "bcachefs";
options = [ "X-mount.subdir=log" ];
};
fileSystems."/root" = lib.mkForce
{ device = lib.mkDefault "UUID=88d9c058-757d-c06e-0fb7-a612f2db8a7a"; # "/dev/disk/by-partlabel/disk-main-root";
fsType = "bcachefs";
options = [ "X-mount.subdir=root" ];
};
fileSystems."/etc" = lib.mkForce
{ device = lib.mkDefault "UUID=88d9c058-757d-c06e-0fb7-a612f2db8a7a"; # "/dev/disk/by-partlabel/disk-main-root";
fsType = "bcachefs";
options = [ "X-mount.subdir=etc" ];
};
fileSystems."/nix" = lib.mkForce
{ device = lib.mkDefault "UUID=88d9c058-757d-c06e-0fb7-a612f2db8a7a"; # "/dev/disk/by-partlabel/disk-main-root";
fsType = "bcachefs";
options = [ "X-mount.subdir=nix" "verbose" ];
};
fileSystems."/home" = lib.mkForce
{ device = lib.mkDefault "UUID=88d9c058-757d-c06e-0fb7-a612f2db8a7a"; # "/dev/disk/by-partlabel/disk-main-root";
fsType = "bcachefs";
options = [ "X-mount.subdir=home" ];
};
swapDevices =
[ ];
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}