1

Reformat using alejandra

This commit is contained in:
2023-05-24 14:55:07 +02:00
parent c46b68b7dc
commit 76d13c61ba
7 changed files with 64 additions and 59 deletions

View File

@ -6,7 +6,7 @@
... ...
}: let }: let
# create a module that only contains the options # create a module that only contains the options
toModule = name: {options.modules.${name} = (import ../../home/modules/${name}/options.nix {inherit lib mylib;});}; toModule = name: {options.modules.${name} = import ../../home/modules/${name}/options.nix {inherit lib mylib;};};
# evaluate a single module # evaluate a single module
evalModule = name: (lib.evalModules {modules = [(toModule name)];}); evalModule = name: (lib.evalModules {modules = [(toModule name)];});
@ -15,17 +15,18 @@
optionsDoc = name: pkgs.nixosOptionsDoc {options = (evalModule name).options;}; optionsDoc = name: pkgs.nixosOptionsDoc {options = (evalModule name).options;};
# copy the markdown for a single generated optionsDoc # copy the markdown for a single generated optionsDoc
optionsMD = name: stdenv.mkDerivation { optionsMD = name:
src = ./.; stdenv.mkDerivation {
name = "options-doc-${name}"; src = ./.;
buildPhase = '' name = "options-doc-${name}";
mkdir $out buildPhase = ''
cat ${(optionsDoc name).optionsCommonMark} >> $out/${name}.md mkdir $out
''; cat ${(optionsDoc name).optionsCommonMark} >> $out/${name}.md
}; '';
};
# copy the markdown for all generated optionsDocs # copy the markdown for all generated optionsDocs
allOptionsMDs = let allOptionsMDs = let
index = stdenv.mkDerivation { index = stdenv.mkDerivation {
src = ./.; src = ./.;
name = "modules-options-index-md"; name = "modules-options-index-md";
@ -34,11 +35,12 @@
echo "# Chriphost NixOS Modules Options" >> $out/index.md echo "# Chriphost NixOS Modules Options" >> $out/index.md
''; '';
}; };
in in
names: pkgs.symlinkJoin { names:
name = "modules-options-doc-md"; pkgs.symlinkJoin {
paths = (map optionsMD names) ++ [index]; name = "modules-options-doc-md";
}; paths = (map optionsMD names) ++ [index];
};
# generate the actual package (calls all of the above) # generate the actual package (calls all of the above)
modules = [ modules = [

View File

@ -5,23 +5,19 @@
fetchurl, fetchurl,
fetchFromGitHub, fetchFromGitHub,
gsettings-desktop-schemas, gsettings-desktop-schemas,
gtk3 gtk3,
}: }:
# TODO: This doesn't run. Why does it work like this (APPIMAGE_DEBUG_EXEC=bash appimage-run WiiUDownloader-Linux-x86_64.AppImage) though? # TODO: This doesn't run. Why does it work like this (APPIMAGE_DEBUG_EXEC=bash appimage-run WiiUDownloader-Linux-x86_64.AppImage) though?
# pkgs.appimageTools.wrapType2 rec { # pkgs.appimageTools.wrapType2 rec {
# name = "WiiUDownloader"; # name = "WiiUDownloader";
# version = "v1.32"; # version = "v1.32";
# src = fetchurl { # src = fetchurl {
# url = "https://github.com/Xpl0itU/WiiUDownloader/releases/download/${version}/WiiUDownloader-Linux-x86_64.AppImage"; # url = "https://github.com/Xpl0itU/WiiUDownloader/releases/download/${version}/WiiUDownloader-Linux-x86_64.AppImage";
# sha256 = "sha256-YWLQd/Wmz5BDyc+oe6JQkT849DaPc5HtJXIDZKUdHNE="; # sha256 = "sha256-YWLQd/Wmz5BDyc+oe6JQkT849DaPc5HtJXIDZKUdHNE=";
# }; # };
# profile = '' # profile = ''
# export XDG_DATA_DIRS=${gsettings-desktop-schemas}/share/gsettings-schemas/${gsettings-desktop-schemas.name}:${gtk3}/share/gsettings-schemas/${gtk3.name}:$XDG_DATA_DIRS # export XDG_DATA_DIRS=${gsettings-desktop-schemas}/share/gsettings-schemas/${gsettings-desktop-schemas.name}:${gtk3}/share/gsettings-schemas/${gtk3.name}:$XDG_DATA_DIRS
# ''; # '';
# # extraPkgs = pkgs: with pkgs; [ # # extraPkgs = pkgs: with pkgs; [
# # ]; # # ];
# } # }
@ -83,6 +79,7 @@ let
runHook postInstall runHook postInstall
''; '';
}; };
in pkgs.writeShellScriptBin "wiiu-downloader-wrapped" '' in
XDG_DATA_DIRS="${gsettings-desktop-schemas}/share/gsettings-schemas/${gsettings-desktop-schemas.name}:${gtk3}/share/gsettings-schemas/${gtk3.name}:$XDG_DATA_DIRS" ${wiiu-downloader}/bin/WiiUDownloader pkgs.writeShellScriptBin "wiiu-downloader-wrapped" ''
'' XDG_DATA_DIRS="${gsettings-desktop-schemas}/share/gsettings-schemas/${gsettings-desktop-schemas.name}:${gtk3}/share/gsettings-schemas/${gtk3.name}:$XDG_DATA_DIRS" ${wiiu-downloader}/bin/WiiUDownloader
''

