1
0
Fork 0

full rewrite, first commit

This commit is contained in:
Philipp 2025-02-05 17:58:09 +01:00
commit a83c37a638
Signed by: Philipp
GPG key ID: 9EBD8439AFBAB750
24 changed files with 4358 additions and 0 deletions

View file

@ -0,0 +1,43 @@
{
config,
lib,
pkgs,
namespace,
...
}:
with lib;
with lib.${namespace};
let
cfg = config.${namespace}.apps.kitty;
defaultSettings = {
confirm_os_window_close = 0;
mouse_hide_wait = "-1.0";
dynamic_background_opacity = true;
editor = "nvim";
term = "xterm-256color";
adjust_line_height = 3;
copy_on_select = "clipboard";
cursor_shape = "Beam";
};
defaultFont = {
name = "Hack Nerd Font Mono";
package = pkgs.nerdfonts;
size = 12;
};
in
{
options.${namespace}.apps.kitty = with types; {
enable = mkBoolOpt false "Whether or not to enable kitty.";
settings = mkOpt attrs defaultSettings "Settings to apply to the profile.";
font = mkOpt attrs defaultFont "Customize default font settings.";
};
config = mkIf cfg.enable {
programs.kitty = {
enable = true;
themeFile = "Dracula";
inherit (cfg) font settings;
};
};
}

View file

@ -0,0 +1,87 @@
{
inputs,
config,
lib,
pkgs,
namespace,
...
}:
with lib;
with lib.${namespace};
let
cfg = config.${namespace}.apps.librewolf;
defaultSettings = {
"browser.startup.homepage" = "https://search.monapona.dev";
"browser.startup.page" = 3;
"privacy.resistFingerprinting" = false;
"privacy.fingerprintingProtection" = true;
"privacy.fingerprintingProtection.overrides" = "+AllTargets,-CSSPrefersColorScheme,-JSDateTimeUTC";
"privacy.clearOnShutdown.history" = false;
"signon.rememberSignons" = true;
"signon.storeWhenAutocompleteOff" = true;
"sidebar.verticalTabs" = true;
};
defaultExtensions = with inputs.firefox-addons.packages."x86_64-linux"; [
bitwarden
redirector
return-youtube-dislikes
sponsorblock
ublock-origin
seventv
];
defaultSearch = {
privateDefault = "SearXNG";
default = "SearXNG";
engines = {
"SearXNG" = {
urls = [ { template = "https://search.monapona.dev/search?q={searchTerms}"; } ];
iconUpdateURL = "https://search.monapona.dev/static/themes/simple/img/favicon.png";
definedAliases = [ "@s" ];
};
"My Nixos Packages" = {
urls = [ { template = "https://mynixos.com/search?q={searchTerms}"; } ];
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = [ "@np" ];
};
"NixOS Wiki" = {
urls = [ { template = "https://wiki.nixos.org/index.php?search={searchTerms}"; } ];
iconUpdateURL = "https://wiki.nixos.org/favicon.ico";
updateInterval = 24 * 60 * 60 * 1000;
definedAliases = [ "@nw" ];
};
};
};
in
{
options.${namespace}.apps.librewolf = with types; {
enable = mkBoolOpt false "Whether or not to enable Firefox.";
extraConfig = mkOpt str "" "Extra configuration for the user profile JS file.";
userChrome = mkOpt str "" "Extra configuration for the user chrome CSS file.";
settings = mkOpt attrs defaultSettings "Settings to apply to the profile.";
extensions = mkOpt (listOf package) defaultExtensions "Extra Librewolf extensions to install.";
search = mkOpt attrs defaultSearch "Extra search engines to define.";
};
config = mkIf cfg.enable {
programs.librewolf = {
enable = true;
package = pkgs.librewolf-wayland;
profiles."philipp" = {
inherit (cfg)
extraConfig
userChrome
settings
extensions
search
;
id = 0;
name = "Philipp";
isDefault = true;
};
};
};
}

View file

