refactor: desktop default applications

This commit is contained in:
2026-04-27 17:28:34 +02:00
parent 93624900ad
commit 088080590c
10 changed files with 106 additions and 76 deletions
+36 -9
View File
@@ -1,20 +1,47 @@
{ config, ... }:
{ ... }:
let
repo = config.repo;
mkPrimaryDesktopApplication =
{
name,
package,
command,
desktopId,
}:
{ pkgs, ... }:
{
meta.desktop.${name} = {
inherit command desktopId;
package = package pkgs;
};
};
in
{
flake.modules.homeManager.primary-browser-vivaldi = mkPrimaryDesktopApplication {
name = "browser";
package = pkgs: pkgs.vivaldi;
command = "vivaldi";
desktopId = "vivaldi-stable.desktop";
};
flake.modules.homeManager.primary-file-manager-nautilus = mkPrimaryDesktopApplication {
name = "fileManager";
package = pkgs: pkgs.nautilus;
command = "nautilus";
desktopId = "org.gnome.Nautilus.desktop";
};
flake.modules.homeManager.desktop-defaults =
{ config, pkgs, ... }:
let
browserPackage = pkgs.${repo.desktop.browser.packageAttr};
fileManagerPackage = pkgs.${repo.desktop.fileManager.packageAttr};
browser = config.meta.desktop.browser;
fileManager = config.meta.desktop.fileManager;
homeDir = config.home.homeDirectory;
localDir = "${homeDir}/.local";
mediaDir = "${homeDir}/media";
in
{
home.preferXdgDirectories = true;
home.sessionVariables.BROWSER = repo.desktop.browser.command;
home.sessionVariables.BROWSER = browser.command;
home.packages =
with pkgs;
@@ -28,8 +55,8 @@ in
dbeaver-bin
]
++ [
browserPackage
fileManagerPackage
browser.package
fileManager.package
];
programs.imv.enable = true;
@@ -69,8 +96,8 @@ in
neovim
]
++ [
browserPackage
fileManagerPackage
fileManager.package
browser.package
];
};
};
+17 -9
View File
@@ -1,15 +1,23 @@
{ config, ... }:
let
nixosModules = config.flake.modules.nixos;
in
{
flake.modules.nixos.server-firewall = {
networking = {
firewall.enable = true;
firewall.allowPing = false;
};
flake.modules.nixos.nftables-firewall = {
networking.nftables.enable = true;
};
flake.modules.nixos.network-manager = {
networking = {
nftables.enable = true;
networkmanager.enable = true;
};
networking.networkmanager.enable = true;
};
flake.modules.nixos.server-firewall =
{ ... }:
{
imports = [
nixosModules.nftables-firewall
];
networking.firewall.allowPing = false;
};
}
+3 -3
View File
@@ -32,9 +32,9 @@ in
}:
let
repoTheme = repo.theme.kanagawa;
browserCommand = repo.desktop.browser.command;
fileManagerPackage = pkgs.${repo.desktop.fileManager.packageAttr};
terminalCommand = config.repo.terminal.primary.command;
browserCommand = config.meta.desktop.browser.command;
fileManagerPackage = config.meta.desktop.fileManager.package;
terminalCommand = config.meta.terminal.command;
outputs = lib.mapAttrs (
_: display:
{
+1 -1
View File
@@ -68,7 +68,7 @@ in
baseSettings = mkBaseSettings {
inherit lib;
homeDirectory = config.home.homeDirectory;
terminal = config.repo.terminal.primary;
terminal = config.meta.terminal;
};
settings =
if baseSettings == { } || !osConfig.meta.machine.portable then
+13 -2
View File
@@ -5,20 +5,31 @@
let
repo = config.repo;
account = repo.account;
homeModules = config.flake.modules.homeManager;
in
{
flake.modules.homeManager.pinentry =
{ pkgs, ... }:
{
meta.pinentry.package = pkgs.pinentry-gnome3;
};
flake.modules.homeManager.passwords =
{
pkgs,
config,
...
}:
{
imports = [
homeModules.pinentry
];
programs.rbw = {
enable = true;
settings = {
base_url = repo.services.vaultwarden.url;
email = account.primaryEmail.address;
pinentry = pkgs.pinentry-gnome3;
pinentry = config.meta.pinentry.package;
};
};
};
+4 -4
View File
@@ -2,7 +2,7 @@
let
repo = config.repo;
mkPrimaryTerminal =
mkTerminal =
{
desktopId,
packageFor,
@@ -16,7 +16,7 @@ let
imports = [ terminalModule ];
config = {
repo.terminal.primary = {
meta.terminal = {
inherit
desktopId
package
@@ -155,13 +155,13 @@ in
};
};
flake.modules.homeManager.primary-terminal-foot = mkPrimaryTerminal {
flake.modules.homeManager.primary-terminal-foot = mkTerminal {
desktopId = "foot.desktop";
packageFor = pkgs: pkgs.foot;
terminalModule = config.flake.modules.homeManager.terminal-foot;
};
flake.modules.homeManager.primary-terminal-kitty = mkPrimaryTerminal {
flake.modules.homeManager.primary-terminal-kitty = mkTerminal {
desktopId = "kitty.desktop";
packageFor = pkgs: pkgs.kitty;
terminalModule = config.flake.modules.homeManager.terminal-kitty;