refactor: reorganize features

This commit is contained in:
2026-04-27 16:47:12 +02:00
parent 0b2ecd31b0
commit 93624900ad
18 changed files with 193 additions and 206 deletions
@@ -1,26 +1,39 @@
{ config, ... }:
let
repo = config.repo;
repoHelpers = repo.helpers;
in
{
flake.modules.homeManager.xdg =
flake.modules.homeManager.desktop-defaults =
{ config, pkgs, ... }:
let
browserPackage = repoHelpers.resolvePackagePath {
inherit pkgs;
path = repo.desktop.browser.packagePath;
};
fileManagerPackage = repoHelpers.resolvePackagePath {
inherit pkgs;
path = repo.desktop.fileManager.packagePath;
};
browserPackage = pkgs.${repo.desktop.browser.packageAttr};
fileManagerPackage = pkgs.${repo.desktop.fileManager.packageAttr};
homeDir = config.home.homeDirectory;
localDir = "${homeDir}/.local";
mediaDir = "${homeDir}/media";
in
{
home.preferXdgDirectories = true;
home.sessionVariables.BROWSER = repo.desktop.browser.command;
home.packages =
with pkgs;
[
postman
spotify
calcure
planify
unzip
gimp
dbeaver-bin
]
++ [
browserPackage
fileManagerPackage
];
programs.imv.enable = true;
programs.sioyek.enable = true;
xdg = {
enable = true;
-88
View File
@@ -1,88 +0,0 @@
{ config, ... }:
let
account = config.repo.account;
in
{
flake.modules.homeManager.email =
{
config,
lib,
...
}:
let
mkOffice365Account =
{
address,
primary,
...
}:
{
enable = true;
inherit address primary;
realName = account.realName;
userName = address;
thunderbird = {
enable = true;
settings = id: {
"mail.smtpserver.smtp_${id}.authMethod" = 10;
"mail.server.server_${id}.authMethod" = 10;
};
};
flavor = "outlook.office365.com";
};
mkMxrouteAccount =
{
address,
primary,
...
}:
{
enable = true;
inherit address primary;
realName = account.realName;
userName = address;
thunderbird.enable = true;
imap = {
authentication = "plain";
host = "taylor.mxrouting.net";
port = 993;
tls.enable = true;
};
smtp = {
authentication = "plain";
host = "taylor.mxrouting.net";
port = 465;
tls.enable = true;
};
};
mkEmailAccount =
email:
if email.type == "office365" then
mkOffice365Account email
else if email.type == "mxrouting" then
mkMxrouteAccount email
else
throw "Unsupported email type `${email.type}` for ${config.home.username}";
in
{
programs.thunderbird = {
enable = true;
profiles.${config.home.username} = {
isDefault = true;
withExternalGnupg = true;
settings = {
"mail.ui.display.message_pane_vertical" = true;
"mail.ui.display.thread_pane_view_type" = "cards";
"mail.uidensity" = 1;
"privacy.donottrackheader.enabled" = true;
"mail.server.server2.hidden" = true;
"mailnews.start_page.enabled" = false;
"mail.provider.enabled" = false;
"layout.css.devPixelsPerPx" = 0.85;
};
};
};
accounts.email.accounts = lib.mapAttrs (_: mkEmailAccount) account.emails;
};
}
-34
View File
@@ -1,34 +0,0 @@
{ config, ... }:
let
repo = config.repo;
repoHelpers = repo.helpers;
in
{
flake.modules.homeManager.local-apps =
{ pkgs, ... }:
let
browserPackage = repoHelpers.resolvePackagePath {
inherit pkgs;
path = repo.desktop.browser.packagePath;
};
in
{
home.sessionVariables.BROWSER = repo.desktop.browser.command;
home.packages =
with pkgs;
[
postman
spotify
calcure
planify
unzip
gimp
dbeaver-bin
]
++ [ browserPackage ];
programs.imv.enable = true;
programs.sioyek.enable = true;
};
}
@@ -1,6 +1,6 @@
{ ... }:
{
flake.modules.nixos.region-nl = {
flake.modules.nixos.locale-nl = {
time.timeZone = "Europe/Amsterdam";
i18n.defaultLocale = "en_US.UTF-8";
+1 -1
View File
@@ -6,7 +6,7 @@
};
};
flake.modules.nixos.networking = {
flake.modules.nixos.network-manager = {
networking = {
nftables.enable = true;
networkmanager.enable = true;
-14
View File
@@ -1,14 +0,0 @@
{ config, ... }:
let
account = config.repo.account;
in
{
flake.modules.homeManager.nh =
{ ... }:
{
programs.nh = {
enable = true;
flake = account.nixosConfigurationPath;
};
};
}
+1 -12
View File
@@ -5,7 +5,6 @@
}:
let
repo = config.repo;
repoHelpers = repo.helpers;
in
{
flake.modules.nixos.niri =
@@ -34,10 +33,7 @@ in
let
repoTheme = repo.theme.kanagawa;
browserCommand = repo.desktop.browser.command;
fileManagerPackage = repoHelpers.resolvePackagePath {
inherit pkgs;
path = repo.desktop.fileManager.packagePath;
};
fileManagerPackage = pkgs.${repo.desktop.fileManager.packageAttr};
terminalCommand = config.repo.terminal.primary.command;
outputs = lib.mapAttrs (
_: display:
@@ -65,13 +61,6 @@ in
) osConfig.meta.machine.displays;
in
{
assertions = [
{
assertion = fileManagerPackage != null;
message = "Unknown file manager package `${lib.showAttrPath repo.desktop.fileManager.packagePath}`.";
}
];
home.sessionVariables.NIXOS_OZONE_WL = "1";
dconf.settings = {
+9 -1
View File
@@ -1,4 +1,7 @@
{ inputs, ... }:
{ inputs, config, ... }:
let
account = config.repo.account;
in
{
flake.modules.nixos.nix =
{ ... }:
@@ -53,5 +56,10 @@
enable = true;
enableTelevisionIntegration = true;
};
programs.nh = {
enable = true;
flake = account.nixosConfigurationPath;
};
};
}
@@ -7,9 +7,8 @@ let
account = repo.account;
in
{
flake.modules.homeManager.bitwarden =
flake.modules.homeManager.passwords =
{
config,
pkgs,
...
}:
+85 -1
View File
@@ -4,9 +4,93 @@
}:
let
repo = config.repo;
account = repo.account;
in
{
flake.modules.homeManager.pim =
flake.modules.homeManager.email =
{
config,
lib,
...
}:
let
mkOffice365Account =
{
address,
primary,
...
}:
{
enable = true;
inherit address primary;
realName = account.realName;
userName = address;
thunderbird = {
enable = true;
settings = id: {
"mail.smtpserver.smtp_${id}.authMethod" = 10;
"mail.server.server_${id}.authMethod" = 10;
};
};
flavor = "outlook.office365.com";
};
mkMxrouteAccount =
{
address,
primary,
...
}:
{
enable = true;
inherit address primary;
realName = account.realName;
userName = address;
thunderbird.enable = true;
imap = {
authentication = "plain";
host = "taylor.mxrouting.net";
port = 993;
tls.enable = true;
};
smtp = {
authentication = "plain";
host = "taylor.mxrouting.net";
port = 465;
tls.enable = true;
};
};
mkEmailAccount =
email:
if email.type == "office365" then
mkOffice365Account email
else if email.type == "mxrouting" then
mkMxrouteAccount email
else
throw "Unsupported email type `${email.type}` for ${config.home.username}";
in
{
programs.thunderbird = {
enable = true;
profiles.${config.home.username} = {
isDefault = true;
withExternalGnupg = true;
settings = {
"mail.ui.display.message_pane_vertical" = true;
"mail.ui.display.thread_pane_view_type" = "cards";
"mail.uidensity" = 1;
"privacy.donottrackheader.enabled" = true;
"mail.server.server2.hidden" = true;
"mailnews.start_page.enabled" = false;
"mail.provider.enabled" = false;
"layout.css.devPixelsPerPx" = 0.85;
};
};
};
accounts.email.accounts = lib.mapAttrs (_: mkEmailAccount) account.emails;
};
flake.modules.homeManager.calendar-tasks =
{
config,
...
+1 -1
View File
@@ -8,7 +8,7 @@ let
);
in
{
flake.modules.nixos.ssh-agent-auth = {
flake.modules.nixos.sudo-ssh-agent-auth = {
security.pam = {
rssh.enable = true;
services.sudo.rssh = true;
@@ -1,6 +1,6 @@
{ ... }:
{
flake.modules.nixos.standard-boot =
flake.modules.nixos.systemd-boot =
{ config, pkgs, ... }:
{
boot = {
-27
View File
@@ -2,31 +2,6 @@
let
repo = config.repo;
mkPrimaryTerminalOption =
lib:
lib.mkOption {
type = lib.types.submodule {
options = {
package = lib.mkOption {
type = lib.types.package;
};
command = lib.mkOption {
type = lib.types.str;
};
desktopId = lib.mkOption {
type = lib.types.str;
};
execArgs = lib.mkOption {
type = lib.types.listOf lib.types.str;
default = [ ];
};
};
};
};
mkPrimaryTerminal =
{
desktopId,
@@ -40,8 +15,6 @@ let
{
imports = [ terminalModule ];
options.repo.terminal.primary = mkPrimaryTerminalOption lib;
config = {
repo.terminal.primary = {
inherit