reformat according to rfc standard

This commit is contained in:
Thilo Billerbeck 2024-05-28 14:38:22 +02:00
parent 5da37d8133
commit 3bceb198a8
34 changed files with 480 additions and 306 deletions

View file

@ -1,5 +1,11 @@
{ lib, pkgs, config, ... }:
with lib; {
{
lib,
pkgs,
config,
...
}:
with lib;
{
imports = [
./../programs/atuin.nix
./../programs/alacritty.nix
@ -80,8 +86,7 @@ with lib; {
'';
".ssh/config_source" = {
source = ./../dotfiles/ssh-config;
onChange =
"cat ~/.ssh/config_source > ~/.ssh/config && chmod 600 ~/.ssh/config";
onChange = "cat ~/.ssh/config_source > ~/.ssh/config && chmod 600 ~/.ssh/config";
};
".gitignore".source = ./../dotfiles/.gitignore;
".config/pipewire/pipewire.conf.d/99-noise-suppression.conf".text = ''
@ -131,4 +136,3 @@ with lib; {
};
};
}

View file

@ -1,10 +1,15 @@
{ config, pkgs, lib, inputs, ... }:
{
config,
pkgs,
lib,
inputs,
...
}:
with lib;
let
nixGL = import ./../../home-manager/utils/nixGLWrap.nix { inherit pkgs config; };
electronFlags =
"--enable-features=UseOzonePlatform --ozone-platform=wayland --enable-wayland-ime --disable-gpu-shader-disk-cache -n";
electronFlags = "--enable-features=UseOzonePlatform --ozone-platform=wayland --enable-wayland-ime --disable-gpu-shader-disk-cache -n";
in
{
config = {
@ -16,14 +21,15 @@ in
})
];
home.packages = with pkgs;
home.packages =
with pkgs;
[
pkgs.nixVersions.latest # because remotely invoked updates are fun ;)
up
htop
rustc
cargo
nixfmt
nixfmt-rfc-style
nodejs
bun
deno
@ -40,12 +46,11 @@ in
hub
httpie
manix
(pkgs.writeShellScriptBin "ssh-fix-permissions"
(builtins.readFile ./../scripts/ssh-fix-permissions.sh))
(pkgs.writeShellScriptBin "yt-dlp-audio"
(builtins.readFile ./../scripts/yt-dlp-audio.sh))
(pkgs.writeShellScriptBin "nix-shell-init"
(builtins.readFile ./../scripts/nix-shell-init.sh))
(pkgs.writeShellScriptBin "ssh-fix-permissions" (
builtins.readFile ./../scripts/ssh-fix-permissions.sh
))
(pkgs.writeShellScriptBin "yt-dlp-audio" (builtins.readFile ./../scripts/yt-dlp-audio.sh))
(pkgs.writeShellScriptBin "nix-shell-init" (builtins.readFile ./../scripts/nix-shell-init.sh))
(pkgs.writeShellScriptBin "http-server" ''
${pkgs.caddy}/bin/caddy file-server --listen :2345
'')
@ -72,84 +77,94 @@ in
inputs.w17.packages.x86_64-linux.default
aichat
(pkgs.nerdfonts.override {
fonts = [ "JetBrainsMono" "FiraCode" "FiraMono" ];
fonts = [
"JetBrainsMono"
"FiraCode"
"FiraMono"
];
})
nix-output-monitor
nodePackages.pnpm
npm-check-updates
] ++ (
if (
!config.machine.isGeneric
) then [
toolbox
distrobox
] else
]
++ (
if (!config.machine.isGeneric) then
[
toolbox
distrobox
]
else
[ ]
) ++ (
if (
config.machine.isGraphical
) then [
(nixGL insomnia)
(nixGL comma)
] else
)
++ (
if (config.machine.isGraphical) then
[
(nixGL insomnia)
(nixGL comma)
]
else
[ ]
) ++ (
if (
config.machine.isGraphical && !config.machine.isGeneric
) then [
corefonts
vistafonts
jetbrains.webstorm
jetbrains.phpstorm
jetbrains.rust-rover
jetbrains.goland
element-desktop
ludusavi
dbeaver
onlyoffice-bin
spotify
vesktop
(lutris.override {
extraLibraries = _: [ gnome3.adwaita-icon-theme ];
extraPkgs = _: [
wineWowPackages.full
winetricks
gnome3.adwaita-icon-theme
];
})
bottles
protontricks
heroic
(vscode.override { commandLineArgs = electronFlags; })
quickemu
quickgui
trilium-desktop
anki
# inputs.muse-sounds-manager.packages.x86_64-linux.muse-sounds-manager
jetbrains-toolbox
mumble
prusa-slicer
trayscale
gnome.gnome-disk-utility
inkscape
musescore
obsidian
syncthingtray
reaper
yabridge
inputs.suyu.packages.x86_64-linux.suyu
inputs.nix-alien.packages.x86_64-linux.nix-alien
kdePackages.kdenlive
audacity
] else
)
++ (
if (config.machine.isGraphical && !config.machine.isGeneric) then
[
jetbrains.webstorm
jetbrains.phpstorm
jetbrains.rust-rover
jetbrains.goland
element-desktop
ludusavi
dbeaver
onlyoffice-bin
spotify
vesktop
(lutris.override {
extraLibraries = _: [ gnome3.adwaita-icon-theme ];
extraPkgs = _: [
wineWowPackages.full
winetricks
gnome3.adwaita-icon-theme
];
})
bottles
protontricks
heroic
(vscode.override { commandLineArgs = electronFlags; })
quickemu
quickgui
trilium-desktop
anki
# inputs.muse-sounds-manager.packages.x86_64-linux.muse-sounds-manager
jetbrains-toolbox
mumble
prusa-slicer
trayscale
gnome.gnome-disk-utility
inkscape
musescore
obsidian
syncthingtray
reaper
yabridge
inputs.suyu.packages.x86_64-linux.suyu
inputs.nix-alien.packages.x86_64-linux.nix-alien
kdePackages.kdenlive
audacity
]
else
[ ]
) ++ (if config.machine.isGnome then [
gnomeExtensions.blur-my-shell
gnomeExtensions.dash-to-panel
gnomeExtensions.user-themes
gnomeExtensions.vitals
gnomeExtensions.custom-accent-colors
] else
[ ]);
)
++ (
if config.machine.isGnome then
[
gnomeExtensions.blur-my-shell
gnomeExtensions.dash-to-panel
gnomeExtensions.user-themes
gnomeExtensions.vitals
gnomeExtensions.custom-accent-colors
]
else
[ ]
);
};
}