View File

@ -23,7 +23,7 @@ rec {
kb-layout = "us"; kb-layout = "us";
kb-variant = "altgr-intl"; kb-variant = "altgr-intl";
monitors = '' monitors = ''
# See https://wiki.hyprland.org/Configuring/Monitors/ # See https://wiki.hyprland.org/Configuring/Monitors/
monitor = HDMI-A-1, 2560x1440@144, 1920x0, 1 monitor = HDMI-A-1, 2560x1440@144, 1920x0, 1

View File

@ -26,7 +26,7 @@ rec {
kb-layout = "us"; kb-layout = "us";
kb-variant = "altgr-intl"; kb-variant = "altgr-intl";
monitors = '' monitors = ''
# See https://wiki.hyprland.org/Configuring/Monitors/ # See https://wiki.hyprland.org/Configuring/Monitors/
monitor = eDP-1, 1920x1080@60, 0x0, 1 monitor = eDP-1, 1920x1080@60, 0x0, 1

View File

@ -77,25 +77,23 @@ with mylib.modules;
linkFontDir = linkFontDir =
lib.hm.dag.entryAfter ["writeBoundary"] lib.hm.dag.entryAfter ["writeBoundary"]
(mkLink "/run/current-system/sw/share/X11/fonts" "${config.home.homeDirectory}/.local/share/fonts/fonts"); (mkLink "/run/current-system/sw/share/X11/fonts" "${config.home.homeDirectory}/.local/share/fonts/fonts");
copyBaseFonts = copyBaseFonts = lib.hm.dag.entryAfter ["writeBoundary"] ''
lib.hm.dag.entryAfter ["writeBoundary"] '' cp -f ${pkgs.lxgw-wenkai}/share/fonts/truetype/LXGWWenKaiMono-Regular.ttf ${config.home.homeDirectory}/.local/share/fonts/
cp -f ${pkgs.lxgw-wenkai}/share/fonts/truetype/LXGWWenKaiMono-Regular.ttf ${config.home.homeDirectory}/.local/share/fonts/ cp -f ${pkgs.nerdfonts.override {fonts = ["JetBrainsMono"];}}/share/fonts/truetype/NerdFonts/JetBrainsMonoNerdFontMono-Regular.ttf ${config.home.homeDirectory}/.local/share/fonts/
cp -f ${pkgs.nerdfonts.override {fonts = ["JetBrainsMono"];}}/share/fonts/truetype/NerdFonts/JetBrainsMonoNerdFontMono-Regular.ttf ${config.home.homeDirectory}/.local/share/fonts/ cp -f ${pkgs.noto-fonts}/share/fonts/noto/NotoSans[wdth,wght].ttf ${config.home.homeDirectory}/.local/share/fonts/
cp -f ${pkgs.noto-fonts}/share/fonts/noto/NotoSans[wdth,wght].ttf ${config.home.homeDirectory}/.local/share/fonts/ cp -f ${pkgs.noto-fonts-emoji}/share/fonts/noto/NotoColorEmoji.ttf ${config.home.homeDirectory}/.local/share/fonts/
cp -f ${pkgs.noto-fonts-emoji}/share/fonts/noto/NotoColorEmoji.ttf ${config.home.homeDirectory}/.local/share/fonts/ '';
'';
}) })
(mkElse cfg.fontFix { (mkElse cfg.fontFix {
unlinkFontDir = unlinkFontDir =
lib.hm.dag.entryAfter ["writeBoundary"] lib.hm.dag.entryAfter ["writeBoundary"]
(mkUnlink "${config.home.homeDirectory}/.local/share/fonts/fonts"); (mkUnlink "${config.home.homeDirectory}/.local/share/fonts/fonts");
deleteBaseFonts = deleteBaseFonts = lib.hm.dag.entryAfter ["writeBoundary"] ''
lib.hm.dag.entryAfter ["writeBoundary"] '' rm ${config.home.homeDirectory}/.local/share/fonts/LXGWWenKaiMono-Regular.ttf
rm ${config.home.homeDirectory}/.local/share/fonts/LXGWWenKaiMono-Regular.ttf rm ${config.home.homeDirectory}/.local/share/fonts/JetBrainsMonoNerdFontMono-Regular.ttf
rm ${config.home.homeDirectory}/.local/share/fonts/JetBrainsMonoNerdFontMono-Regular.ttf rm ${config.home.homeDirectory}/.local/share/fonts/NotoSans[wdth,wght].ttf
rm ${config.home.homeDirectory}/.local/share/fonts/NotoSans[wdth,wght].ttf rm ${config.home.homeDirectory}/.local/share/fonts/NotoColorEmoji.ttf
rm ${config.home.homeDirectory}/.local/share/fonts/NotoColorEmoji.ttf '';
'';
}) })
# Fixes missing icons + cursor # Fixes missing icons + cursor

