Const: Move to module.

This commit is contained in:
Dmitry Voronin 2025-01-16 12:50:27 +03:00
parent 19d2b60de0
commit e5fa034eed
Signed by: voronind
SSH key fingerprint: SHA256:3kBb4iV2ahufEBNq+vFbUe4QYfHt98DHQjN7QaptY9k
31 changed files with 33 additions and 33 deletions

View file

@ -39,7 +39,7 @@ in
script = '' script = ''
pushd /tmp pushd /tmp
rm -rf ./nixos rm -rf ./nixos
git clone --depth=1 --single-branch --branch=main ${config.const.url} ./nixos git clone --depth=1 --single-branch --branch=main ${config.module.const.url} ./nixos
pushd ./nixos pushd ./nixos
git verify-commit HEAD && git fsck || { git verify-commit HEAD && git fsck || {
echo "Verification failed." echo "Verification failed."

View file

@ -27,8 +27,8 @@ in
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
environment.packages = package.core; environment.packages = package.core;
nix.extraOptions = "experimental-features = nix-command flakes pipe-operators"; nix.extraOptions = "experimental-features = nix-command flakes pipe-operators";
system.stateVersion = config.const.droidStateVersion; system.stateVersion = config.module.const.droidStateVersion;
time.timeZone = config.const.timeZone; time.timeZone = config.module.const.timeZone;
terminal = { inherit (android) font colors; }; terminal = { inherit (android) font colors; };
home-manager.config = stylix // { home-manager.config = stylix // {
programs = with programs; core; programs = with programs; core;
@ -36,7 +36,7 @@ in
home = { home = {
inherit (env) sessionVariables; inherit (env) sessionVariables;
inherit file; inherit file;
stateVersion = config.const.droidStateVersion; stateVersion = config.module.const.droidStateVersion;
}; };
}; };
}; };

View file

@ -39,7 +39,7 @@ in
programs = with program; core // desktop; programs = with program; core // desktop;
xdg = import ./xdg { inherit (user) homeDirectory; }; xdg = import ./xdg { inherit (user) homeDirectory; };
home = { home = {
inherit (config.const) stateVersion; inherit (config.module.const) stateVersion;
inherit (env) sessionVariables; inherit (env) sessionVariables;
inherit (user) username homeDirectory; inherit (user) username homeDirectory;
inherit file; inherit file;

View file

@ -1,6 +1,6 @@
{ ... }: { ... }:
{ {
config.const.host = { config.module.const.host = {
nginx = { nginx = {
domain = "voronind.com"; domain = "voronind.com";
sslCertificate = "/etc/letsencrypt/live/voronind.com/fullchain.pem"; sslCertificate = "/etc/letsencrypt/live/voronind.com/fullchain.pem";

View file

@ -120,7 +120,7 @@ in
PoolOffset = 100; PoolOffset = 100;
PoolSize = 150; PoolSize = 150;
ServerAddress = "${internal}/24"; ServerAddress = "${internal}/24";
Timezone = config.const.timeZone; Timezone = config.module.const.timeZone;
UplinkInterface = wan; UplinkInterface = wan;
}; };
}; };

View file

@ -1,6 +1,6 @@
{ config, ... }: { config, ... }:
let let
cfg = config.const.host.nginx; cfg = config.module.const.host.nginx;
in in
{ {
"camera.${cfg.domain}" = { "camera.${cfg.domain}" = {

View file

@ -1,6 +1,6 @@
{ config, ... }: { config, ... }:
let let
cfg = config.const.host.nginx; cfg = config.module.const.host.nginx;
in in
{ {
"change.${cfg.domain}" = { "change.${cfg.domain}" = {

View file

@ -1,6 +1,6 @@
{ config, ... }: { config, ... }:
let let
cfg = config.const.host.nginx; cfg = config.module.const.host.nginx;
in in
{ {
"print.${cfg.domain}" = { "print.${cfg.domain}" = {

View file

@ -1,6 +1,6 @@
{ config, ... }: { config, ... }:
let let
cfg = config.const.host.nginx; cfg = config.module.const.host.nginx;
in in
{ {
"dav.${cfg.domain}" = { "dav.${cfg.domain}" = {

View file

@ -1,6 +1,6 @@
{ config, ... }: { config, ... }:
let let
cfg = config.const.host.nginx; cfg = config.module.const.host.nginx;
in in
{ {
"download.${cfg.domain}" = { "download.${cfg.domain}" = {

View file

@ -1,6 +1,6 @@
{ config, ... }: { config, ... }:
let let
cfg = config.const.host.nginx; cfg = config.module.const.host.nginx;
in in
{ {
"git.${cfg.domain}" = { "git.${cfg.domain}" = {

View file

@ -1,6 +1,6 @@
{ config, ... }: { config, ... }:
let let
cfg = config.const.host.nginx; cfg = config.module.const.host.nginx;
in in
{ {
"iot.${cfg.domain}" = { "iot.${cfg.domain}" = {

View file

@ -1,6 +1,6 @@
{ config, ... }: { config, ... }:
let let
cfg = config.const.host.nginx; cfg = config.module.const.host.nginx;
in in
{ {
"home.${cfg.domain}" = { "home.${cfg.domain}" = {

View file

@ -1,6 +1,6 @@
{ config, ... }: { config, ... }:
let let
cfg = config.const.host.nginx; cfg = config.module.const.host.nginx;
in in
{ {
"yt.${cfg.domain}" = { "yt.${cfg.domain}" = {

View file

@ -1,6 +1,6 @@
{ config, ... }: { config, ... }:
let let
cfg = config.const.host.nginx; cfg = config.module.const.host.nginx;
in in
{ {
"watch.${cfg.domain}" = { "watch.${cfg.domain}" = {

View file

@ -1,6 +1,6 @@
{ config, ... }: { config, ... }:
let let
cfg = config.const.host.nginx; cfg = config.module.const.host.nginx;
in in
{ {
"read.${cfg.domain}" = { "read.${cfg.domain}" = {

View file

@ -1,6 +1,6 @@
{ config, lib, ... }: { config, lib, ... }:
let let
cfg = config.const.host.nginx; cfg = config.module.const.host.nginx;
in in
{ {
"mail.${cfg.domain}" = { "mail.${cfg.domain}" = {

View file

@ -1,6 +1,6 @@
{ config, ... }: { config, ... }:
let let
cfg = config.const.host.nginx; cfg = config.module.const.host.nginx;
in in
{ {
"paper.${cfg.domain}" = { "paper.${cfg.domain}" = {

View file

@ -1,6 +1,6 @@
{ config, ... }: { config, ... }:
let let
cfg = config.const.host.nginx; cfg = config.module.const.host.nginx;
in in
{ {
"printer.${cfg.domain}" = { "printer.${cfg.domain}" = {

View file

@ -1,6 +1,6 @@
{ config, ... }: { config, ... }:
let let
cfg = config.const.host.nginx; cfg = config.module.const.host.nginx;
in in
{ {
"paste.${cfg.domain}" = { "paste.${cfg.domain}" = {

View file

@ -1,6 +1,6 @@
{ config, ... }: { config, ... }:
let let
cfg = config.const.host.nginx; cfg = config.module.const.host.nginx;
in in
{ {
"resume.${cfg.domain}" = { "resume.${cfg.domain}" = {

View file

@ -1,6 +1,6 @@
{ config, ... }: { config, ... }:
let let
cfg = config.const.host.nginx; cfg = config.module.const.host.nginx;
in in
{ {
"router.${cfg.domain}" = { "router.${cfg.domain}" = {

View file

@ -1,6 +1,6 @@
{ config, ... }: { config, ... }:
let let
cfg = config.const.host.nginx; cfg = config.module.const.host.nginx;
in in
{ {
"search.${cfg.domain}" = { "search.${cfg.domain}" = {

View file

@ -1,6 +1,6 @@
{ config, ... }: { config, ... }:
let let
cfg = config.const.host.nginx; cfg = config.module.const.host.nginx;
root = "/storage/hot/share"; root = "/storage/hot/share";
index = '' index = ''
autoindex on; autoindex on;

View file

@ -1,6 +1,6 @@
{ config, ... }: { config, ... }:
let let
cfg = config.const.host.nginx; cfg = config.module.const.host.nginx;
in in
{ {
"sync.${cfg.domain}" = { "sync.${cfg.domain}" = {

View file

@ -1,6 +1,6 @@
{ config, ... }: { config, ... }:
let let
cfg = config.const.host.nginx; cfg = config.module.const.host.nginx;
in in
{ {
"craft.${cfg.domain}" = { "craft.${cfg.domain}" = {

View file

@ -1,6 +1,6 @@
{ config, ... }: { config, ... }:
let let
cfg = config.const.host.nginx; cfg = config.module.const.host.nginx;
in in
{ {
"status.${cfg.domain}" = { "status.${cfg.domain}" = {

View file

@ -1,6 +1,6 @@
{ config, ... }: { config, ... }:
let let
cfg = config.const.host.nginx; cfg = config.module.const.host.nginx;
in in
{ {
"pass.${cfg.domain}" = { "pass.${cfg.domain}" = {

View file

@ -1,6 +1,6 @@
{ lib, ... }: { lib, ... }:
{ {
options.const = { options.module.const = {
droidStateVersion = lib.mkOption { droidStateVersion = lib.mkOption {
default = "24.05"; default = "24.05";
type = lib.types.str; type = lib.types.str;

View file

@ -1,6 +1,6 @@
{ config, ... }: { config, ... }:
{ {
time.timeZone = config.const.timeZone; time.timeZone = config.module.const.timeZone;
i18n = { i18n = {
defaultLocale = "en_US.UTF-8"; defaultLocale = "en_US.UTF-8";
extraLocaleSettings = { extraLocaleSettings = {

View file

@ -1,5 +1,5 @@
{ config, ... }: { config, ... }:
{ {
# Specify current release version. # Specify current release version.
system.stateVersion = config.const.stateVersion; system.stateVersion = config.module.const.stateVersion;
} }