View file

@ -1,4 +1,8 @@
{ lib, stdenv, fetchFromGitHub }:
{
lib,
stdenv,
fetchFromGitHub,
}:
stdenv.mkDerivation rec {
pname = "docker-craft-cms-dev-env";
@ -17,8 +21,7 @@ stdenv.mkDerivation rec {
'';
meta = with lib; {
description =
"Docker image for local development of sites based on Craft CMS";
description = "Docker image for local development of sites based on Craft CMS";
homepage = "https://github.com/codemonauts/docker-craft-cms-dev-env";
license = licenses.mit;
maintainers = with maintainers; [ ];

View file

@ -1,24 +1,24 @@
{ pkgs }:
/* SOURCE: https://ostechnix.com/a-bash-function-to-extract-file-archives-of-various-types/ */
# SOURCE: https://ostechnix.com/a-bash-function-to-extract-file-archives-of-various-types/
pkgs.writeShellScriptBin "extract" ''
if [ -f $1 ] ; then
case $1 in
*.tar.bz2) ${pkgs.gnutar}/bin/tar xjf $1 ;;
*.tar.gz) ${pkgs.gnutar}/bin/tar $1 ;;
*.bz2) ${pkgs.bzip2}/bin/bunzip2 $1 ;;
*.rar) ${pkgs.rar}/bin/rar x $1 ;;
*.gz) ${pkgs.gzip}/bin/gunzip $1 ;;
*.tar) ${pkgs.gnutar}/bin/tar xf $1 ;;
*.tbz2) ${pkgs.gnutar}/bin/tar xjf $1 ;;
*.tgz) ${pkgs.gnutar}/bin/tar xzf $1 ;;
*.zip) ${pkgs.unzip}/bin/unzip $1 ;;
*.Z) ${pkgs.gzip}/bin/uncompress $1 ;;
*.7z) ${pkgs._7zz}/bin/7z x $1 ;;
*) echo "'$1' cannot be extracted via extract()" ;;
esac
else
echo "'$1' is not a valid file"
fi
''
if [ -f $1 ] ; then
case $1 in
*.tar.bz2) ${pkgs.gnutar}/bin/tar xjf $1 ;;
*.tar.gz) ${pkgs.gnutar}/bin/tar $1 ;;
*.bz2) ${pkgs.bzip2}/bin/bunzip2 $1 ;;
*.rar) ${pkgs.rar}/bin/rar x $1 ;;
*.gz) ${pkgs.gzip}/bin/gunzip $1 ;;
*.tar) ${pkgs.gnutar}/bin/tar xf $1 ;;
*.tbz2) ${pkgs.gnutar}/bin/tar xjf $1 ;;
*.tgz) ${pkgs.gnutar}/bin/tar xzf $1 ;;
*.zip) ${pkgs.unzip}/bin/unzip $1 ;;
*.Z) ${pkgs.gzip}/bin/uncompress $1 ;;
*.7z) ${pkgs._7zz}/bin/7z x $1 ;;
*) echo "'$1' cannot be extracted via extract()" ;;
esac
else
echo "'$1' is not a valid file"
fi
''