@ -0,0 +1,52 @@
{
lib,
config,
pkgs,
namespace,
...
}:
let
inherit (lib) mkEnableOption mkIf;
cfg = config.${namespace}.cli-apps.fish;
in
{
options.${namespace}.cli-apps.fish = {
enable = mkEnableOption "fish";
};
config = mkIf cfg.enable {
programs.fish = {
enable = true;
shellAliases = {
hm-update = "home-manager switch --flake ~/Documents/nix-config/ -b bk &| nom";
nix-update = "sudo sh -c 'nixos-rebuild --log-format internal-json -v switch --flake /home/philipp/Documents/nix-config/ |& nom --json'";
cd = "z";
};
plugins = [
{
name = "fzf";
src = pkgs.fishPlugins.fzf.src;
}
{
name = "hydro";
src = pkgs.fishPlugins.hydro.src;
}
{
name = "sponge";
src = pkgs.fishPlugins.sponge.src;
}
{
name = "z";
src = pkgs.fishPlugins.z.src;
}
];
};
programs.zoxide = {
enable = true;
enableFishIntegration = true;
};
};
}

View file

@ -0,0 +1,21 @@
{
lib,
config,
namespace,
...
}:
let
inherit (lib) mkEnableOption mkIf;
inherit (lib.${namespace}) enabled;
cfg = config.${namespace}.cli-apps.home-manager;
in
{
options.${namespace}.cli-apps.home-manager = {
enable = mkEnableOption "home-manager";
};
config = mkIf cfg.enable {
programs.home-manager = enabled;
};
}

View file

@ -0,0 +1,9 @@
{
lib,
osConfig ? { },
namespace,
...
}:
{
home.stateVersion = lib.mkDefault (osConfig.system.stateVersion or "24.11");
}

View file

@ -0,0 +1,49 @@
{
lib,
config,
pkgs,
namespace,
...
}:
let
inherit (lib) types mkEnableOption mkIf;
inherit (lib.${namespace}) mkOpt enabled;
cfg = config.${namespace}.tools.git;
user = config.${namespace}.user;
in
{
options.${namespace}.tools.git = {
enable = mkEnableOption "Git";
userName = mkOpt types.str "Philipp" "The name to configure git with.";
userEmail = mkOpt types.str "philipp@boehm.sh" "The email to configure git with.";
signingKey = mkOpt types.str "AA5E5A3C" "The key ID to sign commits with.";
signByDefault = mkOpt types.bool true "Whether to sign commits by default.";
};
config = mkIf cfg.enable {
programs.git = {
enable = true;
inherit (cfg) userName userEmail;
lfs = enabled;
signing = {
key = cfg.signingKey;
inherit (cfg) signByDefault;
};
extraConfig = {
init = {
defaultBranch = "main";
};
pull = {
rebase = true;
};
push = {
autoSetupRemote = true;
};
core = {
whitespace = "trailing-space,space-before-tab";
};
};
};
};
}

View file

@ -0,0 +1,39 @@
{
lib,
config,
pkgs,
namespace,
...
}:
let
inherit (lib) mkEnableOption mkIf;
cfg = config.${namespace}.tools.neovim;
in
{
options.${namespace}.tools.neovim = {
enable = mkEnableOption "Neovim";
};
config = mkIf cfg.enable {
home = {
packages = with pkgs; [
less
plusultra.neovim
];
sessionVariables = {
EDITOR = "nvim";
};
shellAliases = {
vimdiff = "nvim -d";
};
};
xdg.configFile = {
"dashboard-nvim/.keep".text = "";
};
};
}

View file

@ -0,0 +1,27 @@
{
options,
config,
lib,
pkgs,
namespace,
...
}:
with lib;
with lib.${namespace};
let
cfg = config.${namespace}.apps.steam;
in
{
options.${namespace}.apps.steam = with types; {
enable = mkBoolOpt false "Whether or not to enable support for Steam.";
};
config = mkIf cfg.enable {
programs.steam.enable = true;
programs.steam.remotePlay.openFirewall = true;
hardware.steam-hardware.enable = true;
environment.systemPackages = with pkgs; [ steam ];
};
}

View file

