amaan can't into kernel

do 400 pushups per cache miss idiot
This commit is contained in:
atagen 2026-04-27 16:09:39 +10:00
parent 848ed62c5d
commit 4921973b9a
34 changed files with 3240 additions and 605 deletions

View file

@ -3,24 +3,13 @@
lib,
getPkgs,
config,
mkWrappers,
...
}:
let
pal = config.rice.palette.hex;
ui = config.rice.roles pal;
wrap =
name: pkg: args:
pkgs.symlinkJoin {
inherit name;
paths = [ pkg ];
nativeBuildInputs = [ pkgs.makeWrapper ];
postBuild = "wrapProgram $out/bin/${name} ${args}";
};
wrapXdg =
name: pkg: configDir:
wrap name pkg ''--set XDG_CONFIG_HOME "${configDir}"'';
inherit (mkWrappers pkgs) wrap wrapXdg;
lazygitConfig = pkgs.writeText "lazygit-config.yml" ''
gui:
@ -68,55 +57,12 @@ let
theme "nix-rice"
'';
btopConfig = pkgs.writeText "btop.conf" ''
color_theme = "nix-rice"
'';
btopThemeDir = pkgs.runCommand "btop-themes" { } ''
mkdir -p $out
cp ${pkgs.writeText "nix-rice.theme" ''
theme[main_bg]="${ui.bg}"
theme[main_fg]="${ui.fg}"
theme[title]="${ui.fg}"
theme[hi_fg]="${ui.accent}"
theme[selected_bg]="${ui.surface}"
theme[selected_fg]="${ui.fg}"
theme[inactive_fg]="${ui.muted}"
theme[graph_text]="${ui.fg}"
theme[meter_bg]="${ui.overlay}"
theme[proc_misc]="${ui.primary}"
theme[cpu_box]="${ui.primary}"
theme[mem_box]="${ui.accent}"
theme[net_box]="${pal.normal.green}"
theme[proc_box]="${pal.normal.magenta}"
theme[div_line]="${ui.overlay}"
theme[temp_start]="${pal.normal.green}"
theme[temp_mid]="${ui.highlight}"
theme[temp_end]="${ui.error}"
theme[cpu_start]="${ui.primary}"
theme[cpu_mid]="${ui.accent}"
theme[cpu_end]="${ui.highlight}"
theme[free_start]="${pal.normal.green}"
theme[free_mid]="${ui.accent}"
theme[free_end]="${ui.primary}"
theme[cached_start]="${ui.primary}"
theme[cached_mid]="${ui.accent}"
theme[cached_end]="${pal.normal.green}"
theme[available_start]="${pal.normal.green}"
theme[available_mid]="${ui.accent}"
theme[available_end]="${ui.highlight}"
theme[used_start]="${ui.highlight}"
theme[used_mid]="${ui.error}"
theme[used_end]="${pal.bright.red}"
theme[download_start]="${pal.normal.green}"
theme[download_mid]="${ui.accent}"
theme[download_end]="${ui.primary}"
theme[upload_start]="${ui.highlight}"
theme[upload_mid]="${pal.bright.red}"
theme[upload_end]="${ui.error}"
theme[process_start]="${ui.primary}"
theme[process_mid]="${ui.accent}"
theme[process_end]="${pal.normal.green}"
''} $out/nix-rice.theme
btopConfigDir = pkgs.runCommand "btop-xdg" { } ''
mkdir -p $out/btop
cp ${pkgs.writeText "btop.conf" ''
color_theme = "TTY"
update_ms = 100
''} $out/btop/btop.conf
'';
in
{
@ -124,16 +70,26 @@ in
inherit (pkgs)
curl
eza
git
gitMinimal
ripgrep
fd
ouch
btop
bat
;
lazygit = wrap "lazygit" pkgs.lazygit ''--add-flags "--use-config-file=${lazygitConfig}"'';
zellij = wrap "zellij" pkgs.zellij ''--add-flags "--config-dir ${zellijConfig}"'';
# btop = wrap "btop" pkgs.btop ''--add-flags "--config ${btopConfig} --themes-dir ${btopThemeDir}"'';
lazygit = wrap {
name = "lazygit";
pkg = pkgs.lazygit;
args = [ "--use-config-file=${lazygitConfig}" ];
};
zellij = wrap {
name = "zellij";
pkg = pkgs.zellij;
args = [ "--config-dir ${zellijConfig}" ];
envs = {
SHELL = "${config.users.defaultUserShell}/bin/nu";
};
};
btop = wrapXdg "btop" pkgs.btop btopConfigDir;
};
environment.variables.BAT_THEME = "ansi";