View file

@ -1,4 +1,8 @@
{ lib, buildNpmPackage, fetchFromGitHub }:
{
lib,
buildNpmPackage,
fetchFromGitHub,
}:
buildNpmPackage rec {
pname = "spx-gc";
@ -21,8 +25,7 @@ buildNpmPackage rec {
'';
meta = with lib; {
description =
"SPX is a graphics control client for live video productions and live streams using CasparCG, OBS, vMix, or similar software";
description = "SPX is a graphics control client for live video productions and live streams using CasparCG, OBS, vMix, or similar software";
homepage = "https://github.com/TuomoKu/SPX-GC#npminstall";
license = licenses.mit;
maintainers = with maintainers; [ ];

View file

@ -1,8 +1,14 @@
{ config, pkgs, lib, ... }:
{
config,
pkgs,
lib,
...
}:
let
nixGL = import ./../../home-manager/utils/nixGLWrap.nix { inherit pkgs config; };
in {
in
{
programs.alacritty = {
enable = if config.machine.isGraphical then true else false;
package = (nixGL pkgs.alacritty);

View file

@ -1,3 +1,5 @@
{
programs.atuin = { enable = true; };
programs.atuin = {
enable = true;
};
}

View file

@ -1 +1,5 @@
{ programs.bat = { enable = true; }; }
{
programs.bat = {
enable = true;
};
}

View file

@ -12,7 +12,9 @@
duplicate_action = "ask";
default_action = "apply";
};
badfiles = { check_on_import = "yes"; };
badfiles = {
check_on_import = "yes";
};
match = {
max_rec = {
track_length = "strong";

View file

@ -20,7 +20,10 @@ let
"kbfnbcaeplbcioakkpcpgfkobkghlhen" # Grammarly
];
isEnabled = if (config.machine.isGraphical && !config.machine.isGeneric) then true else false;
dictionaries = with pkgs.hunspellDictsChromium; [ en_US de_DE ];
dictionaries = with pkgs.hunspellDictsChromium; [
en_US
de_DE
];
commandLineArgs = [
"--enable-wayland-ime"
"--ignore-gpu-blocklist"
@ -30,7 +33,8 @@ let
"--enable-features=WaylandWindowDecorations,VaapiVideoDecoder,VaapiVideoEncoder,VaapiVideoDecodeLinuxGL,WebRTCPipeWireCapturer"
];
extensions = map (eid: { id = eid; }) chromium_extension;
in {
in
{
programs.chromium = {
inherit dictionaries commandLineArgs extensions;
enable = isEnabled;

View file

@ -1 +1,5 @@
{ programs.command-not-found = { enable = false; }; }
{
programs.command-not-found = {
enable = false;
};
}

View file

@ -15,18 +15,28 @@
ui = true;
pager = true;
};
log = { date = "short"; };
rerere = { enabled = "1"; };
log = {
date = "short";
};
rerere = {
enabled = "1";
};
core = {
whitespace = "fix,-indent-with-non-tab,trailing-space,cr-at-eol";
excludesfile = "~/.gitignore";
autocrlf = "input";
};
apply = { whitespace = "nowarn"; };
branch = { autosetuprebase = "always"; };
apply = {
whitespace = "nowarn";
};
branch = {
autosetuprebase = "always";
};
};
};
programs.git-credential-oauth = { enable = true; };
programs.git-credential-oauth = {
enable = true;
};
programs.gh.enable = true;
programs.gh-dash.enable = true;
programs.lazygit.enable = true;

View file

@ -1 +1,5 @@
{ programs.go = { enable = true; }; }
{
programs.go = {
enable = true;
};
}

View file

@ -1 +1,5 @@
{ programs.hstr = { enable = true; }; }
{
programs.hstr = {
enable = true;
};
}

View file

@ -3,6 +3,10 @@
{
programs.mpv = {
enable = if (config.machine.isGraphical && !config.machine.isGeneric) then true else false;
scripts = with pkgs.mpvScripts; [ autoload mpris sponsorblock ];
scripts = with pkgs.mpvScripts; [
autoload
mpris
sponsorblock
];
};
}

View file

@ -7,7 +7,9 @@
viAlias = true;
vimAlias = true;
vimdiffAlias = true;
coc = { enable = true; };
coc = {
enable = true;
};
extraConfig = ''
set title
set ignorecase

View file

@ -3,8 +3,12 @@
enable = true;
settings = {
add_newline = false;
character = { success_symbol = "[](bold white)"; };
package = { disabled = true; };
character = {
success_symbol = "[](bold white)";
};
package = {
disabled = true;
};
};
};
}

View file

@ -1 +1,5 @@
{ services.syncthing = { enable = true; }; }
{
services.syncthing = {
enable = true;
};
}

View file

@ -1,3 +1,5 @@
{
programs.thefuck = { enable = false; };
programs.thefuck = {
enable = false;
};
}

View file

@ -1,11 +1,13 @@
{ config, pkgs, ... }:
{ config, pkgs, ... }:
let
configPath = if config.machine.isGeneric then
"${config.home.homeDirectory}/.config/home-manager"
else
"${config.home.homeDirectory}/.nixos-config";
in {
configPath =
if config.machine.isGeneric then
"${config.home.homeDirectory}/.config/home-manager"
else
"${config.home.homeDirectory}/.nixos-config";
in
{
programs.topgrade = {
enable = true;
settings = {
@ -16,13 +18,18 @@ in {
pre_sudo = false;
cleanup = true;
skip_notify = true;
disable = [ "bun" "tldr" "flutter" ];
disable = [
"bun"
"tldr"
"flutter"
];
};
git.repos = [ configPath ];
firmware = { upgrade = true; };
firmware = {
upgrade = true;
};
pre_commands = {
flakeUpgrade =
"cd ${configPath} && ${pkgs.nixVersions.latest}/bin/nix flake update --commit-lock-file --verbose --repair";
flakeUpgrade = "cd ${configPath} && ${pkgs.nixVersions.latest}/bin/nix flake update --commit-lock-file --verbose --repair";
};
};
};

View file

@ -1,2 +1,5 @@
{ programs.yt-dlp = { enable = true; }; }
{
programs.yt-dlp = {
enable = true;
};
}

View file

@ -1,12 +1,9 @@
# Call once on import to load global context
{
pkgs,
config,
}:
{ pkgs, config }:
# Wrap a single package
pkg:
if config.nixGLPrefix == ""
then pkg
if config.nixGLPrefix == "" then
pkg
else
# Wrap the package's binaries with nixGL, while preserving the rest of
# the outputs and derivation attributes.
@ -17,12 +14,14 @@ else
${
# Heavily inspired by https://stackoverflow.com/a/68523368/6259505
pkgs.lib.concatStringsSep "\n" (map (outputName: ''
echo "Copying output ${outputName}"
set -x
cp -rs --no-preserve=mode "${pkg.${outputName}}" "''$${outputName}"
set +x
'') (old.outputs or ["out"]))
pkgs.lib.concatStringsSep "\n" (
map (outputName: ''
echo "Copying output ${outputName}"
set -x
cp -rs --no-preserve=mode "${pkg.${outputName}}" "''$${outputName}"
set +x
'') (old.outputs or [ "out" ])
)
}
rm -rf $out/bin/*
@ -34,4 +33,4 @@ else
done
shopt -u nullglob # Revert nullglob back to its normal default state
'';
}))
}))

View file

@ -24,7 +24,8 @@ let
chrome-stable-wrapper = pkgs.writeShellScriptBin "google-chrome-stable" ''
exec /usr/bin/google-chrome-stable ${chromeArgs} "$@"
'';
in {
in
{
home.packages = with pkgs; [
code-wrapper
chrome-wrapper