@ -0,0 +1,55 @@
{
options,
config,
lib,
pkgs,
namespace,
...
}:
with lib;
with lib.${namespace};
let
cfg = config.${namespace}.cli.neovim;
in
{
options.${namespace}.cli.neovim = with types; {
enable = mkBoolOpt false "Whether or not to enable neovim.";
};
config = mkIf cfg.enable {
programs.nvf = {
enable = true;
settings = {
vim.viAlias = true;
vim.vimAlias = true;
vim.lsp.enable = true;
vim.theme.enable = true;
vim.theme.name = "tokyonight";
vim.theme.style = "night";
vim.languages.nix.enable = true;
vim.statusline.lualine.enable = true;
vim.telescope.enable = true;
vim.autocomplete.nvim-cmp.enable = true;
vim.languages.enableLSP = true;
vim.languages.enableTreesitter = true;
vim.options.tabstop = 2;
vim.undoFile.enable = true;
vim.options.shiftwidth = 2;
vim.filetree.neo-tree = {
enable = true;
setupOpts = {
};
};
vim.keymaps = [
{
key = "<C-n>";
mode = [ "n" ];
action = "<CMD>Neotree toggle<CR>";
desc = "Toggles neo-tree";
}
];
};
};
};
}

View file

@ -0,0 +1,58 @@
{
options,
config,
lib,
pkgs,
namespace,
...
}:
with lib;
with lib.${namespace};
let
cfg = config.${namespace}.desktop.plasma;
excludePackages = with pkgs.kdePackages; [
konsole
elisa
krdp
];
default-attrs = mapAttrs (key: mkDefault);
nested-default-attrs = mapAttrs (key: default-attrs);
in
{
options.${namespace}.desktop.plasma = with types; {
enable = mkBoolOpt false "Whether or not to use Plasma as the desktop environment.";
extraExcludePackages = mkOpt (listOf package) [ ] "Extra packages to exclude";
};
config = mkIf cfg.enable {
services.desktopManager.plasma6.enable = true;
services.displayManager = {
sddm = {
enable = true;
wayland.enable = true;
settings = {
Autologin = {
Session = "plasma.desktop";
User = "philipp";
};
Theme = {
EnableAvatars = true;
};
};
};
};
environment.plasma6.excludePackages =
with pkgs.kdePackages;
[ ] ++ excludePackages ++ cfg.extraExcludePackages;
environment.systemPackages = with pkgs; [
pinentry-qt
kdiskmark
kdePackages.networkmanager-qt
];
};
}

View file

@ -0,0 +1,88 @@
{
options,
config,
pkgs,
lib,
namespace,
...
}:
with lib;
with lib.${namespace};
let
cfg = config.${namespace}.hardware.audio;
in
{
options.${namespace}.hardware.audio = with types; {
enable = mkBoolOpt false "Whether or not to enable audio support.";
extra-packages = mkOpt (listOf package) [ ] "Additional packages to install.";
};
config = mkIf cfg.enable {
services.pipewire = {
enable = true;
alsa.enable = true;
pulse.enable = true;
jack.enable = true;
wireplumber.enable = true;
};
hardware.pulseaudio.enable = mkForce false;
environment.systemPackages =
with pkgs;
[
pulsemixer
pavucontrol
]
++ cfg.extra-packages;
services.pipewire.extraConfig.pipewire = {
"90-nullsink" = {
"context.object" = [
{
factory = "adapter";
args = {
"factory.name" = "support.null-audio-sink";
"node.name" = "Null Sink";
"media.class" = "Audio/Sink";
"audio.position" = "[ FL FR ]";
"monitor.channel-volumes" = "true";
"monitor.passthrough" = "true";
"adapter.auto-port-config" = {
"mode" = "dsp";
"monitor" = "true";
"position" = "preserve";
};
};
}
];
};
"90-loopback" = {
"context.modules" = [
{
name = "libpipewire-module-loopback";
args = {
"node.description" = "Scarlett 2i2 Loopback";
"capture.props" = {
"node.name" = "Scarlett_2i2_Loopback";
"media.class" = "Audio/Sink";
"audio.position" = "[ FL FR ]";
};
"playback.props" = {
"node.name" = "playback.Scarlett_2i2_Loopback";
"audio.position" = "[ AUX0 AUX1 ]";
"target.object" = "alsa_output.usb-Focusrite_Scarlett_2i2_USB-00.pro-output-0";
"stream.dont-reconnect" = "true";
"node.dont-reconnect" = "false";
"node.passive" = "true";
};
};
}
];
};
};
};
}

View file

@ -0,0 +1,24 @@
{
lib,
config,
pkgs,
namespace,
...
}:
with lib;
with lib.${namespace};
let
cfg = config.${namespace}.services.btrfs;
in
{
options.${namespace}.services.btrfs = {
enable = mkBoolOpt true "BTRFS";
};
config = mkIf cfg.enable {
services.btrfs.autoScrub.enable = true;
services.fstrim.enable = true;
environment.systemPackages = with pkgs; [ btrfs-progs ];
};
}