View file

@ -1,5 +1,7 @@
{ lib, ... }:
{ inputs, lib, ... }:
{
imports = [ inputs.nixos-core.nixosModules.default ];
system.activationScripts.users = lib.mkForce "";
system.disableInstallerTools = true;
programs.less.lessopen = null;
boot.enableContainers = false;
@ -7,4 +9,30 @@
environment.defaultPackages = lib.mkDefault [ ];
documentation.info.enable = false;
system.tools.nixos-option.enable = false;
system.tools.nixos-generate-config.enable = lib.mkDefault false;
system.nixos-core.enable = true;
# system.nixos-core.components.userGroupsActivation.enable = false;
nixpkgs.overlays = [
(final: prev: {
xdg-utils = final.symlinkJoin {
name = "xdg-utils-handlr-shim-${prev.handlr-regex.version or "0"}";
paths = [
final.xdg-user-dirs
(final.writeShellScriptBin "xdg-open" ''exec ${final.handlr-regex}/bin/handlr open "$@"'')
(final.writeShellScriptBin "xdg-mime" ''exec ${final.handlr-regex}/bin/handlr mime "$@"'')
(final.writeShellScriptBin "xdg-settings" ''exec ${final.handlr-regex}/bin/handlr get "$@"'')
(final.writeShellScriptBin "xdg-email" ''exec ${final.handlr-regex}/bin/handlr open "mailto:$*"'')
(final.writeShellScriptBin "xdg-desktop-menu" "exit 0")
(final.writeShellScriptBin "xdg-desktop-icon" "exit 0")
(final.writeShellScriptBin "xdg-icon-resource" "exit 0")
(final.writeShellScriptBin "xdg-screensaver" "exit 0")
];
meta = {
description = "xdg-utils shim backed by handlr-regex (perl-free)";
mainProgram = "xdg-open";
};
};
})
];
}

View file

@ -6,8 +6,10 @@
man-pages-posix
;
};
documentation.dev.enable = true;
documentation.man.enable = true;
documentation.enable = true;
documentation = {
dev.enable = false;
man.enable = true;
enable = true;
nixos.enable = false;
};
}

164
common/mime-types.nix Normal file
View file

