2024-04-20 09:42:06 -04:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
pkgs,
|
|
|
|
...
|
|
|
|
}:
|
|
|
|
{
|
2022-05-01 23:39:50 -04:00
|
|
|
|
2024-04-20 09:42:06 -04:00
|
|
|
imports = [
|
|
|
|
./applications
|
|
|
|
./mail
|
|
|
|
./neovim
|
|
|
|
./programming
|
|
|
|
./repositories
|
|
|
|
./shell
|
|
|
|
];
|
2022-05-01 23:39:50 -04:00
|
|
|
|
2022-12-13 21:02:42 -07:00
|
|
|
options = {
|
2022-11-02 21:29:14 -04:00
|
|
|
user = lib.mkOption {
|
|
|
|
type = lib.types.str;
|
2022-06-19 23:44:29 -04:00
|
|
|
description = "Primary user of the system";
|
|
|
|
};
|
2022-09-09 22:16:45 -04:00
|
|
|
fullName = lib.mkOption {
|
|
|
|
type = lib.types.str;
|
|
|
|
description = "Human readable name of the user";
|
|
|
|
};
|
2022-06-19 23:44:29 -04:00
|
|
|
userDirs = {
|
|
|
|
# Required to prevent infinite recursion when referenced by himalaya
|
|
|
|
download = lib.mkOption {
|
|
|
|
type = lib.types.str;
|
|
|
|
description = "XDG directory for downloads";
|
2024-04-20 09:42:06 -04:00
|
|
|
default = if pkgs.stdenv.isDarwin then "$HOME/Downloads" else "$HOME/downloads";
|
2022-06-19 23:44:29 -04:00
|
|
|
};
|
|
|
|
};
|
2022-10-16 14:20:50 +00:00
|
|
|
identityFile = lib.mkOption {
|
|
|
|
type = lib.types.str;
|
2022-10-28 23:58:33 -04:00
|
|
|
description = "Path to existing private key file.";
|
2022-10-16 14:20:50 +00:00
|
|
|
default = "/etc/ssh/ssh_host_ed25519_key";
|
|
|
|
};
|
2025-02-05 17:25:29 -05:00
|
|
|
# homePath = lib.mkOption {
|
|
|
|
# type = lib.types.path;
|
|
|
|
# description = "Path of user's home directory.";
|
|
|
|
# default = builtins.toPath (
|
|
|
|
# if pkgs.stdenv.isDarwin then "/Users/${config.user}" else "/home/${config.user}"
|
|
|
|
# );
|
|
|
|
# };
|
|
|
|
# dotfilesPath = lib.mkOption {
|
|
|
|
# type = lib.types.path;
|
|
|
|
# description = "Path of dotfiles repository.";
|
|
|
|
# default = config.homePath + "/dev/personal/dotfiles";
|
|
|
|
# };
|
|
|
|
# dotfilesRepo = lib.mkOption {
|
|
|
|
# type = lib.types.str;
|
|
|
|
# description = "Link to dotfiles repository HTTPS URL.";
|
|
|
|
# };
|
2022-11-02 21:29:14 -04:00
|
|
|
unfreePackages = lib.mkOption {
|
|
|
|
type = lib.types.listOf lib.types.str;
|
2022-06-04 21:08:09 -04:00
|
|
|
description = "List of unfree packages to allow.";
|
|
|
|
default = [ ];
|
|
|
|
};
|
2024-12-07 20:19:03 -05:00
|
|
|
insecurePackages = lib.mkOption {
|
|
|
|
type = lib.types.listOf lib.types.str;
|
|
|
|
description = "List of insecure packages to allow.";
|
|
|
|
default = [ ];
|
|
|
|
};
|
2025-02-05 17:25:29 -05:00
|
|
|
# hostnames = {
|
|
|
|
# audiobooks = lib.mkOption {
|
|
|
|
# type = lib.types.str;
|
|
|
|
# description = "Hostname for audiobook server (Audiobookshelf).";
|
|
|
|
# };
|
|
|
|
# budget = lib.mkOption {
|
|
|
|
# type = lib.types.str;
|
|
|
|
# description = "Hostname for budgeting server (ActualBudget).";
|
|
|
|
# };
|
|
|
|
# files = lib.mkOption {
|
|
|
|
# type = lib.types.str;
|
|
|
|
# description = "Hostname for files server (Filebrowser).";
|
|
|
|
# };
|
|
|
|
# git = lib.mkOption {
|
|
|
|
# type = lib.types.str;
|
|
|
|
# description = "Hostname for git server (Gitea).";
|
|
|
|
# };
|
|
|
|
# metrics = lib.mkOption {
|
|
|
|
# type = lib.types.str;
|
|
|
|
# description = "Hostname for metrics server.";
|
|
|
|
# };
|
|
|
|
# minecraft = lib.mkOption {
|
|
|
|
# type = lib.types.str;
|
|
|
|
# description = "Hostname for Minecraft server.";
|
|
|
|
# };
|
|
|
|
# paperless = lib.mkOption {
|
|
|
|
# type = lib.types.str;
|
|
|
|
# description = "Hostname for document server (paperless-ngx).";
|
|
|
|
# };
|
|
|
|
# photos = lib.mkOption {
|
|
|
|
# type = lib.types.str;
|
|
|
|
# description = "Hostname for photo management (Immich).";
|
|
|
|
# };
|
|
|
|
# prometheus = lib.mkOption {
|
|
|
|
# type = lib.types.str;
|
|
|
|
# description = "Hostname for Prometheus server.";
|
|
|
|
# };
|
|
|
|
# influxdb = lib.mkOption {
|
|
|
|
# type = lib.types.str;
|
|
|
|
# description = "Hostname for InfluxDB2 server.";
|
|
|
|
# };
|
|
|
|
# secrets = lib.mkOption {
|
|
|
|
# type = lib.types.str;
|
|
|
|
# description = "Hostname for passwords and secrets (Vaultwarden).";
|
|
|
|
# };
|
|
|
|
# stream = lib.mkOption {
|
|
|
|
# type = lib.types.str;
|
|
|
|
# description = "Hostname for video/media library (Jellyfin).";
|
|
|
|
# };
|
|
|
|
# content = lib.mkOption {
|
|
|
|
# type = lib.types.str;
|
|
|
|
# description = "Hostname for personal content system (Nextcloud).";
|
|
|
|
# };
|
|
|
|
# books = lib.mkOption {
|
|
|
|
# type = lib.types.str;
|
|
|
|
# description = "Hostname for books library (Calibre-Web).";
|
|
|
|
# };
|
|
|
|
# download = lib.mkOption {
|
|
|
|
# type = lib.types.str;
|
|
|
|
# description = "Hostname for download services.";
|
|
|
|
# };
|
|
|
|
# irc = lib.mkOption {
|
|
|
|
# type = lib.types.str;
|
|
|
|
# description = "Hostname for IRC services.";
|
|
|
|
# };
|
|
|
|
# n8n = lib.mkOption {
|
|
|
|
# type = lib.types.str;
|
|
|
|
# description = "Hostname for n8n automation.";
|
|
|
|
# };
|
|
|
|
# notifications = lib.mkOption {
|
|
|
|
# type = lib.types.str;
|
|
|
|
# description = "Hostname for push notification services (ntfy).";
|
|
|
|
# };
|
|
|
|
# status = lib.mkOption {
|
|
|
|
# type = lib.types.str;
|
|
|
|
# description = "Hostname for status page (Uptime-Kuma).";
|
|
|
|
# };
|
|
|
|
# transmission = lib.mkOption {
|
|
|
|
# type = lib.types.str;
|
|
|
|
# description = "Hostname for peer2peer downloads (Transmission).";
|
|
|
|
# };
|
|
|
|
# };
|
2022-05-29 13:44:45 -04:00
|
|
|
};
|
|
|
|
|
2024-04-20 09:42:06 -04:00
|
|
|
config =
|
|
|
|
let
|
|
|
|
stateVersion = "23.05";
|
|
|
|
in
|
|
|
|
{
|
2022-05-01 23:39:50 -04:00
|
|
|
|
2024-04-20 09:42:06 -04:00
|
|
|
# Allow specified unfree packages (identified elsewhere)
|
|
|
|
# Retrieves package object based on string name
|
|
|
|
nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) config.unfreePackages;
|
2022-05-01 23:39:50 -04:00
|
|
|
|
2024-12-07 20:19:03 -05:00
|
|
|
# Allow specified insecure packages (identified elsewhere)
|
|
|
|
nixpkgs.config.permittedInsecurePackages = config.insecurePackages;
|
|
|
|
|
2024-04-20 09:42:06 -04:00
|
|
|
# Pin a state version to prevent warnings
|
|
|
|
home-manager.users.${config.user}.home.stateVersion = stateVersion;
|
|
|
|
home-manager.users.root.home.stateVersion = stateVersion;
|
|
|
|
};
|
2022-05-01 23:39:50 -04:00
|
|
|
}
|