View file

@ -0,0 +1,55 @@
{
lib,
config,
pkgs,
namespace,
...
}:
with lib;
with lib.${namespace};
let
cfg = config.${namespace}.services.caddy;
in
{
options.${namespace}.services.caddy = {
enable = mkEnableOption "Caddy";
};
config = mkIf cfg.enable {
services.caddy = {
enable = true;
virtualHosts = {
":1338" = {
extraConfig = ''
root * /var/lib/caddy/ente
file_server
'';
};
":8686" = {
extraConfig = ''
root * /var/lib/caddy/cinny
file_server
@index {
not path /index.html
not path /public/*
not path /assets/*
not path /config.json
not path /manifest.json
not path /pdf.worker.min.js
not path /olm.wasm
path /*
}
rewrite /*/olm.wasm /olm.wasm
rewrite @index /index.html
'';
};
};
};
};
}

View file

@ -0,0 +1,30 @@
{
lib,
config,
pkgs,
namespace,
...
}:
with lib;
with lib.${namespace};
let
cfg = config.${namespace}.services.invidious;
in
{
options.${namespace}.services.invidious = {
enable = mkEnableOption "Invidious";
domain = mkOption {
type = types.string;
default = "localhost";
description = "Domain to use for absolute URLs";
};
};
config = mkIf cfg.enable {
services.invidious = {
enable = true;
domain = cfg.domain;
extraSettingsFile = "/var/lib/invidious/settings.yml";
};
};
}

View file

@ -0,0 +1,77 @@
{
options,
config,
pkgs,
lib,
namespace,
...
}:
with lib;
with lib.${namespace};
let
cfg = config.${namespace}.system.fonts;
in
{
options.${namespace}.system.fonts = with types; {
enable = mkBoolOpt false "Whether or not to manage fonts.";
emoji = mkBoolOpt false "Whether or not to enable emojis.";
fonts = mkOpt (listOf package) [ ] "Custom font packages to install.";
};
config = mkIf cfg.enable {
environment.variables = {
LOG_ICONS = "true";
};
environment.systemPackages = with pkgs; [ font-manager ];
fonts = {
fontconfig = mkIf cfg.emoji {
enable = true;
localConf = ''
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<alias binding="weak">
<family>monospace</family>
<prefer>
<family>emoji</family>
</prefer>
</alias>
<alias binding="weak">
<family>sans-serif</family>
<prefer>
<family>emoji</family>
</prefer>
</alias>
<alias binding="weak">
<family>serif</family>
<prefer>
<family>emoji</family>
</prefer>
</alias>
</fontconfig>
'';
defaultFonts = {
emoji = [ "Noto Color Emoji" ];
monospace = [ "FreeMono" ];
sansSerif = [ "FreeSans" ];
serif = [ "FreeSerif" ];
};
};
packages =
with pkgs;
[
twemoji-color-font
noto-fonts
noto-fonts-cjk-sans
noto-fonts-cjk-serif
noto-fonts-emoji
(nerdfonts.override { fonts = [ "Hack" ]; })
]
++ cfg.fonts;
};
};
}

View file

@ -0,0 +1,23 @@
{
options,
config,
pkgs,
lib,
namespace,
...
}:
with lib;
with lib.${namespace};
let
cfg = config.${namespace}.user;
in
{
programs.fish = {
enable = true;
};
users.users.philipp = {
isNormalUser = true;
shell = pkgs.fish;
};
}

View file

@ -0,0 +1,25 @@
{ lib, config, pkgs, namespace, ... }:
with lib;
with lib.${namespace};
let
cfg = config.${namespace}.container.technitium;
in
{
options.${namespace}.container.technitium = {
enable = mkEnableOption "Technitium";
};
config = mkIf cfg.enable {
virtualisation.oci-containers.containers.technitium = {
image = "technitium/dns-server";
hostname = "blarm-dns";
ports = [
"192.168.1.202:5380:5380"
"192.168.1.202:53:53"
"[fd00:192:168:1::202]:53:53"
"[fd00:192:168:1::202]:5380:5380"
];
volumes = [ "config:/etc/dns" ];
};
};
}