@ -0,0 +1,164 @@
{
config,
lib,
...
}:
let
# Most packages use pname as their desktop ID; override the exceptions
deskOf = pkg: "${pkg.pname or pkg.name}.desktop";
desktopIds = {
pdfReader = "org.pwmt.zathura.desktop";
musicPlayer = "org.strawberrymusicplayer.strawberry.desktop";
ebookReader = "com.github.johnfactotum.Foliate.desktop";
officeSuite = {
writer = "libreoffice-writer.desktop";
calc = "libreoffice-calc.desktop";
impress = "libreoffice-impress.desktop";
draw = "libreoffice-draw.desktop";
};
};
desk = appName: desktopIds.${appName} or (deskOf config.apps.${appName});
in
{
xdg.mime.defaultApplications = {
# web
"text/html" = desk "browser";
"application/xhtml+xml" = desk "browser";
"x-scheme-handler/http" = desk "browser";
"x-scheme-handler/https" = desk "browser";
"x-scheme-handler/ftp" = desk "browser";
"x-scheme-handler/about" = desk "browser";
"x-scheme-handler/unknown" = desk "browser";
# mail
"x-scheme-handler/mailto" = desk "mailClient";
"message/rfc822" = desk "mailClient";
"application/mbox" = desk "mailClient";
# text / code
"text/plain" = desk "editor";
"text/markdown" = desk "editor";
"application/json" = desk "editor";
"application/xml" = desk "editor";
"text/xml" = desk "editor";
"application/javascript" = desk "editor";
"text/javascript" = desk "editor";
"text/x-python" = desk "editor";
"text/x-script.python" = desk "editor";
"text/x-shellscript" = desk "editor";
"text/x-csrc" = desk "editor";
"text/x-chdr" = desk "editor";
"text/x-c++src" = desk "editor";
"text/x-c++hdr" = desk "editor";
"text/x-rust" = desk "editor";
"text/x-go" = desk "editor";
"text/x-java" = desk "editor";
"text/x-haskell" = desk "editor";
"text/x-nix" = desk "editor";
"text/x-lua" = desk "editor";
"text/x-toml" = desk "editor";
"text/x-yaml" = desk "editor";
"text/yaml" = desk "editor";
# directories
"inode/directory" = desk "fm";
# archives
"application/zip" = desk "archive";
"application/x-zip-compressed" = desk "archive";
"application/x-tar" = desk "archive";
"application/gzip" = desk "archive";
"application/x-gzip" = desk "archive";
"application/x-bzip2" = desk "archive";
"application/x-xz" = desk "archive";
"application/x-7z-compressed" = desk "archive";
"application/x-rar" = desk "archive";
"application/x-rar-compressed" = desk "archive";
"application/x-lzip" = desk "archive";
"application/x-lzma" = desk "archive";
"application/x-zstd" = desk "archive";
"application/zstd" = desk "archive";
# pdf
"application/pdf" = desk "pdfReader";
"application/x-pdf" = desk "pdfReader";
# images
"image/jpeg" = desk "imageViewer";
"image/png" = desk "imageViewer";
"image/gif" = desk "imageViewer";
"image/webp" = desk "imageViewer";
"image/avif" = desk "imageViewer";
"image/jxl" = desk "imageViewer";
"image/bmp" = desk "imageViewer";
"image/x-bmp" = desk "imageViewer";
"image/tiff" = desk "imageViewer";
"image/x-tiff" = desk "imageViewer";
"image/svg+xml" = desk "imageViewer";
"image/x-portable-bitmap" = desk "imageViewer";
"image/x-portable-pixmap" = desk "imageViewer";
"image/vnd.microsoft.icon" = desk "imageViewer";
"image/x-icon" = desk "imageViewer";
# video
"video/mp4" = desk "videoPlayer";
"video/mpeg" = desk "videoPlayer";
"video/x-matroska" = desk "videoPlayer";
"video/webm" = desk "videoPlayer";
"video/x-msvideo" = desk "videoPlayer";
"video/vnd.avi" = desk "videoPlayer";
"video/quicktime" = desk "videoPlayer";
"video/x-flv" = desk "videoPlayer";
"video/3gpp" = desk "videoPlayer";
"video/ogg" = desk "videoPlayer";
"video/x-ogm+ogg" = desk "videoPlayer";
"video/x-ms-wmv" = desk "videoPlayer";
# audio
"audio/mpeg" = desk "musicPlayer";
"audio/mp3" = desk "musicPlayer";
"audio/ogg" = desk "musicPlayer";
"audio/flac" = desk "musicPlayer";
"audio/x-flac" = desk "musicPlayer";
"audio/wav" = desk "musicPlayer";
"audio/x-wav" = desk "musicPlayer";
"audio/aac" = desk "musicPlayer";
"audio/mp4" = desk "musicPlayer";
"audio/x-m4a" = desk "musicPlayer";
"audio/vorbis" = desk "musicPlayer";
"audio/x-vorbis+ogg" = desk "musicPlayer";
"audio/opus" = desk "musicPlayer";
"audio/x-opus+ogg" = desk "musicPlayer";
"audio/x-ape" = desk "musicPlayer";
"audio/x-wavpack" = desk "musicPlayer";
"audio/aiff" = desk "musicPlayer";
"audio/x-aiff" = desk "musicPlayer";
# ebooks
"application/epub+zip" = desk "ebookReader";
"application/x-mobipocket-ebook" = desk "ebookReader";
"application/x-fictionbook+xml" = desk "ebookReader";
"application/x-fictionbook" = desk "ebookReader";
"application/x-cbz" = desk "ebookReader";
"application/x-cbr" = desk "ebookReader";
"image/vnd.djvu" = desk "ebookReader";
"image/x-djvu" = desk "ebookReader";
# office — open document
"application/vnd.oasis.opendocument.text" = desktopIds.officeSuite.writer;
"application/vnd.oasis.opendocument.text-template" = desktopIds.officeSuite.writer;
"application/vnd.oasis.opendocument.spreadsheet" = desktopIds.officeSuite.calc;
"application/vnd.oasis.opendocument.spreadsheet-template" = desktopIds.officeSuite.calc;
"application/vnd.oasis.opendocument.presentation" = desktopIds.officeSuite.impress;
"application/vnd.oasis.opendocument.presentation-template" = desktopIds.officeSuite.impress;
"application/vnd.oasis.opendocument.graphics" = desktopIds.officeSuite.draw;
# office — microsoft
"application/msword" = desktopIds.officeSuite.writer;
"application/vnd.openxmlformats-officedocument.wordprocessingml.document" = desktopIds.officeSuite.writer;
"application/vnd.ms-excel" = desktopIds.officeSuite.calc;
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" = desktopIds.officeSuite.calc;
"text/csv" = desktopIds.officeSuite.calc;
"application/vnd.ms-powerpoint" = desktopIds.officeSuite.impress;
"application/vnd.openxmlformats-officedocument.presentationml.presentation" = desktopIds.officeSuite.impress;
};
}

