refactor: simplify module composition
This commit is contained in:
@@ -1,22 +1,26 @@
|
||||
{ ... }:
|
||||
{
|
||||
config,
|
||||
...
|
||||
}:
|
||||
let
|
||||
metaLib = config.meta.lib;
|
||||
in
|
||||
{
|
||||
flake.modules.homeManager.bitwarden =
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
user = config.meta.user;
|
||||
primaryEmail = builtins.head (lib.filter (email: email.primary) (builtins.attrValues user.emails));
|
||||
in
|
||||
{
|
||||
programs.rbw = {
|
||||
enable = true;
|
||||
settings = {
|
||||
base_url = "https://vault.jelles.net";
|
||||
email = primaryEmail.address;
|
||||
base_url = metaLib.repo.services.vaultwarden.url;
|
||||
email = user.primaryEmail.address;
|
||||
pinentry = pkgs.pinentry-gnome3;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
{ config, ... }:
|
||||
let
|
||||
homeModules = config.flake.modules.homeManager;
|
||||
in
|
||||
{
|
||||
flake.modules.homeManager.ergon-workstation = {
|
||||
imports = [ homeModules.workstation-base ];
|
||||
};
|
||||
}
|
||||
@@ -8,7 +8,6 @@
|
||||
}:
|
||||
let
|
||||
user = config.meta.user;
|
||||
primaryEmail = builtins.head (lib.filter (email: email.primary) (builtins.attrValues user.emails));
|
||||
usesScopedIdentity = user != null && user.sourceControl.profiles != { };
|
||||
in
|
||||
{
|
||||
@@ -25,7 +24,7 @@
|
||||
// lib.optionalAttrs (!usesScopedIdentity) {
|
||||
user = {
|
||||
name = user.realName;
|
||||
email = primaryEmail.address;
|
||||
email = user.primaryEmail.address;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
+13
-55
@@ -1,3 +1,10 @@
|
||||
{
|
||||
config,
|
||||
...
|
||||
}:
|
||||
let
|
||||
metaLib = config.meta.lib;
|
||||
in
|
||||
{
|
||||
flake.modules.nixos.input =
|
||||
{
|
||||
@@ -6,64 +13,15 @@
|
||||
...
|
||||
}:
|
||||
let
|
||||
hostInput = config.meta.host.input;
|
||||
|
||||
hasAnyConfiguredValue = attrs: lib.any (value: value != null) (lib.attrValues attrs);
|
||||
libinputScrollMethodMap = {
|
||||
edge = "edge";
|
||||
"no-scroll" = "none";
|
||||
"on-button-down" = "button";
|
||||
"two-finger" = "twofinger";
|
||||
};
|
||||
libinputClickMethodMap = {
|
||||
"button-areas" = "buttonareas";
|
||||
clickfinger = "clickfinger";
|
||||
};
|
||||
|
||||
hasMouseConfig = hasAnyConfiguredValue hostInput.mouse;
|
||||
hasTouchpadConfig = hasAnyConfiguredValue hostInput.touchpad;
|
||||
hasPointerConfig = hasMouseConfig || hasTouchpadConfig;
|
||||
|
||||
mouseConfig = lib.filterAttrs (_: value: value != null) {
|
||||
accelProfile = hostInput.mouse.accelProfile;
|
||||
accelSpeed =
|
||||
if hostInput.mouse.accelSpeed == null then null else toString hostInput.mouse.accelSpeed;
|
||||
leftHanded = hostInput.mouse.leftHanded;
|
||||
middleEmulation = hostInput.mouse.middleEmulation;
|
||||
naturalScrolling = hostInput.mouse.naturalScrolling;
|
||||
scrollMethod =
|
||||
if hostInput.mouse.scrollMethod == null then
|
||||
null
|
||||
else
|
||||
libinputScrollMethodMap.${hostInput.mouse.scrollMethod};
|
||||
};
|
||||
|
||||
touchpadConfig = lib.filterAttrs (_: value: value != null) {
|
||||
accelProfile = hostInput.touchpad.accelProfile;
|
||||
accelSpeed =
|
||||
if hostInput.touchpad.accelSpeed == null then null else toString hostInput.touchpad.accelSpeed;
|
||||
clickMethod =
|
||||
if hostInput.touchpad.clickMethod == null then
|
||||
null
|
||||
else
|
||||
libinputClickMethodMap.${hostInput.touchpad.clickMethod};
|
||||
disableWhileTyping = hostInput.touchpad.disableWhileTyping;
|
||||
leftHanded = hostInput.touchpad.leftHanded;
|
||||
middleEmulation = hostInput.touchpad.middleEmulation;
|
||||
naturalScrolling = hostInput.touchpad.naturalScrolling;
|
||||
scrollMethod =
|
||||
if hostInput.touchpad.scrollMethod == null then
|
||||
null
|
||||
else
|
||||
libinputScrollMethodMap.${hostInput.touchpad.scrollMethod};
|
||||
tapping = hostInput.touchpad.tapping;
|
||||
};
|
||||
inputProfiles = metaLib.mkInputProfiles config.meta.host.input;
|
||||
in
|
||||
{
|
||||
services.libinput = lib.mkIf hasPointerConfig {
|
||||
services.libinput = lib.mkIf inputProfiles.hasPointerConfig {
|
||||
enable = true;
|
||||
mouse = mouseConfig;
|
||||
touchpad = touchpadConfig;
|
||||
inherit (inputProfiles.libinput)
|
||||
mouse
|
||||
touchpad
|
||||
;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
{ config, ... }:
|
||||
let
|
||||
homeModules = config.flake.modules.homeManager;
|
||||
in
|
||||
{
|
||||
flake.modules.homeManager.kiri-workstation = {
|
||||
imports = [
|
||||
homeModules.workstation-base
|
||||
homeModules.syncthing
|
||||
homeModules.qbittorrent-client
|
||||
];
|
||||
};
|
||||
}
|
||||
+89
-74
@@ -3,10 +3,41 @@ let
|
||||
mkNullableOption =
|
||||
type:
|
||||
lib.mkOption {
|
||||
inherit type;
|
||||
type = lib.types.nullOr type;
|
||||
default = null;
|
||||
};
|
||||
|
||||
hasSinglePrimaryEmail =
|
||||
user: builtins.length (lib.filter (email: email.primary) (builtins.attrValues user.emails)) == 1;
|
||||
|
||||
primaryEmailFallback = {
|
||||
address = "";
|
||||
primary = false;
|
||||
type = "";
|
||||
};
|
||||
|
||||
sourceControlScopeType = lib.types.enum [
|
||||
"personal"
|
||||
"work"
|
||||
];
|
||||
|
||||
pointerAccelProfileType = lib.types.enum [
|
||||
"adaptive"
|
||||
"flat"
|
||||
];
|
||||
|
||||
pointerScrollMethodType = lib.types.enum [
|
||||
"no-scroll"
|
||||
"two-finger"
|
||||
"edge"
|
||||
"on-button-down"
|
||||
];
|
||||
|
||||
touchpadClickMethodType = lib.types.enum [
|
||||
"button-areas"
|
||||
"clickfinger"
|
||||
];
|
||||
|
||||
emailType = lib.types.submodule (
|
||||
{ ... }:
|
||||
{
|
||||
@@ -79,10 +110,7 @@ let
|
||||
};
|
||||
|
||||
projectScope = lib.mkOption {
|
||||
type = lib.types.enum [
|
||||
"personal"
|
||||
"work"
|
||||
];
|
||||
type = sourceControlScopeType;
|
||||
default = "personal";
|
||||
};
|
||||
};
|
||||
@@ -91,6 +119,10 @@ let
|
||||
|
||||
userType = lib.types.submodule (
|
||||
{ config, ... }:
|
||||
let
|
||||
primaryEmails = lib.filter (email: email.primary) (builtins.attrValues config.emails);
|
||||
primaryEmail = if primaryEmails == [ ] then primaryEmailFallback else builtins.head primaryEmails;
|
||||
in
|
||||
{
|
||||
options = {
|
||||
name = lib.mkOption {
|
||||
@@ -118,11 +150,19 @@ let
|
||||
type = lib.types.attrsOf emailType;
|
||||
};
|
||||
|
||||
primaryEmail = lib.mkOption {
|
||||
type = emailType;
|
||||
readOnly = true;
|
||||
description = "Derived primary email entry for this user.";
|
||||
};
|
||||
|
||||
sourceControl = lib.mkOption {
|
||||
type = sourceControlType;
|
||||
default = { };
|
||||
};
|
||||
};
|
||||
|
||||
config.primaryEmail = primaryEmail;
|
||||
}
|
||||
);
|
||||
|
||||
@@ -179,28 +219,12 @@ let
|
||||
{ ... }:
|
||||
{
|
||||
options = {
|
||||
accelProfile = mkNullableOption (
|
||||
lib.types.nullOr (
|
||||
lib.types.enum [
|
||||
"adaptive"
|
||||
"flat"
|
||||
]
|
||||
)
|
||||
);
|
||||
accelSpeed = mkNullableOption (lib.types.nullOr lib.types.float);
|
||||
leftHanded = mkNullableOption (lib.types.nullOr lib.types.bool);
|
||||
middleEmulation = mkNullableOption (lib.types.nullOr lib.types.bool);
|
||||
naturalScrolling = mkNullableOption (lib.types.nullOr lib.types.bool);
|
||||
scrollMethod = mkNullableOption (
|
||||
lib.types.nullOr (
|
||||
lib.types.enum [
|
||||
"no-scroll"
|
||||
"two-finger"
|
||||
"edge"
|
||||
"on-button-down"
|
||||
]
|
||||
)
|
||||
);
|
||||
accelProfile = mkNullableOption (pointerAccelProfileType);
|
||||
accelSpeed = mkNullableOption lib.types.float;
|
||||
leftHanded = mkNullableOption lib.types.bool;
|
||||
middleEmulation = mkNullableOption lib.types.bool;
|
||||
naturalScrolling = mkNullableOption lib.types.bool;
|
||||
scrollMethod = mkNullableOption pointerScrollMethodType;
|
||||
};
|
||||
}
|
||||
);
|
||||
@@ -209,38 +233,15 @@ let
|
||||
{ ... }:
|
||||
{
|
||||
options = {
|
||||
accelProfile = mkNullableOption (
|
||||
lib.types.nullOr (
|
||||
lib.types.enum [
|
||||
"adaptive"
|
||||
"flat"
|
||||
]
|
||||
)
|
||||
);
|
||||
accelSpeed = mkNullableOption (lib.types.nullOr lib.types.float);
|
||||
clickMethod = mkNullableOption (
|
||||
lib.types.nullOr (
|
||||
lib.types.enum [
|
||||
"button-areas"
|
||||
"clickfinger"
|
||||
]
|
||||
)
|
||||
);
|
||||
disableWhileTyping = mkNullableOption (lib.types.nullOr lib.types.bool);
|
||||
leftHanded = mkNullableOption (lib.types.nullOr lib.types.bool);
|
||||
middleEmulation = mkNullableOption (lib.types.nullOr lib.types.bool);
|
||||
naturalScrolling = mkNullableOption (lib.types.nullOr lib.types.bool);
|
||||
scrollMethod = mkNullableOption (
|
||||
lib.types.nullOr (
|
||||
lib.types.enum [
|
||||
"no-scroll"
|
||||
"two-finger"
|
||||
"edge"
|
||||
"on-button-down"
|
||||
]
|
||||
)
|
||||
);
|
||||
tapping = mkNullableOption (lib.types.nullOr lib.types.bool);
|
||||
accelProfile = mkNullableOption (pointerAccelProfileType);
|
||||
accelSpeed = mkNullableOption lib.types.float;
|
||||
clickMethod = mkNullableOption touchpadClickMethodType;
|
||||
disableWhileTyping = mkNullableOption lib.types.bool;
|
||||
leftHanded = mkNullableOption lib.types.bool;
|
||||
middleEmulation = mkNullableOption lib.types.bool;
|
||||
naturalScrolling = mkNullableOption lib.types.bool;
|
||||
scrollMethod = mkNullableOption pointerScrollMethodType;
|
||||
tapping = mkNullableOption lib.types.bool;
|
||||
};
|
||||
}
|
||||
);
|
||||
@@ -294,23 +295,37 @@ let
|
||||
);
|
||||
in
|
||||
{
|
||||
flake.modules.nixos.meta = {
|
||||
options.meta.host = lib.mkOption {
|
||||
type = hostType;
|
||||
};
|
||||
};
|
||||
|
||||
flake.modules.homeManager.meta = {
|
||||
options.meta = {
|
||||
host = lib.mkOption {
|
||||
type = lib.types.nullOr hostType;
|
||||
default = null;
|
||||
flake.modules.nixos.meta =
|
||||
{ config, ... }:
|
||||
{
|
||||
options.meta.host = lib.mkOption {
|
||||
type = hostType;
|
||||
};
|
||||
|
||||
user = lib.mkOption {
|
||||
type = lib.types.nullOr userType;
|
||||
default = null;
|
||||
config.assertions = lib.mapAttrsToList (userName: user: {
|
||||
assertion = hasSinglePrimaryEmail user;
|
||||
message = "User `${userName}` must define exactly one primary email entry.";
|
||||
}) config.meta.host.users;
|
||||
};
|
||||
|
||||
flake.modules.homeManager.meta =
|
||||
{ config, ... }:
|
||||
{
|
||||
options.meta = {
|
||||
host = lib.mkOption {
|
||||
type = lib.types.nullOr hostType;
|
||||
default = null;
|
||||
};
|
||||
|
||||
user = lib.mkOption {
|
||||
type = lib.types.nullOr userType;
|
||||
default = null;
|
||||
};
|
||||
};
|
||||
|
||||
config.assertions = lib.optional (config.meta.user != null) {
|
||||
assertion = hasSinglePrimaryEmail config.meta.user;
|
||||
message = "User `${config.meta.user.name}` must define exactly one primary email entry.";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -30,8 +30,6 @@ in
|
||||
...
|
||||
}:
|
||||
let
|
||||
hostInput = config.meta.host.input;
|
||||
|
||||
outputs = lib.mapAttrs (
|
||||
_: display:
|
||||
{
|
||||
@@ -50,44 +48,17 @@ in
|
||||
inherit (display) mode;
|
||||
}
|
||||
) config.meta.host.displays;
|
||||
terminalPackage = metaLib.resolvePackagePath {
|
||||
inputProfiles = metaLib.mkInputProfiles config.meta.host.input;
|
||||
terminal = metaLib.resolveUserTerminal {
|
||||
inherit pkgs;
|
||||
path = config.meta.user.terminalPackagePath;
|
||||
};
|
||||
hasMainProgram = terminalPackage != null && terminalPackage ? meta.mainProgram;
|
||||
|
||||
mouseSettings = lib.filterAttrs (_: value: value != null) {
|
||||
accel-profile = hostInput.mouse.accelProfile;
|
||||
accel-speed = hostInput.mouse.accelSpeed;
|
||||
left-handed = hostInput.mouse.leftHanded;
|
||||
middle-emulation = hostInput.mouse.middleEmulation;
|
||||
natural-scroll = hostInput.mouse.naturalScrolling;
|
||||
scroll-method = hostInput.mouse.scrollMethod;
|
||||
};
|
||||
|
||||
touchpadSettings = lib.filterAttrs (_: value: value != null) {
|
||||
accel-profile = hostInput.touchpad.accelProfile;
|
||||
accel-speed = hostInput.touchpad.accelSpeed;
|
||||
click-method = hostInput.touchpad.clickMethod;
|
||||
dwt = hostInput.touchpad.disableWhileTyping;
|
||||
left-handed = hostInput.touchpad.leftHanded;
|
||||
middle-emulation = hostInput.touchpad.middleEmulation;
|
||||
natural-scroll = hostInput.touchpad.naturalScrolling;
|
||||
scroll-method = hostInput.touchpad.scrollMethod;
|
||||
tap = hostInput.touchpad.tapping;
|
||||
user = config.meta.user;
|
||||
};
|
||||
in
|
||||
{
|
||||
assertions = [
|
||||
{
|
||||
assertion = terminalPackage != null;
|
||||
message = "Unknown terminal package `${lib.showAttrPath config.meta.user.terminalPackagePath}` for user `${config.meta.user.name}`.";
|
||||
}
|
||||
{
|
||||
assertion = hasMainProgram;
|
||||
message = "Terminal package `${lib.showAttrPath config.meta.user.terminalPackagePath}` must define `meta.mainProgram`.";
|
||||
}
|
||||
];
|
||||
assertions = metaLib.mkTerminalAssertions {
|
||||
inherit terminal;
|
||||
user = config.meta.user;
|
||||
};
|
||||
|
||||
home.sessionVariables.NIXOS_OZONE_WL = "1";
|
||||
|
||||
@@ -167,20 +138,20 @@ in
|
||||
xkb.options = "caps:escape";
|
||||
};
|
||||
}
|
||||
// lib.optionalAttrs (mouseSettings != { }) {
|
||||
mouse = mouseSettings;
|
||||
// lib.optionalAttrs (inputProfiles.niri.mouse != { }) {
|
||||
mouse = inputProfiles.niri.mouse;
|
||||
}
|
||||
// lib.optionalAttrs (touchpadSettings != { }) {
|
||||
touchpad = touchpadSettings;
|
||||
// lib.optionalAttrs (inputProfiles.niri.touchpad != { }) {
|
||||
touchpad = inputProfiles.niri.touchpad;
|
||||
};
|
||||
|
||||
binds =
|
||||
if hasMainProgram then
|
||||
if terminal.hasMainProgram then
|
||||
import ./_bindings.nix {
|
||||
inherit
|
||||
lib
|
||||
terminalPackage
|
||||
;
|
||||
terminalPackage = terminal.package;
|
||||
}
|
||||
else
|
||||
{ };
|
||||
|
||||
@@ -38,18 +38,17 @@ in
|
||||
...
|
||||
}:
|
||||
let
|
||||
terminalPackage = metaLib.resolvePackagePath {
|
||||
terminal = metaLib.resolveUserTerminal {
|
||||
inherit pkgs;
|
||||
path = config.meta.user.terminalPackagePath;
|
||||
user = config.meta.user;
|
||||
};
|
||||
hasMainProgram = terminalPackage != null && terminalPackage ? meta.mainProgram;
|
||||
baseSettings =
|
||||
if hasMainProgram then
|
||||
if terminal.hasMainProgram then
|
||||
import ./_noctalia-config.nix {
|
||||
inherit
|
||||
lib
|
||||
terminalPackage
|
||||
;
|
||||
terminalPackage = terminal.package;
|
||||
}
|
||||
else
|
||||
{ };
|
||||
@@ -57,16 +56,10 @@ in
|
||||
{
|
||||
imports = [ inputs.noctalia.homeModules.default ];
|
||||
|
||||
assertions = [
|
||||
{
|
||||
assertion = terminalPackage != null;
|
||||
message = "Unknown terminal package `${lib.showAttrPath config.meta.user.terminalPackagePath}` for user `${config.meta.user.name}`.";
|
||||
}
|
||||
{
|
||||
assertion = hasMainProgram;
|
||||
message = "Terminal package `${lib.showAttrPath config.meta.user.terminalPackagePath}` must define `meta.mainProgram`.";
|
||||
}
|
||||
];
|
||||
assertions = metaLib.mkTerminalAssertions {
|
||||
inherit terminal;
|
||||
user = config.meta.user;
|
||||
};
|
||||
|
||||
programs.noctalia-shell = {
|
||||
enable = true;
|
||||
@@ -88,18 +81,17 @@ in
|
||||
...
|
||||
}:
|
||||
let
|
||||
terminalPackage = metaLib.resolvePackagePath {
|
||||
terminal = metaLib.resolveUserTerminal {
|
||||
inherit pkgs;
|
||||
path = config.meta.user.terminalPackagePath;
|
||||
user = config.meta.user;
|
||||
};
|
||||
hasMainProgram = terminalPackage != null && terminalPackage ? meta.mainProgram;
|
||||
baseSettings =
|
||||
if hasMainProgram then
|
||||
if terminal.hasMainProgram then
|
||||
import ./_noctalia-config.nix {
|
||||
inherit
|
||||
lib
|
||||
terminalPackage
|
||||
;
|
||||
terminalPackage = terminal.package;
|
||||
}
|
||||
else
|
||||
{ };
|
||||
@@ -107,7 +99,7 @@ in
|
||||
{
|
||||
imports = [ homeModules.noctalia ];
|
||||
programs.noctalia-shell.settings = lib.mkForce (
|
||||
if hasMainProgram then mkPortableSettings baseSettings else { }
|
||||
if terminal.hasMainProgram then mkPortableSettings baseSettings else { }
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
{ config, ... }:
|
||||
let
|
||||
homeModules = config.flake.modules.homeManager;
|
||||
in
|
||||
{
|
||||
flake.modules.homeManager.personal-productivity = {
|
||||
imports = [
|
||||
homeModules.bitwarden
|
||||
homeModules.email
|
||||
homeModules.pim
|
||||
];
|
||||
};
|
||||
}
|
||||
@@ -1,3 +1,10 @@
|
||||
{
|
||||
config,
|
||||
...
|
||||
}:
|
||||
let
|
||||
metaLib = config.meta.lib;
|
||||
in
|
||||
{
|
||||
flake.modules.homeManager.pim =
|
||||
{
|
||||
@@ -44,7 +51,7 @@
|
||||
};
|
||||
|
||||
remote = {
|
||||
url = "https://radicale.jelles.net/";
|
||||
url = metaLib.repo.services.radicale.url;
|
||||
type = "caldav";
|
||||
userName = config.home.username;
|
||||
passwordCommand = [
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
{ config, ... }:
|
||||
let
|
||||
metaLib = config.meta.lib;
|
||||
service = metaLib.repo.services.actual;
|
||||
in
|
||||
{
|
||||
flake.modules.nixos.actual =
|
||||
@@ -11,15 +12,17 @@ in
|
||||
enable = true;
|
||||
openFirewall = false;
|
||||
settings = {
|
||||
port = 3000;
|
||||
hostname = "127.0.0.1";
|
||||
inherit (service) port;
|
||||
hostname = service.host;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
(metaLib.mkCaddyReverseProxy {
|
||||
domain = "finance.jelles.net";
|
||||
port = 3000;
|
||||
inherit (service)
|
||||
domain
|
||||
port
|
||||
;
|
||||
})
|
||||
];
|
||||
}
|
||||
|
||||
@@ -1,8 +1,12 @@
|
||||
{ config, ... }:
|
||||
let
|
||||
metaLib = config.meta.lib;
|
||||
in
|
||||
{
|
||||
flake.modules.nixos.caddy = {
|
||||
services.caddy = {
|
||||
enable = true;
|
||||
email = "mail@jelles.net";
|
||||
email = metaLib.repo.contact.email;
|
||||
openFirewall = true;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
{
|
||||
flake.modules.nixos.deluge-service =
|
||||
{ ... }:
|
||||
{
|
||||
sops.secrets.deluge-auth-file = { };
|
||||
|
||||
services.deluge = {
|
||||
enable = true;
|
||||
declarative = false;
|
||||
};
|
||||
};
|
||||
|
||||
flake.modules.homeManager.deluge-client =
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
home.packages = [ pkgs.deluge ];
|
||||
};
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
{ config, ... }:
|
||||
let
|
||||
metaLib = config.meta.lib;
|
||||
service = metaLib.repo.services.gitea;
|
||||
in
|
||||
{
|
||||
flake.modules.nixos.gitea =
|
||||
@@ -12,10 +13,10 @@ in
|
||||
|
||||
settings = {
|
||||
server = {
|
||||
DOMAIN = "git.jelles.net";
|
||||
ROOT_URL = "https://git.jelles.net/";
|
||||
HTTP_PORT = 3001;
|
||||
HTTP_ADDR = "127.0.0.1";
|
||||
DOMAIN = service.domain;
|
||||
ROOT_URL = service.url;
|
||||
HTTP_PORT = service.port;
|
||||
HTTP_ADDR = service.host;
|
||||
|
||||
START_SSH_SERVER = false;
|
||||
SSH_PORT = 22;
|
||||
@@ -31,8 +32,10 @@ in
|
||||
}
|
||||
|
||||
(metaLib.mkCaddyReverseProxy {
|
||||
domain = "git.jelles.net";
|
||||
port = 3001;
|
||||
inherit (service)
|
||||
domain
|
||||
port
|
||||
;
|
||||
})
|
||||
];
|
||||
}
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
{ ... }:
|
||||
{
|
||||
flake.modules.nixos.qbittorrent = {
|
||||
services.qbittorrent = {
|
||||
enable = true;
|
||||
openFirewall = true;
|
||||
torrentingPort = 43864;
|
||||
webuiPort = 8123;
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
{ config, ... }:
|
||||
let
|
||||
metaLib = config.meta.lib;
|
||||
service = metaLib.repo.services.radicale;
|
||||
in
|
||||
{
|
||||
flake.modules.nixos.radicale =
|
||||
@@ -10,7 +11,7 @@ in
|
||||
services.radicale = {
|
||||
enable = true;
|
||||
settings = {
|
||||
server.hosts = [ "127.0.0.1:5232" ];
|
||||
server.hosts = [ "${service.host}:${toString service.port}" ];
|
||||
|
||||
auth = {
|
||||
type = "htpasswd";
|
||||
@@ -24,8 +25,10 @@ in
|
||||
}
|
||||
|
||||
(metaLib.mkCaddyReverseProxy {
|
||||
domain = "radicale.jelles.net";
|
||||
port = 5232;
|
||||
inherit (service)
|
||||
domain
|
||||
port
|
||||
;
|
||||
extraHeaders = [
|
||||
{
|
||||
name = "X-Script-Name";
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
{ config, ... }:
|
||||
let
|
||||
metaLib = config.meta.lib;
|
||||
service = metaLib.repo.services.vaultwarden;
|
||||
in
|
||||
{
|
||||
flake.modules.nixos.vaultwarden =
|
||||
@@ -11,17 +12,19 @@ in
|
||||
enable = true;
|
||||
backupDir = "/var/backup/vaultwarden";
|
||||
config = {
|
||||
DOMAIN = "https://vault.jelles.net";
|
||||
DOMAIN = service.url;
|
||||
SIGNUPS_ALLOWED = false;
|
||||
ROCKET_PORT = 8100;
|
||||
ROCKET_PORT = service.port;
|
||||
ROCKET_LOG = "critical";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
(metaLib.mkCaddyReverseProxy {
|
||||
domain = "vault.jelles.net";
|
||||
port = 8100;
|
||||
inherit (service)
|
||||
domain
|
||||
port
|
||||
;
|
||||
})
|
||||
];
|
||||
}
|
||||
|
||||
@@ -11,38 +11,22 @@ in
|
||||
...
|
||||
}:
|
||||
let
|
||||
terminalPackage = metaLib.resolvePackagePath {
|
||||
terminal = metaLib.resolveUserTerminal {
|
||||
inherit pkgs;
|
||||
path = config.meta.user.terminalPackagePath;
|
||||
user = config.meta.user;
|
||||
};
|
||||
hasTerminalPackage = terminalPackage != null;
|
||||
hasMainProgram = hasTerminalPackage && terminalPackage ? meta.mainProgram;
|
||||
terminalDesktopId = if hasMainProgram then "${terminalPackage.meta.mainProgram}.desktop" else null;
|
||||
in
|
||||
{
|
||||
assertions = [
|
||||
{
|
||||
assertion = hasTerminalPackage;
|
||||
message = "Unknown terminal package `${lib.showAttrPath config.meta.user.terminalPackagePath}` for user `${config.meta.user.name}`.";
|
||||
}
|
||||
{
|
||||
assertion = hasMainProgram;
|
||||
message = "Terminal package `${lib.showAttrPath config.meta.user.terminalPackagePath}` must define `meta.mainProgram`.";
|
||||
}
|
||||
{
|
||||
assertion =
|
||||
hasMainProgram && builtins.pathExists "${terminalPackage}/share/applications/${terminalDesktopId}";
|
||||
message = "Terminal package `${lib.showAttrPath config.meta.user.terminalPackagePath}` must provide `${terminalDesktopId}`.";
|
||||
}
|
||||
{
|
||||
assertion = hasMainProgram && terminalPackage.meta.mainProgram == "kitty";
|
||||
message = "The terminal feature currently only supports kitty-specific Home Manager configuration.";
|
||||
}
|
||||
];
|
||||
assertions = metaLib.mkTerminalAssertions {
|
||||
inherit terminal;
|
||||
user = config.meta.user;
|
||||
requireDesktopEntry = true;
|
||||
requireKitty = true;
|
||||
};
|
||||
|
||||
xdg.terminal-exec = {
|
||||
enable = true;
|
||||
settings.default = lib.optional (terminalDesktopId != null) terminalDesktopId;
|
||||
settings.default = lib.optional (terminal.desktopId != null) terminal.desktopId;
|
||||
};
|
||||
|
||||
programs.kitty = {
|
||||
|
||||
+28
-15
@@ -1,3 +1,10 @@
|
||||
{
|
||||
config,
|
||||
...
|
||||
}:
|
||||
let
|
||||
metaLib = config.meta.lib;
|
||||
in
|
||||
{
|
||||
flake.modules.nixos.theme =
|
||||
{
|
||||
@@ -5,10 +12,12 @@
|
||||
...
|
||||
}:
|
||||
let
|
||||
cursorTheme = {
|
||||
name = "phinger-cursors-light";
|
||||
package = pkgs.phinger-cursors;
|
||||
size = 24;
|
||||
repoTheme = metaLib.repo.theme;
|
||||
cursorTheme = repoTheme.cursor // {
|
||||
package = metaLib.resolvePackagePath {
|
||||
inherit pkgs;
|
||||
path = repoTheme.cursor.packagePath;
|
||||
};
|
||||
};
|
||||
in
|
||||
{
|
||||
@@ -25,21 +34,25 @@
|
||||
flake.modules.homeManager.theme =
|
||||
{ config, pkgs, ... }:
|
||||
let
|
||||
cursorTheme = {
|
||||
name = "phinger-cursors-light";
|
||||
package = pkgs.phinger-cursors;
|
||||
size = 24;
|
||||
repoTheme = metaLib.repo.theme;
|
||||
cursorTheme = repoTheme.cursor // {
|
||||
package = metaLib.resolvePackagePath {
|
||||
inherit pkgs;
|
||||
path = repoTheme.cursor.packagePath;
|
||||
};
|
||||
};
|
||||
|
||||
kanagawaThemeSrc = pkgs.fetchFromGitHub {
|
||||
owner = "Fausto-Korpsvart";
|
||||
repo = "Kanagawa-GKT-Theme";
|
||||
rev = "55ca4ba249eba21f861b9866b71ab41bb8930318";
|
||||
hash = "sha256-UdMoMx2DoovcxSp/zBZ3PRv/Qpj+prd0uPm1gmdak2E=";
|
||||
inherit (repoTheme.kanagawa)
|
||||
hash
|
||||
owner
|
||||
repo
|
||||
rev
|
||||
;
|
||||
};
|
||||
|
||||
kanagawaOverride = {
|
||||
version = "unstable-2025-10-23";
|
||||
version = repoTheme.kanagawa.version;
|
||||
src = kanagawaThemeSrc;
|
||||
};
|
||||
in
|
||||
@@ -59,14 +72,14 @@
|
||||
"sftp://orion Orion VPS"
|
||||
];
|
||||
theme = {
|
||||
name = "Kanagawa-BL-LB";
|
||||
name = repoTheme.kanagawa.gtkThemeName;
|
||||
package = pkgs.kanagawa-gtk-theme.overrideAttrs (_: kanagawaOverride);
|
||||
};
|
||||
gtk4.theme = {
|
||||
inherit (config.gtk.theme) name package;
|
||||
};
|
||||
iconTheme = {
|
||||
name = "Kanagawa";
|
||||
name = repoTheme.kanagawa.iconThemeName;
|
||||
package = pkgs.kanagawa-icon-theme.overrideAttrs (_: kanagawaOverride);
|
||||
};
|
||||
};
|
||||
|
||||
@@ -33,15 +33,17 @@ in
|
||||
flake.modules.homeManager.workstation-base = {
|
||||
imports = [
|
||||
homeModules.ai
|
||||
homeModules.bitwarden
|
||||
homeModules.clipboard
|
||||
homeModules.dev-tools
|
||||
homeModules.email
|
||||
homeModules.local-apps
|
||||
homeModules.mpv
|
||||
homeModules.neovim
|
||||
homeModules.nh
|
||||
homeModules.niri
|
||||
homeModules.nix
|
||||
homeModules.personal-productivity
|
||||
homeModules.pim
|
||||
homeModules.podman
|
||||
homeModules.shell
|
||||
homeModules.sops
|
||||
|
||||
Reference in New Issue
Block a user