Simplify system and home options
This commit is contained in:
parent
ac22bc1849
commit
72ec65064d
|
@ -16,6 +16,7 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
system = {
|
system = {
|
||||||
|
desktop.enable = true;
|
||||||
lanzaboote.enable = true;
|
lanzaboote.enable = true;
|
||||||
wireguard.client.enable = true;
|
wireguard.client.enable = true;
|
||||||
libvirtd.enable = true;
|
libvirtd.enable = true;
|
||||||
|
|
|
@ -62,18 +62,14 @@
|
||||||
mountOptions = [ "compress=zstd" "noatime" "ssd" ];
|
mountOptions = [ "compress=zstd" "noatime" "ssd" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
# Impermanence
|
# Impermanence
|
||||||
"/persist" = {
|
"/persist" = {
|
||||||
mountpoint = "/persist";
|
mountpoint = "/persist";
|
||||||
mountOptions = [ "compress=zstd" "noatime" "ssd" ];
|
mountOptions = [ "compress=zstd" "noatime" "ssd" ];
|
||||||
};
|
};
|
||||||
"/persist/.snapshots" = { };
|
"/persist/.snapshots" = { };
|
||||||
|
"/persist/home/${config.sysusers.main}" = { };
|
||||||
"${config.sysusers.main}" = {
|
"/persist/home/${config.sysusers.main}/.snapshots" = { };
|
||||||
mountpoint = "/persist/home/${config.sysusers.main}";
|
|
||||||
mountOptions = [ "compress=zstd" "noatime" "ssd" ];
|
|
||||||
};
|
|
||||||
"/${config.sysusers.main}/.snapshots" = { };
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -90,8 +86,5 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
# Needed for impermanence
|
# Needed for impermanence
|
||||||
fileSystems = {
|
fileSystems."/persist".neededForBoot = true;
|
||||||
"/persist".neededForBoot = true;
|
|
||||||
"/persist/home/${config.sysusers.main}".neededForBoot = true;
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
{ config, lib, ... }:
|
{ config, lib, ... }:
|
||||||
{
|
{
|
||||||
home-manager.users."${config.sysusers.main}" = {
|
home-manager.users."${config.sysusers.main}" = {
|
||||||
home.stateVersion = lib.mkForce "24.11";
|
home = {
|
||||||
|
desktop.enable = true;
|
||||||
|
stateVersion = lib.mkForce "24.11";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,7 +15,6 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
system = {
|
system = {
|
||||||
desktop.enable = false;
|
|
||||||
server.enable = true;
|
server.enable = true;
|
||||||
fileserver.enable = true;
|
fileserver.enable = true;
|
||||||
socialserver.enable = true;
|
socialserver.enable = true;
|
||||||
|
|
|
@ -17,7 +17,6 @@
|
||||||
environment.persistence."/persist".enable = lib.mkForce false;
|
environment.persistence."/persist".enable = lib.mkForce false;
|
||||||
|
|
||||||
system = {
|
system = {
|
||||||
desktop.enable = false;
|
|
||||||
mailserver.enable = true;
|
mailserver.enable = true;
|
||||||
wireless.enable = false;
|
wireless.enable = false;
|
||||||
wireguard.client.enable = true;
|
wireguard.client.enable = true;
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
system = {
|
system = {
|
||||||
|
desktop.enable = true;
|
||||||
lanzaboote.enable = true;
|
lanzaboote.enable = true;
|
||||||
wireguard.client.enable = true;
|
wireguard.client.enable = true;
|
||||||
stateVersion = "24.05";
|
stateVersion = "24.05";
|
||||||
|
|
|
@ -17,6 +17,7 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
system = {
|
system = {
|
||||||
|
desktop.enable = true;
|
||||||
lanzaboote.enable = true;
|
lanzaboote.enable = true;
|
||||||
wireless.enable = false;
|
wireless.enable = false;
|
||||||
video.nvidia.enable = true;
|
video.nvidia.enable = true;
|
||||||
|
|
|
@ -68,12 +68,8 @@
|
||||||
mountOptions = [ "compress=zstd" "noatime" "ssd" ];
|
mountOptions = [ "compress=zstd" "noatime" "ssd" ];
|
||||||
};
|
};
|
||||||
"/persist/.snapshots" = { };
|
"/persist/.snapshots" = { };
|
||||||
|
"/persist/home/${config.sysusers.main}" = { };
|
||||||
"/${config.sysusers.main}" = {
|
"/persist/home/${config.sysusers.main}/.snapshots" = { };
|
||||||
mountpoint = "/persist/home/${config.sysusers.main}";
|
|
||||||
mountOptions = [ "compress=zstd" "noatime" "ssd" ];
|
|
||||||
};
|
|
||||||
"/${config.sysusers.main}/.snapshots" = { };
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
{ config, lib, ... }:
|
{ config, lib, ... }:
|
||||||
{
|
{
|
||||||
home-manager.users."${config.sysusers.main}" = {
|
home-manager.users."${config.sysusers.main}" = {
|
||||||
home.stateVersion = lib.mkForce "24.05";
|
home = {
|
||||||
|
desktop.enable = true;
|
||||||
|
stateVersion = lib.mkForce "24.05";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
{ nur, ... }:
|
{ nur, lib, ... }:
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./files
|
./files
|
||||||
./options
|
|
||||||
./programs
|
./programs
|
||||||
./services
|
./services
|
||||||
./settings
|
./settings
|
||||||
|
@ -14,6 +13,12 @@
|
||||||
nur.modules.homeManager.default
|
nur.modules.homeManager.default
|
||||||
];
|
];
|
||||||
|
|
||||||
nixpkgs.config.allowUnfree = true;
|
options.home = {
|
||||||
home.stateVersion = "24.11";
|
desktop.enable = lib.mkEnableOption "Enable desktop programs and services.";
|
||||||
|
};
|
||||||
|
|
||||||
|
config = {
|
||||||
|
nixpkgs.config.allowUnfree = true;
|
||||||
|
home.stateVersion = "24.11";
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +0,0 @@
|
||||||
{ lib, ... }:
|
|
||||||
with lib; {
|
|
||||||
options.home.desktop.enable = mkOption {
|
|
||||||
type = types.bool;
|
|
||||||
default = true;
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -1,13 +1,17 @@
|
||||||
{ ... }:
|
{ lib, ... }:
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./accounts
|
./accounts
|
||||||
./devices
|
./devices
|
||||||
./options
|
|
||||||
./programs
|
./programs
|
||||||
./secrets
|
./secrets
|
||||||
./services
|
./services
|
||||||
./settings
|
./settings
|
||||||
../extras
|
../extras
|
||||||
];
|
];
|
||||||
|
|
||||||
|
options.system = {
|
||||||
|
desktop.enable = lib.mkEnableOption "Enable desktop apps and services";
|
||||||
|
server.enable = lib.mkEnableOption "Enable server apps and services";
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,13 +0,0 @@
|
||||||
{ lib, ... }:
|
|
||||||
with lib; {
|
|
||||||
options.system = {
|
|
||||||
desktop.enable = mkOption {
|
|
||||||
type = types.bool;
|
|
||||||
default = true;
|
|
||||||
};
|
|
||||||
server.enable = mkOption {
|
|
||||||
type = types.bool;
|
|
||||||
default = false;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
16
modules/system/services/server/ddclient/default.nix
Normal file
16
modules/system/services/server/ddclient/default.nix
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
{
|
||||||
|
config = lib.mkIf config.system.server.enable {
|
||||||
|
services.ddclient = {
|
||||||
|
enable = true;
|
||||||
|
protocol = "cloudflare";
|
||||||
|
zone = "${config.domains.p2}";
|
||||||
|
usev6 = "";
|
||||||
|
username = "token";
|
||||||
|
passwordFile = "${pkgs.writeText "cloudflareapikey" config.secrets.flareApiKey}";
|
||||||
|
};
|
||||||
|
environment.persistence."/persist".directories = [
|
||||||
|
"/var/lib/private/ddclient"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
|
@ -1,6 +1,7 @@
|
||||||
{ ... }:
|
{ ... }:
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
|
./ddclient
|
||||||
./fileserver
|
./fileserver
|
||||||
./forgejo
|
./forgejo
|
||||||
./icecast
|
./icecast
|
||||||
|
|
|
@ -1,9 +1,6 @@
|
||||||
{ lib, ... }:
|
{ lib, ... }:
|
||||||
{
|
{
|
||||||
options.system.fileserver.enable = lib.mkOption {
|
options.system.fileserver.enable = lib.mkEnableOption "Enable file serving services";
|
||||||
type = lib.types.bool;
|
|
||||||
default = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
imports = [
|
imports = [
|
||||||
./jellyfin
|
./jellyfin
|
||||||
|
|
|
@ -1,9 +1,6 @@
|
||||||
{ lib, ... }:
|
{ lib, ... }:
|
||||||
{
|
{
|
||||||
options.system.mailserver.enable = lib.mkOption {
|
options.system.mailserver.enable = lib.mkEnableOption "Enable Simple NixOS Mailserver";
|
||||||
type = lib.types.bool;
|
|
||||||
default = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
imports = [
|
imports = [
|
||||||
./simplenix
|
./simplenix
|
||||||
|
|
|
@ -1,9 +1,6 @@
|
||||||
{ lib, ... }:
|
{ lib, ... }:
|
||||||
{
|
{
|
||||||
options.system.socialserver.enable = lib.mkOption {
|
options.system.socialserver.enable = lib.mkEnableOption "Enable social media like services";
|
||||||
type = lib.types.bool;
|
|
||||||
default = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
imports = [
|
imports = [
|
||||||
./mastodon
|
./mastodon
|
||||||
|
|
|
@ -1,14 +0,0 @@
|
||||||
{ config, lib, pkgs, ... }:
|
|
||||||
{
|
|
||||||
services.ddclient = {
|
|
||||||
enable = config.system.server.enable;
|
|
||||||
protocol = "cloudflare";
|
|
||||||
zone = "${config.domains.p2}";
|
|
||||||
usev6 = "";
|
|
||||||
username = "token";
|
|
||||||
passwordFile = "${pkgs.writeText "cloudflareapikey" config.secrets.flareApiKey}";
|
|
||||||
};
|
|
||||||
environment.persistence."/persist".directories = lib.mkIf config.services.ddclient.enable [
|
|
||||||
"/var/lib/private/ddclient"
|
|
||||||
];
|
|
||||||
}
|
|
|
@ -1,8 +1,9 @@
|
||||||
{ lib, ... }:
|
{ lib, ... }:
|
||||||
{
|
{
|
||||||
|
options.system.webserver.enable = lib.mkEnableOption "Enable nginx related services";
|
||||||
|
|
||||||
imports = [
|
imports = [
|
||||||
./acme
|
./acme
|
||||||
./ddclient
|
|
||||||
./nginx
|
./nginx
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue