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,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" ];
};
};
}