View file

@ -1,4 +1,5 @@
{
pkgs,
inputs,
...
}:
@ -6,12 +7,20 @@
imports = [
inputs.angrr.nixosModules.angrr
];
nix = {
package = pkgs.nixVersions.nix_2_31;
optimise = {
automatic = true;
dates = "weekly";
persistent = true;
nix.gc = {
automatic = true;
dates = "weekly";
persistent = true;
options = "--delete-older-than 14d";
};
gc = {
automatic = true;
dates = "weekly";
persistent = true;
options = "--delete-older-than 14d";
};
};
services.angrr = {

View file

@ -1,13 +1,14 @@
{
inputs,
getFlakePkg,
config,
...
}:
{
nix.settings.plugin-files = [
"${getFlakePkg inputs.nix-scope-plugin}/lib/nix/plugins/libnix-scope-plugin.so"
imports = [
inputs.nix-shorturl-plugin.nixosModules.default
inputs.nix-scope-plugin.nixosModules.default
];
imports = [ inputs.nix-shorturl-plugin.nixosModules.default ];
nix.shorturls = {
enable = true;
schemes = {

View file

@ -9,7 +9,7 @@ scope "nix.settings" {
# "https://cache.atagen.co"
# "https://cache.privatevoid.net"
"https://cache.flox.dev"
# "https://cache.amaanq.com"
"https://cache.amaanq.com"
"https://cache.nixos-cuda.org"
"https://niri.cachix.org"
];
@ -20,7 +20,7 @@ scope "nix.settings" {
# "cache.atagen.co:SOUkNQxuu/eQ7FcI8nlUe7FpV27e7YjQlDQdn8HTUnw="
# "cache.privatevoid.net:SErQ8bvNWANeAvtsOESUwVYr2VJynfuc9JRwlzTTkVg="
"flox-cache-public-1:7F4OyH7ZCnFhcze3fJdfyXYLQw/aV7GEed86nQ7IsOs="
# "cache.amaanq.com:H0iXsEEFsvUNtWb5v9V8Kss+L4F/tnXwDHXcY+xbmKk="
"cache.amaanq.com:H0iXsEEFsvUNtWb5v9V8Kss+L4F/tnXwDHXcY+xbmKk="
"cache.nixos-cuda.org:74DUi4Ye579gUqzH4ziL9IyiJBlDpMRn9MBN8oNan9M="
"niri.cachix.org-1:Wv0OmO7PsuocRKzfDoJ3mulSl7Z6oezYhGhR+3W2964="
];

View file

@ -1,6 +1,5 @@
{ lib, mainUser, ... }:
{
services.userborn.enable = lib.mkDefault true;
nix.settings.trusted-users = [ mainUser ];
users.users.${mainUser} = {
isNormalUser = true;