View File

@ -9,7 +9,7 @@
config, config,
pkgs, pkgs,
... ...
}: }:
with mylib.networking; { with mylib.networking; {
imports = [ imports = [
# Import my system modules # Import my system modules
@ -32,14 +32,16 @@ with mylib.networking; {
}; };
wireguard-tunnels = { wireguard-tunnels = {
wg0-de-115 = (mkWireguardService wg0-de-115 = (
mkWireguardService
"wg0-de-115" "wg0-de-115"
"proton-de-115.key" "proton-de-115.key"
"9+CorlxrTsQR7qjIOVKsEkk8Z7UUS5WT3R1ccF7a0ic=" "9+CorlxrTsQR7qjIOVKsEkk8Z7UUS5WT3R1ccF7a0ic="
"194.126.177.14" "194.126.177.14"
); );
wg0-lu-16 = (mkWireguardService wg0-lu-16 = (
mkWireguardService
"wg0-lu-16" "wg0-lu-16"
"proton-lu-16.key" "proton-lu-16.key"
"asu9KtQoZ3iKwELsDTgjPEiFNcD1XtgGgy3O4CZFg2w=" "asu9KtQoZ3iKwELsDTgjPEiFNcD1XtgGgy3O4CZFg2w="
@ -302,9 +304,11 @@ with mylib.networking; {
# NOTE: Don't do this with HomeManager as I need the fonts in the fontdir for flatpak apps # NOTE: Don't do this with HomeManager as I need the fonts in the fontdir for flatpak apps
fonts = with pkgs; [ fonts = with pkgs; [
# Monospace fonts # Monospace fonts
(nerdfonts.override {fonts = [ (nerdfonts.override {
"JetBrainsMono" fonts = [
];}) "JetBrainsMono"
];
})
# Sans/Serif fonts # Sans/Serif fonts
noto-fonts noto-fonts
@ -318,9 +322,9 @@ with mylib.networking; {
fontconfig = { fontconfig = {
enable = true; enable = true;
defaultFonts = { defaultFonts = {
serif = [ "Noto Serif CJK SC" ]; serif = ["Noto Serif CJK SC"];
sansSerif = [ "Noto Sans CJK SC" ]; sansSerif = ["Noto Sans CJK SC"];
monospace = [ "JetBrainsMono Nerd Font Mono" ]; monospace = ["JetBrainsMono Nerd Font Mono"];
}; };
}; };
}; };

View File

@ -135,7 +135,7 @@
hydra = { hydra = {
image = "linuxserver/nzbhydra2:5.1.8"; image = "linuxserver/nzbhydra2:5.1.8";
autoStart = false; autoStart = false;
extraOptions = [ extraOptions = [
"--network=ns:/var/run/netns/vpn" "--network=ns:/var/run/netns/vpn"
"--dns=10.2.0.1" "--dns=10.2.0.1"
@ -238,17 +238,21 @@
# Make the system services available to the user # Make the system services available to the user
# NOTE: This doesn't work, since the cidfile is located in /run, which is not writable for regular users... # NOTE: This doesn't work, since the cidfile is located in /run, which is not writable for regular users...
systemd.user.services = let systemd.user.services = let
# Filter all system service attributes that the user units don't have and add some required attributes # Filter all system service attributes that the user units don't have and add some required attributes
system2user = attrs: lib.mergeAttrs (lib.attrsets.filterAttrs (n: v: !( system2user = attrs:
n == "confinement" || lib.mergeAttrs (lib.attrsets.filterAttrs (n: v:
n == "runner" || !(
n == "environment" n
)) attrs) { == "confinement"
startLimitIntervalSec = 1; || n == "runner"
startLimitBurst = 5; || n == "environment"
}; ))
attrs) {
startLimitIntervalSec = 1;
startLimitBurst = 5;
};
in { in {
# podman-stablediffusion = system2user config.systemd.services.podman-stablediffusion; # podman-stablediffusion = system2user config.systemd.services.podman-stablediffusion;
}; };
} }