├── .gitignore ├── .secretlintrc.json ├── dotfiles ├── app │ ├── ghostty │ │ └── default.nix │ ├── git │ │ ├── default.nix │ │ └── gitignore.nix │ ├── hyprland │ │ └── default.nix │ ├── labwc │ │ ├── autostart.nix │ │ ├── default.nix │ │ └── rc.nix │ ├── mlterm │ │ ├── aafont.nix │ │ ├── color.nix │ │ ├── default.nix │ │ ├── key.nix │ │ └── main.nix │ └── xdg │ │ └── default.nix ├── config │ ├── app │ │ ├── browser.nix │ │ ├── chat.nix │ │ ├── creative.nix │ │ ├── multimedia.nix │ │ ├── office.nix │ │ └── wine.nix │ ├── desktop │ │ ├── desktop-session.nix │ │ ├── dunst.nix │ │ ├── swaylock.nix │ │ ├── theme.nix │ │ └── ydotoold.nix │ ├── files │ │ └── skk.nix │ ├── nixos │ │ └── gsettings.nix │ ├── services │ │ ├── polkit.nix │ │ └── syncthing.nix │ ├── shell │ │ ├── starship.nix │ │ └── zsh.nix │ ├── tools │ │ ├── archiver.nix │ │ └── development.nix │ └── vars │ │ ├── appmenu.nix │ │ ├── theme.nix │ │ └── xml.nix ├── files │ ├── desktop │ │ ├── creative-menu.desktop │ │ └── root-menu.desktop │ ├── scripts │ │ ├── mount-btrfs.sh │ │ ├── prepare-generative-ai │ │ ├── prepare-windows-vm │ │ ├── snapper-clean-all │ │ ├── synthv │ │ ├── vanish-check │ │ ├── vm-snapshot-for-daw │ │ ├── waydroid-start │ │ ├── waydroid-stop │ │ └── zrythm-launch │ └── wine │ │ ├── Kindle │ │ └── MP3TAGS └── user │ └── nyarla.nix ├── flake.lock ├── flake.nix ├── lib └── nixosSystem.nix ├── patches ├── tmux3.5a-utf8.patch ├── utf8_force_wide.h └── weylus.patch ├── pkgs ├── aria-misskey │ ├── default.nix │ └── rust_lib_aria.patch ├── audiogridder │ └── default.nix ├── carla │ ├── default.nix │ └── nixos.patch ├── cskk │ └── default.nix ├── cuda-shell │ └── default.nix ├── currennt │ └── default.nix ├── deadbeef-fb │ └── default.nix ├── default.nix ├── dexed │ └── default.nix ├── fcitx5-cskk │ └── default.nix ├── fcitx5-fbterm │ └── default.nix ├── fluent-kde │ └── default.nix ├── galendae │ └── default.nix ├── glibc-locales-eaw │ └── default.nix ├── gyazo-diy │ └── default.nix ├── igsc │ └── default.nix ├── ildaeil │ ├── default.nix │ └── nixos.patch ├── kaunas │ └── default.nix ├── noise-suppression-for-voice │ └── default.nix ├── noto-fonts-jp │ ├── default.nix │ ├── fonts.nix │ └── update.sh ├── nvim-run │ └── default.nix ├── openjtalk │ └── default.nix ├── perl-shell │ └── default.nix ├── restic-run │ └── default.nix ├── shoreman │ └── default.nix ├── skk-dicts-xl │ ├── default.nix │ ├── skk.nix │ └── update.sh ├── sononym-bin │ └── default.nix ├── stability-matrix │ ├── default.nix │ ├── deps.nix │ └── nixos.patch ├── temporary.nix ├── wcwidh-cjk │ ├── default.nix │ └── locale-eaw-console.patch ├── wine-run │ └── default.nix ├── wine-vst-wrapper │ └── default.nix ├── wineasio │ └── default.nix └── xembed-sni-proxy │ └── default.nix └── system ├── config ├── audio │ ├── daw.nix │ ├── pipewire.nix │ └── tts.nix ├── cpu │ ├── amd.nix │ └── intel.nix ├── datetime │ └── jp.nix ├── desktop │ ├── files.nix │ ├── gnome-compatible.nix │ ├── wayland.nix │ ├── xdg.nix │ └── xorg.nix ├── gadgets │ └── android.nix ├── graphic │ ├── fonts.nix │ ├── hidpi.nix │ └── lodpi.nix ├── hardware │ ├── dell-xps-9560-jp.nix │ ├── firmware.nix │ └── weylus.nix ├── i18n │ ├── fcitx5.nix │ └── locales.nix ├── keyboard │ ├── jp.nix │ ├── us.nix │ └── zinc.nix ├── linux │ ├── console.nix │ ├── dbus.nix │ ├── docker.nix │ ├── filesystem.nix │ ├── hardware.nix │ ├── lodpi.nix │ ├── optical.nix │ ├── optimize.nix │ ├── process.nix │ ├── waydroid.nix │ └── wine.nix ├── networking │ ├── agent.nix │ ├── avahi.nix │ ├── network-manager.nix │ ├── printer.nix │ └── tailscale.nix ├── nixos │ ├── gsettings.nix │ ├── nix-ld.nix │ └── nixpkgs.nix ├── security │ ├── clamav.nix │ ├── firewall-home.nix │ ├── gnupg.nix │ ├── ulimit.nix │ └── yubikey.nix ├── services │ └── nyzen9.nix ├── tools │ ├── editors.nix │ └── git.nix ├── user │ ├── nixos.nix │ └── nyarla.nix ├── video │ ├── droidcam.nix │ └── intel-with-nvidia.nix ├── vmm │ └── kvm.nix └── wireless │ ├── AX200.nix │ ├── bluetooth.nix │ └── jp.nix └── profile └── NyZen9.nix /.gitignore: -------------------------------------------------------------------------------- 1 | .node_modules 2 | result 3 | .snapshots 4 | -------------------------------------------------------------------------------- /.secretlintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "rules": [ 3 | { 4 | "id": "@secretlint/secretlint-rule-preset-recommend" 5 | } 6 | ] 7 | } 8 | -------------------------------------------------------------------------------- /dotfiles/app/ghostty/default.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | { 3 | home.packages = with pkgs; [ 4 | ghostty 5 | ]; 6 | 7 | xdg.configFile."ghostty/config".text = '' 8 | theme = kalaclista 9 | 10 | font-family = Mononspace 11 | font-size = 12 12 | font-feature = -dlig 13 | 14 | grapheme-width-method = legacy 15 | 16 | cursor-style = block 17 | cursor-style-blink = true 18 | 19 | keybind = ctrl+p=paste_from_clipboard 20 | 21 | gtk-single-instance = true 22 | gtk-tabs-location = bottom 23 | gtk-adwaita = false 24 | ''; 25 | 26 | xdg.configFile."ghostty/themes/kalaclista".text = '' 27 | palette = 0=#111111 28 | palette = 1=#f77468 29 | palette = 2=#aee46f 30 | palette = 3=#ffcb61 31 | palette = 4=#8cc8ff 32 | palette = 5=#fb7fd5 33 | palette = 6=#00efff 34 | palette = 7=#f1f1f1 35 | palette = 8=#9e9e9e 36 | palette = 9=#ff8274 37 | palette = 10=#bcf27c 38 | palette = 11=#ffd96e 39 | palette = 12=#abe4ff 40 | palette = 13=#ffb7ff 41 | palette = 14=#00ffff 42 | palette = 15=#ffffff 43 | 44 | background = 111111 45 | foreground = ffffff 46 | 47 | cursor-color = bcf27c 48 | 49 | selection-background = abe4ff 50 | selection-foreground = 000000 51 | ''; 52 | } 53 | -------------------------------------------------------------------------------- /dotfiles/app/git/default.nix: -------------------------------------------------------------------------------- 1 | { pkgs, config, ... }: 2 | { 3 | programs.git = { 4 | enable = true; 5 | lfs.enable = true; 6 | package = pkgs.gitFull; 7 | aliases = { 8 | co = "checkout"; 9 | ci = "commit"; 10 | force-push = "push -f --force-with-lease --force-if-includes"; 11 | st = "status"; 12 | cleanup = "!git branch --merged | grep -v main | grep -v master | xargs -I{} git branch -d {}"; 13 | }; 14 | extraConfig = { 15 | color = { 16 | ui = true; 17 | }; 18 | init = { 19 | defaultBranch = "main"; 20 | }; 21 | core = { 22 | autoCRLF = false; 23 | fileMode = false; 24 | fscache = true; 25 | preloadindex = true; 26 | quotepath = false; 27 | hooksPath = "${config.home.homeDirectory}/Applications/Development/githooks/hooks"; 28 | }; 29 | credential.helper = "${pkgs.gitFull}/bin/git-credential-libsecret"; 30 | }; 31 | ignores = import ./gitignore.nix; 32 | }; 33 | } 34 | -------------------------------------------------------------------------------- /dotfiles/app/git/gitignore.nix: -------------------------------------------------------------------------------- 1 | [ 2 | # Created by https://www.toptal.com/developers/gitignore/api/node,perl 3 | # Edit at https://www.toptal.com/developers/gitignore?templates=node,perl 4 | 5 | ### Node ### 6 | # Logs 7 | "logs" 8 | "*.log" 9 | "npm-debug.log*" 10 | "yarn-debug.log*" 11 | "yarn-error.log*" 12 | "lerna-debug.log*" 13 | ".pnpm-debug.log*" 14 | 15 | # Diagnostic reports (https://nodejs.org/api/report.html) 16 | "report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json" 17 | 18 | # Runtime data 19 | "pids" 20 | "*.pid" 21 | "*.seed" 22 | "*.pid.lock" 23 | 24 | # Directory for instrumented libs generated by jscoverage/JSCover 25 | "lib-cov" 26 | 27 | # Coverage directory used by tools like istanbul 28 | "coverage" 29 | "*.lcov" 30 | 31 | # nyc test coverage 32 | ".nyc_output" 33 | 34 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) 35 | ".grunt" 36 | 37 | # Bower dependency directory (https://bower.io/) 38 | "bower_components" 39 | 40 | # node-waf configuration 41 | ".lock-wscript" 42 | 43 | # Compiled binary addons (https://nodejs.org/api/addons.html) 44 | "build/Release" 45 | 46 | # Dependency directories 47 | "node_modules/" 48 | "jspm_packages/" 49 | 50 | # Snowpack dependency directory (https://snowpack.dev/) 51 | "web_modules/" 52 | 53 | # TypeScript cache 54 | "*.tsbuildinfo" 55 | 56 | # Optional npm cache directory 57 | ".npm" 58 | 59 | # Optional eslint cache 60 | ".eslintcache" 61 | 62 | # Microbundle cache 63 | ".rpt2_cache/" 64 | ".rts2_cache_cjs/" 65 | ".rts2_cache_es/" 66 | ".rts2_cache_umd/" 67 | 68 | # Optional REPL history 69 | ".node_repl_history" 70 | 71 | # Output of 'npm pack' 72 | "*.tgz" 73 | 74 | # Yarn Integrity file 75 | ".yarn-integrity" 76 | 77 | # dotenv environment variables file 78 | ".env" 79 | ".env.test" 80 | ".env.production" 81 | 82 | # parcel-bundler cache (https://parceljs.org/) 83 | ".cache" 84 | ".parcel-cache" 85 | 86 | # Next.js build output 87 | ".next" 88 | "out" 89 | 90 | # Nuxt.js build / generate output 91 | ".nuxt" 92 | "dist" 93 | 94 | # Gatsby files 95 | ".cache/" 96 | # Comment in the public line in if your project uses Gatsby and not Next.js 97 | # https://nextjs.org/blog/next-9-1#public-directory-support 98 | # public 99 | 100 | # vuepress build output 101 | ".vuepress/dist" 102 | 103 | # Serverless directories 104 | ".serverless/" 105 | 106 | # FuseBox cache 107 | ".fusebox/" 108 | 109 | # DynamoDB Local files 110 | ".dynamodb/" 111 | 112 | # TernJS port file 113 | ".tern-port" 114 | 115 | # Stores VSCode versions used for testing VSCode extensions 116 | ".vscode-test" 117 | 118 | # yarn v2 119 | ".yarn/cache" 120 | ".yarn/unplugged" 121 | ".yarn/build-state.yml" 122 | ".yarn/install-state.gz" 123 | ".pnp.*" 124 | 125 | ### Node Patch ### 126 | # Serverless Webpack directories 127 | ".webpack/" 128 | 129 | # Optional stylelint cache 130 | ".stylelintcache" 131 | 132 | # SvelteKit build / generate output 133 | ".svelte-kit" 134 | 135 | ### Perl ### 136 | "!Build/" 137 | ".last_cover_stats" 138 | "/META.yml" 139 | "/META.json" 140 | "/MYMETA.*" 141 | "*.o" 142 | "*.pm.tdy" 143 | "*.bs" 144 | 145 | # Devel::Cover 146 | "cover_db/" 147 | 148 | # Devel::NYTProf 149 | "nytprof.out" 150 | 151 | # Dizt::Zilla 152 | "/.build/" 153 | 154 | # Module::Build 155 | "_build/" 156 | "Build" 157 | "Build.bat" 158 | 159 | # Module::Install 160 | "inc/" 161 | 162 | # ExtUtils::MakeMaker 163 | "/blib/" 164 | "/_eumm/" 165 | "/*.gz" 166 | "/Makefile.old" 167 | "/MANIFEST.bak" 168 | "/pm_to_blib" 169 | "/*.zip" 170 | 171 | # End of https://www.toptal.com/developers/gitignore/api/node,perl 172 | 173 | "lefthook.yml" 174 | ".lefthook" 175 | ] 176 | -------------------------------------------------------------------------------- /dotfiles/app/hyprland/default.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | { 3 | imports = [ 4 | ../../config/desktop/desktop-session.nix 5 | ../../config/desktop/dunst.nix 6 | ../../config/desktop/theme.nix 7 | ../../config/desktop/ydotoold.nix 8 | ]; 9 | 10 | home.packages = with pkgs; [ 11 | # wayland compositor 12 | hyprland 13 | hypridle 14 | hyprlock 15 | swaylock-effects # TODO: switch to hyprlock 16 | 17 | xwayland 18 | 19 | # desktop 20 | waybar 21 | wofi 22 | 23 | gyazo-diy 24 | libsecret 25 | mission-center 26 | 27 | # apps 28 | libsecret 29 | mission-center 30 | gyazo-diy 31 | 32 | # background services 33 | blueman 34 | networkmanagerapplet 35 | xembed-sni-proxy 36 | 37 | # utilities 38 | grim 39 | slurp 40 | wayout 41 | wev 42 | wlr-randr 43 | ydotool 44 | 45 | wl-clipboard 46 | xclip 47 | ]; 48 | 49 | home.file.".local/bin/hy".source = toString ( 50 | pkgs.writeShellScript "starthyprland" '' 51 | exec >$HOME/Reports/hyprland.log 2>&1 52 | 53 | for rc in $(ls /etc/profile.d); do 54 | . /etc/profile.d/$rc 55 | done 56 | 57 | for rc in $(ls $HOME/.config/profile.d); do 58 | . $HOME/.config/profile.d/$rc 59 | done 60 | 61 | export DESKTOP_SESSION=hyprland 62 | export LIBSEAT_BACKEND=logind 63 | 64 | export XDG_SESSION_CLASS=user 65 | export XDG_SESSION_TYPE=wayland 66 | 67 | if systemctl --user -q is-active desktop-session.target ; then 68 | echo "Desktop session already exists." >&2 69 | exit 1 70 | fi 71 | 72 | if hash dbus-update-activation-environment 2>/dev/null; then 73 | dbus-update-activation-environment --systemd --all 74 | fi 75 | 76 | systemctl --user reset-failed 77 | 78 | cleanup() { 79 | if systemctl --user -q is-active desktop-session.target ; then 80 | systemctl --user stop desktop-session.target 81 | fi 82 | } 83 | trap cleanup INT TERM 84 | 85 | dbus-launch --exit-with-session ${pkgs.hyprland}/bin/Hyprland 86 | cleanup 87 | '' 88 | ); 89 | } 90 | -------------------------------------------------------------------------------- /dotfiles/app/labwc/autostart.nix: -------------------------------------------------------------------------------- 1 | { 2 | fetchurl, 3 | writeShellScript, 4 | writeText, 5 | 6 | blueman, 7 | calibre, 8 | goreman, 9 | lxqt, 10 | networkmanagerapplet, 11 | qpwgraph, 12 | xembed-sni-proxy, 13 | }: 14 | let 15 | wallpaper = fetchurl { 16 | url = "https://raw.githubusercontent.com/NixOS/nixos-artwork/refs/heads/master/wallpapers/nix-wallpaper-mosaic-blue.png"; 17 | sha256 = "1cbcssa8qi0giza0k240w5yy4yb2bhc1p1r7pw8qmziprcmwv5n5"; 18 | }; 19 | 20 | procfile = writeText "Procfile" '' 21 | blueman: ${blueman}/bin/blueman-applet 22 | calibre: env QT_IM_MODULE= GTK_IM_MODULE= ${calibre}/bin/calibre --start-in-tray 23 | clipboard: wl-paste -t text -w xclip -selection clipboard 24 | fcitx5: fcitx5 -r 25 | nm-applet: ${networkmanagerapplet}/bin/nm-applet --indicator 26 | lxqt-panel: ${lxqt.lxqt-panel}/bin/lxqt-panel 27 | xembedsniproxy: ${xembed-sni-proxy}/bin/xembedsniproxy 28 | qpwgraph: ${qpwgraph}/bin/qpwgraph -m 29 | ''; 30 | in 31 | writeShellScript "autostart" '' 32 | cd $HOME 33 | chmod +w .Procfile 34 | cp ${procfile} .Procfile 35 | 36 | systemctl --user import-environment WAYLAND_DISPLAY 37 | 38 | systemctl --user start desktop-session.target 39 | systemctl --user start swaylock 40 | 41 | eval "$(/run/wrappers/bin/gnome-keyring-daemon --components=pkcs11,secrets,ssh --replace --daemonize)" 42 | export SSH_AUTH_SOCK 43 | export GNOME_KEYRING_CONTROL 44 | 45 | ${goreman}/bin/goreman -f .Procfile start & 46 | 47 | swaybg -i ${wallpaper} -m fit & 48 | '' 49 | -------------------------------------------------------------------------------- /dotfiles/app/labwc/default.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | let 3 | require = path: pkgs.callPackage (import path); 4 | in 5 | { 6 | imports = [ 7 | ../../config/desktop/desktop-session.nix 8 | ../../config/desktop/dunst.nix 9 | ../../config/desktop/swaylock.nix 10 | ../../config/desktop/theme.nix 11 | ../../config/desktop/ydotoold.nix 12 | ]; 13 | 14 | home.packages = with pkgs; [ 15 | # credential 16 | libsecret 17 | 18 | # desktop 19 | mission-center 20 | 21 | # wayland 22 | grim 23 | slurp 24 | wl-clipboard 25 | xclip 26 | gyazo-diy 27 | 28 | labwc 29 | swaybg 30 | swayidle 31 | swaylock-effects 32 | goreman 33 | 34 | wayout 35 | wev 36 | wlr-randr 37 | ydotool 38 | ]; 39 | 40 | xdg.configFile = { 41 | "labwc/autostart".source = toString (require ./autostart.nix { }); 42 | "labwc/menu.xml".text = require ../../config/vars/appmenu.nix { }; 43 | "labwc/rc.xml".text = require ./rc.nix { }; 44 | 45 | "labwc/environment".text = '' 46 | GTK2_RC_FILES=$HOME/.gtkrc-2.0 47 | 48 | LANG=ja_JP.UTF_8 49 | LC_ALL=ja_JP.UTF-8 50 | 51 | XKB_DEFAULT_LAYOUT=us 52 | 53 | GDK_BACKEND=wayland 54 | CLUTTER_BACKEND=wayland 55 | QT_QPA_PLATFORM=wayland 56 | 57 | MOZ_DISABLE_RDD_SANDBOX=1 58 | MOZ_ENABLE_WAYLAND=1 59 | MOZ_USE_XINPUT2=1 60 | MOZ_WEBRENDER=1 61 | 62 | SDL_VIDEODRIVER=wayland 63 | _JAVA_AWT_WM_NONREPARENTING=1 64 | ''; 65 | }; 66 | 67 | home.file.".local/bin/sw".source = toString ( 68 | pkgs.writeShellScript "startlabwc" '' 69 | exec >$HOME/Reports/sw.log 2>&1 70 | 71 | for rc in $(ls /etc/profile.d); do 72 | . /etc/profile.d/$rc 73 | done 74 | 75 | for rc in $(ls $HOME/.config/profile.d); do 76 | . $HOME/.config/profile.d/$rc 77 | done 78 | 79 | export DESKTOP_SESSION=wlroots 80 | export LIBSEAT_BACKEND=logind 81 | 82 | export XDG_CURRENT_DESKTOP=labwc:wlroots 83 | export XDG_SESSION_CLASS=user 84 | export XDG_SESSION_DESKTOP=labwc:wlroots 85 | export XDG_SESSION_TYPE=wayland 86 | 87 | export WLR_RENDERER_ALLOW_SOFTWARE=1 88 | export WLR_RENDERER=gles2 89 | 90 | if systemctl --user -q is-active desktop-session.target ; then 91 | echo "Desktop session already exists." >&2 92 | exit 1 93 | fi 94 | 95 | if hash dbus-update-activation-environment 2>/dev/null; then 96 | dbus-update-activation-environment --systemd --all 97 | fi 98 | 99 | systemctl --user reset-failed 100 | 101 | cleanup() { 102 | pkill goreman 103 | if systemctl --user -q is-active desktop-session.target ; then 104 | systemctl --user stop desktop-session.target 105 | fi 106 | } 107 | trap cleanup INT TERM 108 | 109 | dbus-launch --exit-with-session ${pkgs.labwc}/bin/labwc -V 110 | cleanup 111 | '' 112 | ); 113 | } 114 | -------------------------------------------------------------------------------- /dotfiles/app/labwc/rc.nix: -------------------------------------------------------------------------------- 1 | { lib }: 2 | let 3 | inherit (import ../../config/vars/xml.nix { inherit lib; }) 4 | tag2 5 | el2 6 | el3 7 | ; 8 | 9 | p = name: contains: el2 name (if builtins.isList contains then contains else [ contains ]); 10 | a = name: attrs: tag2 name attrs; 11 | 12 | font = 13 | place: 14 | { name, size }: 15 | el3 "font" { inherit place; } [ 16 | (p "name" name) 17 | (p "size" size) 18 | ]; 19 | 20 | keybind = key: actions: el3 "keybind" { inherit key; } actions; 21 | mousebind = 22 | button: action: actions: 23 | el3 "mousebind" { inherit button action; } actions; 24 | 25 | run = 26 | commandline: 27 | el3 "action" { name = "Execute"; } [ 28 | (el2 "command" [ commandline ]) 29 | ]; 30 | 31 | action = 32 | name: contains: 33 | if (builtins.length contains) == 0 then 34 | el2 "action" { inherit name; } 35 | else 36 | el3 "action" { inherit name; } contains; 37 | in 38 | '' 39 | 40 | '' 41 | + (p "labwc_config" [ 42 | 43 | (p "regions" [ 44 | (a "region" { 45 | name = "center"; 46 | x = "25%"; 47 | y = "25%"; 48 | width = "50%"; 49 | height = "50%"; 50 | }) 51 | ]) 52 | 53 | (p "theme" [ 54 | (p "name" "Kaunas") 55 | (p "icon" "Fluent-light") 56 | (p "cornerRadius" "0") 57 | (p "dropShadow" "yes") 58 | (font "ActiveWindow" { 59 | name = "sans"; 60 | size = "9"; 61 | }) 62 | (font "MenuItem" { 63 | name = "sans"; 64 | size = "10"; 65 | }) 66 | (font "OSD" { 67 | name = "sans"; 68 | size = "9"; 69 | }) 70 | ]) 71 | 72 | (p "keyboard" [ 73 | (keybind "A-Left" [ (action "SnapToEdge" [ (p "direction" "left") ]) ]) 74 | (keybind "A-Right" [ (action "SnapToEdge" [ (p "direction" "right") ]) ]) 75 | (keybind "A-Up" [ (action "SnapToEdge" [ (p "direction" "up") ]) ]) 76 | (keybind "A-Down" [ (action "SnapToEdge" [ (p "direction" "down") ]) ]) 77 | 78 | (keybind "A-o" [ (action "SnapToRegion" [ (p "region" "center") ]) ]) 79 | 80 | (keybind "A-F1" [ (action "ShowMenu" [ (p "menu" "root-menu") ]) ]) 81 | (keybind "A-F2" [ (action "ShowMenu" [ (p "menu" "applications-creative") ]) ]) 82 | (keybind "C-W-q" [ (run "swaylock -C ~/.config/swaylock/config -f") ]) 83 | 84 | (keybind "S-Print" [ (run "gyazo screenshot") ]) 85 | (keybind "C-Print" [ (run "gyazo capture") ]) 86 | ]) 87 | ]) 88 | -------------------------------------------------------------------------------- /dotfiles/app/mlterm/aafont.nix: -------------------------------------------------------------------------------- 1 | { system, ... }: 2 | let 3 | mapEmoji = font: { 4 | "U+A9" = font; 5 | "U+AE" = font; 6 | "U+200D" = font; 7 | "U+203C" = font; 8 | "U+2049" = font; 9 | "U+20E3" = font; 10 | "U+2122" = font; 11 | "U+2139" = font; 12 | "U+2194-2199" = font; 13 | "U+21A9-21AA" = font; 14 | "U+231A-231B" = font; 15 | "U+2328" = font; 16 | "U+23CF" = font; 17 | "U+23E9-23F3" = font; 18 | "U+23F8-23FA" = font; 19 | "U+24C2" = font; 20 | "U+25AA-25AB" = font; 21 | "U+25B6" = font; 22 | "U+25C0" = font; 23 | "U+25FB-25FE" = font; 24 | "U+2600-2604" = font; 25 | "U+260E" = font; 26 | "U+2611" = font; 27 | "U+2614-2615" = font; 28 | "U+2618" = font; 29 | "U+261D" = font; 30 | "U+2620" = font; 31 | "U+2622-2623" = font; 32 | "U+2626" = font; 33 | "U+262A" = font; 34 | "U+262E-262F" = font; 35 | "U+2638-263A" = font; 36 | "U+2640" = font; 37 | "U+2642" = font; 38 | "U+2648-2653" = font; 39 | "U+265F-2660" = font; 40 | "U+2663" = font; 41 | "U+2665-2666" = font; 42 | "U+2668" = font; 43 | "U+267B" = font; 44 | "U+267E-267F" = font; 45 | "U+2692-2697" = font; 46 | "U+2699" = font; 47 | "U+269B-269C" = font; 48 | "U+26A0-26A1" = font; 49 | "U+26AA-26AB" = font; 50 | "U+26B0-26B1" = font; 51 | "U+26BD-26BE" = font; 52 | "U+26C4-26C5" = font; 53 | "U+26C8" = font; 54 | "U+26CE-26CF" = font; 55 | "U+26D1" = font; 56 | "U+26D3-26D4" = font; 57 | "U+26E9-26EA" = font; 58 | "U+26F0-26F5" = font; 59 | "U+26F7-26FA" = font; 60 | "U+26FD" = font; 61 | "U+2702" = font; 62 | "U+2705" = font; 63 | "U+2708-270D" = font; 64 | "U+270F" = font; 65 | "U+2712" = font; 66 | "U+2714" = font; 67 | "U+2716" = font; 68 | "U+271D" = font; 69 | "U+2721" = font; 70 | "U+2728" = font; 71 | "U+2733-2734" = font; 72 | "U+2744" = font; 73 | "U+2747" = font; 74 | "U+274C" = font; 75 | "U+274E" = font; 76 | "U+2753-2755" = font; 77 | "U+2757" = font; 78 | "U+2763-2764" = font; 79 | "U+2795-2797" = font; 80 | "U+27A1" = font; 81 | "U+27B0" = font; 82 | "U+27BF" = font; 83 | "U+2934-2935" = font; 84 | "U+2B05-2B07" = font; 85 | "U+2B1B-2B1C" = font; 86 | "U+2B50" = font; 87 | "U+2B55" = font; 88 | "U+3030" = font; 89 | "U+303D" = font; 90 | "U+3297" = font; 91 | "U+3299" = font; 92 | "U+FE0F" = font; 93 | "U+1F004" = font; 94 | "U+1F0CF" = font; 95 | "U+1F170-1F171" = font; 96 | "U+1F17E-1F17F" = font; 97 | "U+1F18E" = font; 98 | "U+1F191-1F19A" = font; 99 | "U+1F1E6-1F1FF" = font; 100 | "U+1F201-1F202" = font; 101 | "U+1F21A" = font; 102 | "U+1F22F" = font; 103 | "U+1F232-1F23A" = font; 104 | "U+1F250-1F251" = font; 105 | "U+1F300-1F321" = font; 106 | "U+1F324-1F393" = font; 107 | "U+1F396-1F397" = font; 108 | "U+1F399-1F39B" = font; 109 | "U+1F39E-1F3F0" = font; 110 | "U+1F3F3-1F3F5" = font; 111 | "U+1F3F7-1F4FD" = font; 112 | "U+1F4FF-1F53D" = font; 113 | "U+1F549-1F54E" = font; 114 | "U+1F550-1F567" = font; 115 | "U+1F56F-1F570" = font; 116 | "U+1F573-1F57A" = font; 117 | "U+1F587" = font; 118 | "U+1F58A-1F58D" = font; 119 | "U+1F590" = font; 120 | "U+1F595-1F596" = font; 121 | "U+1F5A4-1F5A5" = font; 122 | "U+1F5A8" = font; 123 | "U+1F5B1-1F5B2" = font; 124 | "U+1F5BC" = font; 125 | "U+1F5C2-1F5C4" = font; 126 | "U+1F5D1-1F5D3" = font; 127 | "U+1F5DC-1F5DE" = font; 128 | "U+1F5E1" = font; 129 | "U+1F5E3" = font; 130 | "U+1F5E8" = font; 131 | "U+1F5EF" = font; 132 | "U+1F5F3" = font; 133 | "U+1F5FA-1F64F" = font; 134 | "U+1F680-1F6C5" = font; 135 | "U+1F6CB-1F6D2" = font; 136 | "U+1F6D5" = font; 137 | "U+1F6E0-1F6E5" = font; 138 | "U+1F6E9" = font; 139 | "U+1F6EB-1F6EC" = font; 140 | "U+1F6F0" = font; 141 | "U+1F6F3-1F6FA" = font; 142 | "U+1F7E0-1F7EB" = font; 143 | "U+1F90D-1F93A" = font; 144 | "U+1F93C-1F945" = font; 145 | "U+1F947-1F971" = font; 146 | "U+1F973-1F976" = font; 147 | "U+1F97A-1F9A2" = font; 148 | "U+1F9A5-1F9AA" = font; 149 | "U+1F9AE-1F9CA" = font; 150 | "U+1F9CD-1F9FF" = font; 151 | "U+1FA70-1FA73" = font; 152 | "U+1FA78-1FA7A" = font; 153 | "U+1FA80-1FA82" = font; 154 | "U+1FA90-1FA95" = font; 155 | "U+E0062-E0063" = font; 156 | "U+E0065" = font; 157 | "U+E0067" = font; 158 | "U+E006C" = font; 159 | "U+E006E" = font; 160 | "U+E0073-E0074" = font; 161 | "U+E0077" = font; 162 | "U+E007F" = font; 163 | }; 164 | in 165 | { 166 | x86_64-linux = { 167 | DEFAULT = "Monospace"; 168 | "U+E000-F8FF" = "Hack Nerd Font"; 169 | "U+F0000-FFFFD" = "Hack Nerd Font"; 170 | } // mapEmoji "Noto Color Emoji"; 171 | } 172 | ."${system}" 173 | -------------------------------------------------------------------------------- /dotfiles/app/mlterm/color.nix: -------------------------------------------------------------------------------- 1 | { 2 | black = "#111111"; # 5 3 | red = "#f77468"; # 65 4 | green = "#aee46f"; # 85 5 | yellow = "#ffcb61"; # 85 6 | blue = "#8cc8ff"; # 85 7 | magenta = "#fb7fd5"; # 85 8 | cyan = "#00efff"; # 85 9 | white = "#f1f1f1"; # 95 10 | 11 | hl_black = "#9e9e9e"; # 65 12 | hl_red = "#ff8274"; # 75 13 | hl_green = "#bcf27c"; # 90 14 | hl_yellow = "#ffd96e"; # 90 15 | hl_blue = "#abe4ff"; # 90 16 | hl_magenta = "#ffb7ff"; # 90 17 | hl_cyan = "#00ffff"; # 95 18 | hl_white = "#ffffff"; # 100 19 | } 20 | -------------------------------------------------------------------------------- /dotfiles/app/mlterm/default.nix: -------------------------------------------------------------------------------- 1 | { lib, pkgs, ... }: 2 | let 3 | toKV = lib.generators.toKeyValue { }; 4 | 5 | aafont = (import ./aafont.nix) { inherit (pkgs.stdenv) system; }; 6 | main = (import ./main.nix) { inherit color pkgs; }; 7 | color = import ./color.nix; 8 | key = import ./key.nix; 9 | in 10 | { 11 | home = { 12 | packages = with pkgs; [ mlterm-wayland ]; 13 | file = { 14 | ".mlterm/aafont".text = toKV aafont; 15 | ".mlterm/color".text = toKV color; 16 | ".mlterm/key".text = toKV key; 17 | ".mlterm/main".text = toKV main; 18 | }; 19 | }; 20 | } 21 | -------------------------------------------------------------------------------- /dotfiles/app/mlterm/key.nix: -------------------------------------------------------------------------------- 1 | { 2 | "Control+p" = ''"proto:paste"''; 3 | } 4 | -------------------------------------------------------------------------------- /dotfiles/app/mlterm/main.nix: -------------------------------------------------------------------------------- 1 | { color, pkgs }: 2 | let 3 | config = { 4 | # terminal 5 | use_login_shell = true; 6 | termtype = "mlterm-256color"; 7 | encoding = "UTF-8"; 8 | col_size_of_width_a = 1; 9 | bidi_mode = "left"; 10 | 11 | # font 12 | fontsize = 16; 13 | line_space = 0; 14 | use_anti_alias = true; 15 | box_drawing_font = "unicode"; 16 | type_engine = "cairo"; 17 | unicode_full_width_areas = "U+2030-2031,U+203B-203B,U+2121-2121,U+213B-213B,U+214F-214F,U+2160-2182,U+2190-21FF,U+2318-2318,U+2325-2325,U+2460-24FF,U+25A0-25D7,U+25D9-25E5,U+25E7-2653,U+2668-2668,U+2670-2712,U+2744-2744,U+2747-2747,U+2763-2763,U+2776-2793,U+27F5-27FF,U+2B33-2B33,U+3248-324F,U+E000-EDFF,U+EE0C-F8FF,U+1F000-1F02B,U+1F030-1F093,U+1F0A0-1F0F5,U+1F100-1FAF8,U+F0000-10FFFD"; 18 | emoji_path = "${pkgs.noto-fonts-color-emoji}/share/fonts/noto/NotoColorEmoji.ttf"; 19 | 20 | # appearance 21 | scrollbar_mode = false; 22 | vt_color_mode = true; 23 | blink_cursor = true; 24 | 25 | bg_color = color.black; 26 | fg_color = color.hl_white; 27 | 28 | cursor_bg_color = color.hl_green; 29 | cursor_fg_color = color.black; 30 | 31 | tab_size = 2; 32 | log_size = 100000; 33 | 34 | # others 35 | mod_meta_key = "alt"; 36 | mod_meta_mode = "esc"; 37 | use_clipboard = true; 38 | }; 39 | 40 | extraConfig = { 41 | x86_64-linux = { 42 | use_xim = false; 43 | input_method = "ibus"; 44 | }; 45 | }; 46 | in 47 | config // extraConfig."${pkgs.stdenv.system}" 48 | -------------------------------------------------------------------------------- /dotfiles/app/xdg/default.nix: -------------------------------------------------------------------------------- 1 | { lib, ... }: 2 | { 3 | xdg.mimeApps = { 4 | enable = true; 5 | defaultApplications = 6 | let 7 | toMimeMap = 8 | apps: 9 | lib.attrsets.concatMapAttrs ( 10 | app: mimeTypes: lib.attrsets.mergeAttrsList (lib.lists.map (mime: { "${mime}" = app; }) mimeTypes) 11 | ) apps; 12 | in 13 | toMimeMap { 14 | # web 15 | "firefox.desktop" = [ 16 | # files 17 | "application/x-extension-htm" 18 | "application/x-extension-xhtml" 19 | "text/html" 20 | 21 | # schema 22 | "x-scheme-handler/http" 23 | "x-scheme-handler/https" 24 | ]; 25 | 26 | # files 27 | "pluma.desktop" = [ 28 | "text/plain" 29 | ]; 30 | 31 | "eom.desktop" = [ 32 | "image/apng" 33 | "image/bmp" 34 | "image/gif" 35 | "image/jp2" 36 | "image/jpeg" 37 | "image/jpm" 38 | "image/jpx" 39 | "image/jxl" 40 | "image/jxr" 41 | "image/png" 42 | "image/svg+xml" 43 | "image/svg+xml-compressed" 44 | "image/tiff" 45 | "image/vnd.microsoft.icon" 46 | "image/webp" 47 | ]; 48 | 49 | "deadbeef.desktop" = [ 50 | "audio/flac" 51 | "audio/mpeg" 52 | "audio/ogg" 53 | "audio/webm" 54 | "audio/x-ape" 55 | "audio/x-flac+ogg" 56 | "audio/x-ms-wma" 57 | "audio/x-opus+ogg" 58 | "audio/x-vorbis+ogg" 59 | ]; 60 | 61 | "atril.desktop" = [ 62 | "application/epub+zip" 63 | "application/pdf" 64 | "application/rtf" 65 | ]; 66 | 67 | "thunar.desktop" = [ 68 | "inode/directory" 69 | "inode/mount-point" 70 | ]; 71 | }; 72 | }; 73 | } 74 | -------------------------------------------------------------------------------- /dotfiles/config/app/browser.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | { 3 | programs = { 4 | firefox = { 5 | enable = true; 6 | package = pkgs.firefox-bin; 7 | }; 8 | 9 | chromium = { 10 | enable = true; 11 | package = pkgs.google-chrome; 12 | }; 13 | }; 14 | 15 | home.packages = with pkgs; [ 16 | bitwarden 17 | thunderbird-bin 18 | ]; 19 | } 20 | -------------------------------------------------------------------------------- /dotfiles/config/app/chat.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | { 3 | home.packages = with pkgs; [ tdesktop ]; 4 | } 5 | -------------------------------------------------------------------------------- /dotfiles/config/app/creative.nix: -------------------------------------------------------------------------------- 1 | { pkgs, config, ... }: 2 | { 3 | home.sessionVariables = { 4 | VST_PATH = "$HOME/.nix-profile/lib/vst:$HOME/.nix-profile/lib/lxvst"; 5 | VST3_PATH = "$HOME/.nix-profile/lib/vst3"; 6 | LV2_PATH = "$HOME/.nix-profile/lib/lv2"; 7 | CLAP_PATH = "$HOME/.nix-profile/lib/clap"; 8 | }; 9 | 10 | # for zrythm 11 | xdg.dataFile."icons/zrythm-dark".source = "${pkgs.zrythm}/share/zrythm/themes/icons/zrythm-dark"; 12 | 13 | home.packages = 14 | with pkgs; 15 | [ 16 | # graphics 17 | gimp 18 | inkscape 19 | krita 20 | 21 | # pixel arts 22 | aseprite 23 | pixelorama 24 | ] 25 | ++ [ 26 | # digital audio workstation 27 | bitwig-studio3 28 | famistudio 29 | helio-workstation 30 | musescore 31 | zrythm 32 | 33 | # voice synthesize 34 | openutau 35 | voicevox 36 | 37 | # sample manager 38 | sononym-bin 39 | 40 | # vst plugin host 41 | audiogridder 42 | carla-with-wine 43 | ildaeil 44 | 45 | # plugin bridge 46 | yabridge 47 | yabridgectl 48 | 49 | # vst plugins 50 | calf 51 | surge-XT 52 | 53 | # generator plugins 54 | adlplug 55 | aeolus 56 | ams 57 | bespokesynth-with-vst2 58 | bjumblr 59 | bristol 60 | chow-kick 61 | dexed 62 | drumgizmo 63 | drumkv1 64 | geonkick 65 | helm 66 | hydrogen 67 | librearp 68 | ninjas2 69 | odin2 70 | opnplug 71 | oxefmsynth 72 | padthv1 73 | qsynth 74 | samplv1 75 | sfizz 76 | sorcer 77 | sorcer 78 | synthv1 79 | tunefish 80 | tunefish 81 | vital 82 | x42-avldrums 83 | x42-gmsynth 84 | yoshimi 85 | zynaddsubfx 86 | 87 | # effect plugins 88 | aether-lv2 89 | airwindows 90 | artyFX 91 | bankstown-lv2 92 | bchoppr 93 | bolliedelayxt-lv2 94 | boops 95 | bs2b-lv2 96 | bshapr 97 | bslizr 98 | chow-tape-model 99 | eq10q 100 | fverb 101 | gxplugins-lv2 102 | kapitonov-plugins-pack 103 | lsp-plugins 104 | lsp-plugins 105 | mod-distortion 106 | molot-lite 107 | mooSpace 108 | neural-amp-modeler-lv2 109 | noise-repellent 110 | rkrlv2 111 | talentedhack 112 | tap-plugins 113 | vocproc 114 | x42-plugins 115 | zam-plugins 116 | calf 117 | 118 | # others 119 | bschaffl 120 | bsequencer 121 | calf 122 | fomp 123 | mda_lv2 124 | midi-trigger 125 | mod-arpeggiator-lv2 126 | plujain-ramp 127 | vcv-rack 128 | 129 | # assets 130 | aeolus-stops 131 | freepats 132 | ] 133 | ++ [ 134 | blender 135 | ]; 136 | } 137 | -------------------------------------------------------------------------------- /dotfiles/config/app/multimedia.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | { 3 | home.packages = with pkgs; [ 4 | calibre 5 | (deadbeef-with-plugins.override { plugins = [ deadbeef-fb ]; }) 6 | easytag 7 | glib.out 8 | picard 9 | vlc 10 | ]; 11 | } 12 | -------------------------------------------------------------------------------- /dotfiles/config/app/office.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | { 3 | home.packages = with pkgs; [ 4 | gucharmap 5 | libreoffice 6 | mate.mate-calc 7 | simple-scan 8 | ]; 9 | } 10 | -------------------------------------------------------------------------------- /dotfiles/config/app/wine.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | { 3 | home.packages = with pkgs; [ 4 | winetricks 5 | wine-staging-run 6 | wine-vst-run 7 | ]; 8 | } 9 | -------------------------------------------------------------------------------- /dotfiles/config/desktop/desktop-session.nix: -------------------------------------------------------------------------------- 1 | _: { 2 | systemd.user.targets.desktop-session = { 3 | Unit = { 4 | Description = "Desktop Session target for Xorg and Wayland"; 5 | BindsTo = [ "graphical-session.target" ]; 6 | Wants = [ "graphical-session-pre.target" ]; 7 | After = [ "graphical-session-pre.target" ]; 8 | }; 9 | }; 10 | 11 | systemd.user.targets.desktop-xdg-autostart = { 12 | Unit = { 13 | Description = "XDG Autostart for Xorg and Wayland desktop"; 14 | BindsTo = [ "xdg-desktop-autostart.target" ]; 15 | PartOf = [ "desktop-session.target" ]; 16 | After = [ "desktop-session.target" ]; 17 | }; 18 | }; 19 | 20 | systemd.user.targets.desktop-session-shutdown = { 21 | Unit = { 22 | Description = "Shutdown running Xorg and Wayland Desktop"; 23 | DefaultDependencies = "no"; 24 | StopWhenUnneeded = true; 25 | 26 | Conflict = [ 27 | "graphical-session.target" 28 | "graphical-session-pre.target" 29 | "desktop-session.target" 30 | ]; 31 | After = [ 32 | "graphical-session.target" 33 | "graphical-session-pre.target" 34 | "desktop-session.target" 35 | ]; 36 | }; 37 | }; 38 | } 39 | -------------------------------------------------------------------------------- /dotfiles/config/desktop/dunst.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | { 3 | services.dunst = { 4 | enable = true; 5 | package = pkgs.dunst; 6 | iconTheme = { 7 | name = "Fluent"; 8 | package = pkgs.fluent-icon-theme; 9 | size = "16x16"; 10 | }; 11 | waylandDisplay = "wayland-0"; 12 | settings = { 13 | global = { 14 | width = 240; 15 | hight = 135; 16 | offset = "48x24"; 17 | progress_bar_hight = 3; 18 | progress_bar_min_width = 60; 19 | progress_bar_max_widthi = 120; 20 | separator_height = 16; 21 | padding = 4; 22 | horizontal_padding = 8; 23 | text_icon_padding = 8; 24 | font = "Noto Sans CJK JP 8"; 25 | light_height = 11; 26 | icon_position = "left"; 27 | min_icon_size = 16; 28 | max_icon_size = 16; 29 | frame_width = 1; 30 | 31 | vertical_alignment = "top"; 32 | alignment = "left"; 33 | format = '' 34 | %a 35 | %s 36 | %b 37 | ''; 38 | 39 | background = "#F9F9F9"; 40 | foreground = "#000000"; 41 | highlight = "#666666"; 42 | frame_color = "#000000"; 43 | }; 44 | 45 | urgency_low = { 46 | background = "#00CCFF"; 47 | foreground = "#000000"; 48 | }; 49 | urgency_normal = { 50 | background = "#FFCC33"; 51 | foreground = "#000000"; 52 | }; 53 | uergency_critical = { 54 | background = "#FF6633"; 55 | foreground = "#000000"; 56 | }; 57 | }; 58 | }; 59 | } 60 | -------------------------------------------------------------------------------- /dotfiles/config/desktop/swaylock.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | let 3 | swaylock-script = toString ( 4 | with pkgs; 5 | writeShellScript "swaylock.sh" '' 6 | ${swayidle}/bin/swayidle -w \ 7 | timeout 60 'swaylock -C ~/.config/swaylock/config -f' \ 8 | timeout 60 '${wayout}/bin/wayout --off HDMI-A-3' resume '${wayout}/bin/wayout --on HDMI-A-3' 9 | before-sleep 'swaylock -C ~/.config/swaylock/config -f' \ 10 | lock 'swaylock -C ~/.config/swaylock/config -f' 11 | '' 12 | ); 13 | 14 | image = pkgs.fetchurl { 15 | url = "https://raw.githubusercontent.com/NixOS/nixos-artwork/master/wallpapers/nix-wallpaper-stripes.png"; 16 | sha256 = "116337wv81xfg0g0bsylzzq2b7nbj6hjyh795jfc9mvzarnalwd3"; 17 | }; 18 | in 19 | { 20 | programs.swaylock.enable = true; 21 | programs.swaylock.package = pkgs.swaylock-effects; 22 | programs.swaylock.settings = { 23 | image = toString image; 24 | inside-color = "00000000"; 25 | inside-ver-color = "00000000"; 26 | inside-wrong-color = "00000000"; 27 | ring-color = "00000000"; 28 | ring-ver-color = "FFFFFF99"; 29 | ring-wrong-color = "FF333399"; 30 | line-color = "00000000"; 31 | key-hl-color = "FFFFFF66"; 32 | bs-hl-color = "FFFFFF33"; 33 | separator-color = "00000000"; 34 | datestr = "%A"; 35 | }; 36 | 37 | systemd.user.services.swaylock = { 38 | Unit = { 39 | Description = "Screen lock services by sway utilites"; 40 | After = [ "graphical-session.target" ]; 41 | PartOf = [ "graphical-session.target" ]; 42 | }; 43 | 44 | Service = { 45 | Type = "simple"; 46 | Restart = "on-failure"; 47 | ExecStart = swaylock-script; 48 | }; 49 | }; 50 | } 51 | -------------------------------------------------------------------------------- /dotfiles/config/desktop/theme.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | { 3 | gtk = { 4 | enable = true; 5 | 6 | iconTheme = { 7 | name = "Fluent-light"; 8 | package = pkgs.fluent-icon-theme; 9 | }; 10 | 11 | theme = { 12 | name = "Fluent-Light-compact"; 13 | package = pkgs.fluent-gtk-theme; 14 | }; 15 | 16 | font = { 17 | name = "Sans"; 18 | size = 9; 19 | }; 20 | }; 21 | 22 | qt = { 23 | enable = true; 24 | platformTheme.name = "gtk3"; 25 | style.name = "kvantum"; 26 | style.package = with pkgs; [ 27 | libsForQt5.qtstyleplugin-kvantum 28 | qt6Packages.qtstyleplugin-kvantum 29 | ]; 30 | }; 31 | 32 | xdg.configFile."Kvantum/Fluent".source = with pkgs; "${fluent-kde}/share/Kvantum/Fluent"; 33 | 34 | home.pointerCursor = { 35 | name = "capitaine-cursors-white"; 36 | package = pkgs.capitaine-cursors; 37 | size = 24; 38 | 39 | gtk.enable = true; 40 | x11.enable = true; 41 | x11.defaultCursor = "left_ptr"; 42 | }; 43 | 44 | home.packages = with pkgs; [ 45 | adwaita-icon-theme 46 | fluent-kde 47 | gnome-themes-extra 48 | gtk-engine-murrine 49 | gtk_engines 50 | hicolor-icon-theme 51 | kaunas 52 | ]; 53 | } 54 | -------------------------------------------------------------------------------- /dotfiles/config/desktop/ydotoold.nix: -------------------------------------------------------------------------------- 1 | { pkgs, config, ... }: 2 | { 3 | systemd.user.services.ydotoold = { 4 | Unit = { 5 | Description = "Autostart for ydotoold"; 6 | After = [ "graphical-session.target" ]; 7 | PartOf = [ "graphical-session.target" ]; 8 | }; 9 | 10 | Install = { 11 | WantedBy = [ "graphical-session.target" ]; 12 | }; 13 | 14 | Service = { 15 | Environment = [ 16 | "HOME=${config.home.homeDirectory}" 17 | "LANG=ja_JP.UTF-8" 18 | "LC_ALL=ja_JP.UTF-8" 19 | ]; 20 | ExecStart = "${pkgs.ydotool}/bin/ydotoold"; 21 | Restart = "always"; 22 | }; 23 | }; 24 | } 25 | -------------------------------------------------------------------------------- /dotfiles/config/files/skk.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | { 3 | xdg.configFile."skk/SKK-JISYO.XL".source = "${pkgs.skk-dicts-xl}/share/skk/SkK-JISYO.XL"; 4 | } 5 | -------------------------------------------------------------------------------- /dotfiles/config/nixos/gsettings.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | pkgs, 4 | lib, 5 | ... 6 | }: 7 | let 8 | nixos-gsettings-overrides = pkgs.runCommand "nixos-gsettings-overrides" { } '' 9 | mkdir -p $out/share/gsettings-schemas/nixos-gsettings-overrides/glib-2.0/schemas/ 10 | 11 | ${lib.concatMapStrings (p: '' 12 | if test -d ${p}/share/gsettings-schemas; then 13 | find ${p}/share/gsettings-schemas -name '*.xml' \ 14 | -exec cp -rf {} $out/share/gsettings-schemas/nixos-gsettings-overrides/glib-2.0/schemas/ \; 15 | fi 16 | '') config.home.packages} 17 | 18 | ${pkgs.glib.dev}/bin/glib-compile-schemas $out/share/gsettings-schemas/nixos-gsettings-overrides/glib-2.0/schemas/ 19 | ''; 20 | in 21 | { 22 | xdg.configFile."profile.d/gsettings.sh" = { 23 | text = '' 24 | rm -rf $HOME/.local/share/gsettings-schemas/nixos-gsettings-overrides/glib-2.0/schemas 25 | mkdir -p $HOME/.local/share/gsettings-schemas/nixos-gsettings-overrides/glib-2.0/schemas 26 | 27 | cp -RLf $NIX_GSETTINGS_OVERRIDES_DIR/*.xml \ 28 | $HOME/.local/share/gsettings-schemas/nixos-gsettings-overrides/glib-2.0/schemas/ 29 | 30 | cp -RLf ${nixos-gsettings-overrides}/share/gsettings-schemas/nixos-gsettings-overrides/glib-2.0/schemas/*.xml \ 31 | $HOME/.local/share/gsettings-schemas/nixos-gsettings-overrides/glib-2.0/schemas/ 32 | 33 | ${pkgs.glib.dev}/bin/glib-compile-schemas \ 34 | $HOME/.local/share/gsettings-schemas/nixos-gsettings-overrides/glib-2.0/schemas/ 35 | 36 | export NIX_GSETTINGS_OVERRIDES_DIR=$HOME/.local/share/gsettings-schemas/nixos-gsettings-overrides/glib-2.0/schemas 37 | ''; 38 | }; 39 | } 40 | -------------------------------------------------------------------------------- /dotfiles/config/services/polkit.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | { 3 | systemd.user.services.polkit-mate-authentication-agent-1 = { 4 | Unit = { 5 | Description = "launch authentication-agent-1"; 6 | After = [ "graphical-session.target" ]; 7 | PartOf = [ "graphical-session.target" ]; 8 | }; 9 | 10 | Service = { 11 | Type = "simple"; 12 | Restart = "on-failure"; 13 | ExecStart = '' 14 | ${pkgs.mate.mate-polkit}/libexec/polkit-mate-authentication-agent-1 15 | ''; 16 | Environment = [ 17 | "WAYLAND_DISPLAY=wayland-0" 18 | "LANG=ja_JP.UTF-8" 19 | ]; 20 | }; 21 | 22 | Install = { 23 | WantedBy = [ "graphical-session.target" ]; 24 | }; 25 | }; 26 | } 27 | -------------------------------------------------------------------------------- /dotfiles/config/services/syncthing.nix: -------------------------------------------------------------------------------- 1 | _: { services.syncthing.enable = true; } 2 | -------------------------------------------------------------------------------- /dotfiles/config/shell/starship.nix: -------------------------------------------------------------------------------- 1 | _: { 2 | programs.bash.enable = true; 3 | 4 | programs.starship = { 5 | enable = true; 6 | enableBashIntegration = true; 7 | enableZshIntegration = true; 8 | settings = { 9 | format = '' 10 | $directory$git_branch$git_status$env_var $cmd_duration 11 | $character''; 12 | 13 | add_newline = false; 14 | 15 | directory = { 16 | format = "[$path]($style)[$read_only]($read_only_style)"; 17 | style = "blue"; 18 | read_only = ""; 19 | read_only_style = "yellow"; 20 | truncation_symbol = ".../"; 21 | truncate_to_repo = false; 22 | }; 23 | 24 | character = { 25 | format = "$symbol "; 26 | success_symbol = "[\\$](purple)"; 27 | error_symbol = "[\\$](red)"; 28 | vicmd_symbol = "[!](green)"; 29 | }; 30 | 31 | cmd_duration = { 32 | format = "[$duration]($style)"; 33 | style = "yellow"; 34 | }; 35 | 36 | git_branch = { 37 | format = " [$symbol$branch]($style)"; 38 | symbol = ""; 39 | style = "white"; 40 | }; 41 | 42 | git_status = { 43 | format = " [$ahead_behind](cyan)"; 44 | }; 45 | 46 | env_var = { 47 | IN_NIX_SHELL = { 48 | format = "[󱒫 ](bold gray)[](cyan)"; 49 | variable = "IN_NIX_SHELL"; 50 | }; 51 | 52 | IN_PERL_SHELL = { 53 | format = "[󱒫 ](bold gray)[](purple)"; 54 | variable = "IN_PERL_SHELL"; 55 | }; 56 | }; 57 | }; 58 | }; 59 | } 60 | -------------------------------------------------------------------------------- /dotfiles/config/shell/zsh.nix: -------------------------------------------------------------------------------- 1 | { pkgs, lib, ... }: 2 | { 3 | programs.zsh = { 4 | enable = true; 5 | autocd = true; 6 | shellAliases = { 7 | "l" = "ls --color -F -la"; 8 | "ls" = "ls --color -F"; 9 | "nixos-apply" = 10 | ''sudo nixos-rebuild switch --flake "/etc/nixos#$(hostname)" ; sudo systemctl restart home-manager-$(id -n -u).service''; 11 | "nixos-build" = ''sudo nixos-rebuild build --flake "/etc/nixos/#$(hostname)"''; 12 | "nixos-upgrade" = ''sudo nixos-rebuild boot --flake "/etc/nixos#$(hostname)"''; 13 | "waydroid" = "env XDG_DATA_HOME=/persist/home/nyarla/.local/share waydroid"; 14 | }; 15 | sessionVariables = { 16 | FAKE_RELEASE = 1; 17 | GOPATH = "$HOME/Applications/Development/go"; 18 | NIXPKGS_ALLOW_UNFREE = 1; 19 | EDITOR = "nvim"; 20 | }; 21 | enableCompletion = true; 22 | syntaxHighlighting.enable = true; 23 | history = { 24 | size = 10000; 25 | path = "$HOME/.zsh_history"; 26 | ignorePatterns = [ ]; 27 | ignoreDups = true; 28 | share = true; 29 | }; 30 | plugins = [ 31 | { 32 | name = "enhancd"; 33 | file = "init.sh"; 34 | src = pkgs.fetchFromGitHub { 35 | owner = "babarot"; 36 | repo = "enhancd"; 37 | rev = "5afb4eb6ba36c15821de6e39c0a7bb9d6b0ba415"; 38 | hash = "sha256-pKQbwiqE0KdmRDbHQcW18WfxyJSsKfymWt/TboY2iic="; 39 | }; 40 | } 41 | ]; 42 | initExtraFirst = '' 43 | # enable home-manager 44 | export PATH=${ 45 | lib.strings.concatStringsSep ":" [ 46 | "$HOME/.nix-profile/bin" 47 | "$HOME/.local/bin" 48 | "$HOME/.fly/bin" 49 | "$GOPATH/bin" 50 | "$PATH" 51 | ] 52 | } 53 | 54 | # utility function 55 | function has() { 56 | type "''${1:-}" >/dev/null 2>&1 57 | } 58 | ''; 59 | initExtra = '' 60 | setopt auto_pushd 61 | setopt pushd_ignore_dups 62 | setopt pushd_to_home 63 | setopt hist_ignore_all_dups 64 | setopt hist_reduce_blanks 65 | setopt hist_find_no_dups 66 | 67 | function nixos-clean() { 68 | sudo nix-collect-garbage --delete-older-than 7d 69 | sudo /run/current-system/bin/switch-to-configuration boot 70 | } 71 | 72 | if has fzy ; then 73 | function fzy-history() { 74 | BUFFER="$(fc -l -n 1 | sort -u | fzy --query "''${LBUFFER}")" 75 | CURSOR=$#BUFFER 76 | zle -R -c 77 | } 78 | 79 | zle -N fzy-history 80 | bindkey '^R' fzy-history 81 | fi 82 | 83 | unset -f has 84 | ''; 85 | }; 86 | 87 | home.packages = with pkgs; [ 88 | fzy 89 | mmv-go 90 | ripgrep 91 | tmux 92 | wcwidth-cjk 93 | 94 | file 95 | gawk 96 | gnumake 97 | gnused 98 | 99 | inotify-tools 100 | 101 | keychain 102 | 103 | bc 104 | tree 105 | ]; 106 | } 107 | -------------------------------------------------------------------------------- /dotfiles/config/tools/archiver.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | { 3 | home.packages = with pkgs; [ 4 | bzip2 5 | cpio 6 | # dmg2img 7 | gnutar 8 | lzip 9 | nodePackages.asar 10 | p7zip 11 | # pbzx 12 | unrar 13 | unzip 14 | # xar 15 | xz 16 | zip 17 | zstd 18 | ]; 19 | } 20 | -------------------------------------------------------------------------------- /dotfiles/config/tools/development.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | { 3 | home.packages = with pkgs; [ 4 | # container toolchain 5 | act 6 | 7 | # compiler 8 | clang-tools 9 | binutils 10 | gdb 11 | pkg-config 12 | stdenv.cc 13 | 14 | # go 15 | go 16 | 17 | # python3 18 | python3 19 | 20 | # perl 21 | perl-shell 22 | 23 | # nix 24 | nurl 25 | 26 | # editor 27 | editorconfig-core-c 28 | nvim-run 29 | devenv 30 | nodejs 31 | 32 | # vcs 33 | git-lfs 34 | 35 | # misc 36 | openssl 37 | ]; 38 | } 39 | -------------------------------------------------------------------------------- /dotfiles/config/vars/appmenu.nix: -------------------------------------------------------------------------------- 1 | { lib }: 2 | let 3 | inherit (import ./xml.nix { inherit lib; }) labwc; 4 | inherit (labwc) 5 | action 6 | run 7 | sep 8 | list 9 | include 10 | script 11 | wine 12 | id 13 | sys 14 | ; 15 | 16 | exec = label: command: '' 17 | 18 | 19 | ${command} 20 | 21 | 22 | ''; 23 | 24 | stop = 25 | label: commandline: 26 | run label "sh -c 'systemctl --user stop graphical-session.target ; ${commandline}'"; 27 | 28 | menu = id: label: contains: '' 29 | 30 | ${builtins.concatStringsSep "\n" contains} 31 | 32 | ''; 33 | 34 | jack = 35 | cmd: 36 | let 37 | set-samplerate = "pw-metadata -n settings 0 clock.force-rate 96000"; 38 | set-buffer = "pw-metadata -n settings 0 clock.force-quantum 512"; 39 | in 40 | ''sh -c "${set-samplerate} ; ${set-buffer} ; QT_QPA_PLATFORM=xcb GDK_BACKEND=x11 pw-jack ${cmd}"''; 41 | 42 | mainList = list "Main" (id "main") [ 43 | (run "Terminal" "mlterm-wl") 44 | (list "Virtual Machine" (id "vm") [ 45 | (run "Virtual Machine Manager" "virt-manager") 46 | (run "Looking Glass" "looking-glass-client") 47 | (run "Remmina" "remmina") 48 | sep 49 | (run "Take Snapshot" "bash /etc/nixos/dotfiles/files/scripts/vm-snapshot-for-daw") 50 | ]) 51 | (list "Waydroid" (id "waydroid") [ 52 | (script "start" "waydroid-start") 53 | (script "stop" "waydroid-stop") 54 | ]) 55 | (run "Vial" "Vial") 56 | ]; 57 | 58 | internetList = list "Internet" (id "internet") [ 59 | (run "Firefox" "firefox") 60 | (run "Thunderbird" "thunderbird") 61 | sep 62 | (run "Google Chrome" "google-chrome-stable --enable-features=UseOzonePlatform --ozone-platform=wayland --enable-wayland-ime") 63 | sep 64 | (run "Telegram" "telegram-desktop") 65 | sep 66 | (run "Bitwaden" "bitwarden --enable-features=UseOzonePlatform --ozone-platform=wayland --enable-wayland-ime") 67 | ]; 68 | 69 | filesList = list "Files" (id "files") [ 70 | (run "Files" "Thunar") 71 | (run "eBooks" "calibre") 72 | (wine "Kindle" "Kindle") 73 | sep 74 | (run "Documents" "atril") 75 | (run "Music" "deadbeef") 76 | (run "Video" "vlc") 77 | sep 78 | (run "Text Edit" "pluma") 79 | sep 80 | (run "Picard" "picard") 81 | (run "EasyTag" "easytag") 82 | ]; 83 | 84 | officeList = list "Office" (id "office") [ 85 | (run "Calc" "mate-calc") 86 | (run "CharMap" "gucharmap") 87 | sep 88 | (run "Scanner" "simple-scan") 89 | ]; 90 | 91 | sysutilList = list "Configure" (sys "util") [ 92 | (run "Audio" "pwvucontrol") 93 | (run "Bluetooth" "blueman-manager") 94 | (run "DroidCam" "droidcam") 95 | sep 96 | (run "Keychain" "seahorse") 97 | sep 98 | (run "Task Manager" "missioncenter") 99 | ]; 100 | 101 | sysDisplayList = list "Display" (sys "display") [ 102 | (run "Always ON" "systemctl --user stop swaylock") 103 | (run "Enable AutoLock" "systemctl --user start swaylock") 104 | ]; 105 | 106 | sysOperationList = list "System" (sys "operation") [ 107 | (action "Reconfigure" "Reconfigure") 108 | sep 109 | (run "Lock" "swaylock -C ~/.config/swaylock/config -f") 110 | sep 111 | (stop "Logout" "loginctl terminate-session self") 112 | (stop "Exit" "labwc --exit") 113 | sep 114 | (stop "Reboot" "systemctl reboot") 115 | (stop "Shutdown" "shutdown -h now") 116 | ]; 117 | 118 | contextCreativeRoot = list "Creative" (id "creative") [ 119 | (list "Illustration" (id "illustration") [ 120 | (run "Gimp" "gimp") 121 | (run "Inkspace" "inkscape") 122 | sep 123 | (run "Krita" "krita") 124 | ]) 125 | (list "PixelArt" (id "pixelart") [ 126 | (run "Pixelorama" "pixelorama --rendering-driver vulkan --gpu-index 0 --display-driver wayland") 127 | (run "Aseprite" "aseprite") 128 | ]) 129 | sep 130 | (list "DAW" (id "daw") [ 131 | (run "Bitwig Studio" (jack "bitwig-studio")) 132 | (run "Heilo Workstation" (jack "helio")) 133 | (run "MuseScore" (jack "mscore")) 134 | (run "Zrythm" (jack "bash /etc/nixos/dotfiles/files/scripts/zrythm-launch")) 135 | sep 136 | (run "FamiStudio" "FamiStudio") 137 | sep 138 | (run "Sononym" (jack "sononym")) 139 | ]) 140 | (list "Plugins" (id "plugins") [ 141 | (run "Carla" (jack "carla")) 142 | (run "Ildaeil" (jack "Ildaeil")) 143 | sep 144 | (run "AudioGridder" (jack "AudioGridderServer")) 145 | ]) 146 | (list "VSinger" (id "vsynger") [ 147 | (run "VoiceVox" "voicevox") 148 | (run "OpenUtau" "OpenUtau") 149 | ]) 150 | ]; 151 | 152 | contextMenuRoot = list "Menu" "root-menu" [ 153 | (include (id "main")) 154 | (include (id "internet")) 155 | (include (id "files")) 156 | (include (id "office")) 157 | sep 158 | (include (sys "util")) 159 | (include (sys "display")) 160 | (include (sys "operation")) 161 | ]; 162 | in 163 | labwc.openbox [ 164 | mainList 165 | internetList 166 | filesList 167 | officeList 168 | 169 | sysutilList 170 | sysDisplayList 171 | sysOperationList 172 | 173 | contextMenuRoot 174 | contextCreativeRoot 175 | ] 176 | -------------------------------------------------------------------------------- /dotfiles/config/vars/theme.nix: -------------------------------------------------------------------------------- 1 | { 2 | cursor = { 3 | name = "capitaine-cursors-white"; 4 | size = "24"; 5 | }; 6 | } 7 | -------------------------------------------------------------------------------- /dotfiles/config/vars/xml.nix: -------------------------------------------------------------------------------- 1 | { lib }: 2 | rec { 3 | attrs = 4 | attributes: 5 | lib.strings.concatMapAttrsStringSep " " ( 6 | key: value: ''${key}="${lib.strings.escapeXML value}"'' 7 | ) attributes; 8 | 9 | tag = el: "<${el} />"; 10 | tag2 = el: attributes: "<${el} ${attrs attributes}/>"; 11 | 12 | el2 = el: contains: "<${el}>${lib.strings.concatStrings contains}"; 13 | el3 = el: attributes: contains: '' 14 | <${el} ${attrs attributes}> 15 | ${lib.strings.concatStringsSep "\n" contains} 16 | 17 | ''; 18 | 19 | labwc = rec { 20 | # 21 | execute = commandline: el2 "command" [ commandline ]; 22 | stop = 23 | commandline: execute "bash -c 'systemctl --user stop graphic-session.target ; ${commandline}'"; 24 | 25 | # 26 | action = 27 | label: name: 28 | el3 "item" { inherit label; } [ 29 | (tag2 "action" { inherit name; }) 30 | ]; 31 | run = 32 | label: commandline: 33 | el3 "item" { inherit label; } [ 34 | (el3 "action" { name = "Execute"; } [ (execute commandline) ]) 35 | ]; 36 | script = label: script: run label "bash /etc/nixos/dotfiles/files/scripts/${script}"; 37 | wine = label: app: run label "bash /etc/nixos/dotfiles/files/wine/${app}"; 38 | 39 | # 40 | sep = tag "separator"; 41 | 42 | # 43 | list = 44 | label: id: contains: 45 | el3 "menu" { inherit label id; } contains; 46 | 47 | include = id: tag2 "menu" { inherit id; }; 48 | 49 | # system 50 | openbox = contains: '' 51 | 52 | 53 | ${lib.strings.concatStringsSep "\n" contains} 54 | 55 | ''; 56 | 57 | # utilities 58 | id = id: "applications-${id}"; 59 | sys = id: "system-${id}"; 60 | }; 61 | } 62 | -------------------------------------------------------------------------------- /dotfiles/files/desktop/creative-menu.desktop: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env xdg-open 2 | [Desktop Entry] 3 | Type=Application 4 | Version=1.0 5 | Name=Creative 6 | Exec=sh -c "ydotool mousemove -a 0 12; ydotool key 56:1 60:1 60:0 56:0" 7 | Icon=gnome-paint 8 | Terminal=false 9 | -------------------------------------------------------------------------------- /dotfiles/files/desktop/root-menu.desktop: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env xdg-open 2 | [Desktop Entry] 3 | Type=Application 4 | Version=1.0 5 | Name=Menu 6 | Exec=sh -c "ydotool mousemove -a 0 12; ydotool key 56:1 59:1 59:0 56:0" 7 | Icon=distributor-logo-nixos 8 | Terminal=false 9 | -------------------------------------------------------------------------------- /dotfiles/files/scripts/mount-btrfs.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | test -d /tmp/btrfs || sudo mkdir -p /tmp/btrfs 4 | test -d /tmp/btrfs/nix || sudo mount -t btrfs -o compress=zstd,ssd,space_cache=v2 /dev/mapper/nixos /tmp/btrfs 5 | -------------------------------------------------------------------------------- /dotfiles/files/scripts/prepare-generative-ai: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | sudo modprobe nvidia_uvm 4 | sudo modprobe nvidia 5 | 6 | sudo systemctl restart ollama 7 | sudo systemctl restart open-webui 8 | -------------------------------------------------------------------------------- /dotfiles/files/scripts/prepare-windows-vm: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -euo pipefail 4 | 5 | main() { 6 | if ! which modprobe 2>/dev/null ; then 7 | echo "modprobe is not found" >&2; 8 | exit 1 9 | fi 10 | 11 | if sudo bash -x /var/lib/libvirt/hooks/qemu.d/DAW/prepare/begin/01_alloc_hugepage.sh; then 12 | sudo bash -x /var/lib/libvirt/hooks/qemu.d/DAW/release/end/01_dealloc_hugepage.sh 13 | fi 14 | 15 | sudo systemctl stop nvidia-kernel-modules 16 | 17 | sudo modprobe -r nvidia_uvm 18 | sudo modprobe -r nvidia 19 | } 20 | 21 | main 22 | -------------------------------------------------------------------------------- /dotfiles/files/scripts/snapper-clean-all: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -euo pipefail 4 | 5 | cleanup-snapshot() { 6 | local config=$1 path=$2 7 | 8 | cd $path && \ls | xargs -I{} snapper -c $config delete {} 9 | } 10 | 11 | cleanup-snapshot nixos /persist/etc/nixos/.snapshots 12 | cleanup-snapshot varlib /persist/var/lib/.snapshots 13 | cleanup-snapshot usrshare /persist/usr/share/.snapshots 14 | cleanup-snapshot nyarla /persist/home/nyarla/.snapshots 15 | cleanup-snapshot apps /persist/home/nyarla/Applications/.snapshots 16 | cleanup-snapshot program /persist/home/nyarla/Programming/.snapshots 17 | 18 | sudo mkdir -p /tmp/btrfs 19 | sudo mount /dev/mapper/nixos /tmp/btrfs 20 | 21 | cd /tmp/btrfs 22 | sudo btrfs scrub start . 23 | -------------------------------------------------------------------------------- /dotfiles/files/scripts/synthv: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | cd "$HOME/Applications/Programs/Synthesizer V Studio Pro" && nix-shell 4 | -------------------------------------------------------------------------------- /dotfiles/files/scripts/vanish-check: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | search() { 4 | local dir=$1 5 | find "$dir"/.* -maxdepth 0 6 | find "$dir"/.config/* -maxdepth 0 7 | find "$dir"/.local/share/* -maxdepth 0 8 | } 9 | 10 | main() { 11 | local tmp 12 | tmp=$(mktemp -d) 13 | test -d "${tmp}" || mkdir -p "${tmp}" 14 | 15 | search "${HOME}" | sort -u > "${tmp}/exists" 16 | search "/persist${HOME}" | sort -u | sed 's|/persist||' > "${tmp}/persist" 17 | 18 | IFS=$'\n' 19 | for f in $(comm -23 "${tmp}/exists" "${tmp}/persist"); do 20 | test -L "${f}" || echo "${f}" 21 | done 22 | 23 | test ! -d "${tmp}" || rm "${tmp}" -r 24 | } 25 | 26 | main; 27 | -------------------------------------------------------------------------------- /dotfiles/files/scripts/vm-snapshot-for-daw: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -euo pipefail 4 | 5 | main() { 6 | local name 7 | name=$(zenity --entry --text="Snapshot名を入れてください") 8 | 9 | local prefix 10 | prefix=$(date +%Y.%m) 11 | 12 | if [[ -n "${name}" ]]; then 13 | env SHELL=/bin/sh pkexec sh -c " 14 | cd /vm/special && sudo btrfs subvol snapshot images .snapshots/${prefix}.${name} 15 | cd /vm/main/DAW && sudo btrfs subvol snapshot images .snapshots/${prefix}.${name} 16 | " && zenity --info --text="${prefix}.${name}を作成しました" 17 | fi 18 | } 19 | 20 | main; 21 | -------------------------------------------------------------------------------- /dotfiles/files/scripts/waydroid-start: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -euo pipefail 4 | 5 | grep -qF 'Established ADB connection to Waydroid device' <(waydroid -w show-full-ui 2>&1) \ 6 | && env SHELL=/bin/sh pkexec sh -c ' 7 | sudo mount --bind /backup/Music /persist/home/nyarla/.local/share/waydroid/data/media/0/Music 8 | sudo mount --bind /persist/home/nyarla/Downloads /persist/home/nyarla/.local/share/waydroid/data/media/0/Download 9 | ' 10 | -------------------------------------------------------------------------------- /dotfiles/files/scripts/waydroid-stop: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -euo pipefail 4 | 5 | waydroid session stop 6 | 7 | env SHELL=/bin/sh pkexec sh -c ' 8 | sudo umount /persist/home/nyarla/.local/share/waydroid/data/media/0/Music 9 | sudo umount /persist/home/nyarla/.local/share/waydroid/data/media/0/eBooks 10 | sudo umount /persist/home/nyarla/.local/share/waydroid/data/media/0/Download 11 | ' 12 | -------------------------------------------------------------------------------- /dotfiles/files/scripts/zrythm-launch: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -euo pipefail 4 | 5 | main() { 6 | test -d ~/.config/zrythm.d || mkdir ~/.config/zrythm.d 7 | 8 | for dir in audiogridder dconf fcitx ibus pulse ; do 9 | test -L ~/.config/zrythm.d/"${dir}" || ln -sf ~/.config/"${dir}" ~/.config/zrythm.d/"${dir}" 10 | done 11 | 12 | env XDG_CONFIG_HOME=~/.config/zrythm.d zrythm_launch 13 | } 14 | 15 | main 16 | -------------------------------------------------------------------------------- /dotfiles/files/wine/Kindle: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -euo pipefail 4 | 5 | cd "$HOME"/Applications/Wine/Kindle 6 | 7 | wine-staging wine 'C:\Program Files (x86)\Amazon\Kindle\Kindle.exe' & 8 | waitPID=$! 9 | 10 | test -n "$waitPID" && wait $waitPID 11 | 12 | wine-staging wineboot --shutdown 13 | 14 | exit 0 15 | -------------------------------------------------------------------------------- /dotfiles/files/wine/MP3TAGS: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -euo pipefail 4 | 5 | cd $HOME/Applications/Wine/MP3TAG 6 | 7 | 8 | wine-staging wine 'C:\Program Files\Mp3tag\Mp3tag.exe' & 9 | waitPID=$! 10 | 11 | test -n "$waitPID" && wait $waitPID 12 | 13 | wine-staging wineboot --shutdown 14 | 15 | exit 0 16 | -------------------------------------------------------------------------------- /dotfiles/user/nyarla.nix: -------------------------------------------------------------------------------- 1 | _: { 2 | imports = [ 3 | ../config/app/browser.nix 4 | ../config/app/chat.nix 5 | ../config/app/creative.nix 6 | ../config/app/multimedia.nix 7 | ../config/app/office.nix 8 | ../config/app/wine.nix 9 | ../config/desktop/theme.nix 10 | ../config/files/skk.nix 11 | ../config/nixos/gsettings.nix 12 | ../config/services/polkit.nix 13 | ../config/services/syncthing.nix 14 | ../config/shell/starship.nix 15 | ../config/shell/zsh.nix 16 | ../config/tools/archiver.nix 17 | ../config/tools/development.nix 18 | 19 | ../app/git 20 | ../app/hyprland 21 | ../app/mlterm 22 | ../app/xdg 23 | ]; 24 | 25 | # More customizations 26 | # =================== 27 | 28 | # Development 29 | # ----------- 30 | 31 | # git 32 | programs.git.userName = "nyarla"; 33 | programs.git.userEmail = "nyarla@kalaclista.com"; 34 | 35 | # keychain (ssh) 36 | programs.keychain.keys = [ "id_ed25519" ]; 37 | 38 | # System configuration 39 | # ==================== 40 | 41 | # home-manager 42 | # ------------- 43 | programs.home-manager.enable = true; 44 | systemd.user.startServices = "sd-switch"; 45 | 46 | # stateVersion (same as NixOS) 47 | home.stateVersion = "24.11"; 48 | home.enableNixpkgsReleaseCheck = false; 49 | nix.nixPath = [ "nixpkgs=/etc/nixpkgs" ]; 50 | } 51 | -------------------------------------------------------------------------------- /flake.lock: -------------------------------------------------------------------------------- 1 | { 2 | "nodes": { 3 | "flake-compat": { 4 | "locked": { 5 | "lastModified": 1746162366, 6 | "narHash": "sha256-5SSSZ/oQkwfcAz/o/6TlejlVGqeK08wyREBQ5qFFPhM=", 7 | "owner": "nix-community", 8 | "repo": "flake-compat", 9 | "rev": "0f158086a2ecdbb138cd0429410e44994f1b7e4b", 10 | "type": "github" 11 | }, 12 | "original": { 13 | "owner": "nix-community", 14 | "repo": "flake-compat", 15 | "type": "github" 16 | } 17 | }, 18 | "flake-utils": { 19 | "inputs": { 20 | "systems": "systems" 21 | }, 22 | "locked": { 23 | "lastModified": 1731533236, 24 | "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", 25 | "owner": "numtide", 26 | "repo": "flake-utils", 27 | "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", 28 | "type": "github" 29 | }, 30 | "original": { 31 | "owner": "numtide", 32 | "repo": "flake-utils", 33 | "type": "github" 34 | } 35 | }, 36 | "home-manager": { 37 | "inputs": { 38 | "nixpkgs": [ 39 | "nixpkgs" 40 | ] 41 | }, 42 | "locked": { 43 | "lastModified": 1746798521, 44 | "narHash": "sha256-axfz/jBEH9XHpS7YSumstV7b2PrPf7L8bhWUtLBv3nA=", 45 | "owner": "nix-community", 46 | "repo": "home-manager", 47 | "rev": "e95a7c5b6fa93304cd2fd78cf676c4f6d23c422c", 48 | "type": "github" 49 | }, 50 | "original": { 51 | "owner": "nix-community", 52 | "repo": "home-manager", 53 | "type": "github" 54 | } 55 | }, 56 | "impermanence": { 57 | "locked": { 58 | "lastModified": 1737831083, 59 | "narHash": "sha256-LJggUHbpyeDvNagTUrdhe/pRVp4pnS6wVKALS782gRI=", 60 | "owner": "nix-community", 61 | "repo": "impermanence", 62 | "rev": "4b3e914cdf97a5b536a889e939fb2fd2b043a170", 63 | "type": "github" 64 | }, 65 | "original": { 66 | "owner": "nix-community", 67 | "repo": "impermanence", 68 | "type": "github" 69 | } 70 | }, 71 | "lib-aggregate": { 72 | "inputs": { 73 | "flake-utils": "flake-utils", 74 | "nixpkgs-lib": "nixpkgs-lib" 75 | }, 76 | "locked": { 77 | "lastModified": 1746360860, 78 | "narHash": "sha256-Vtl1JSnHbA6WlGVXjYPsex5mX8NTaGyeVSlYtkZGW24=", 79 | "owner": "nix-community", 80 | "repo": "lib-aggregate", 81 | "rev": "75d6b241245412361502277e607c67a004a6e5b0", 82 | "type": "github" 83 | }, 84 | "original": { 85 | "owner": "nix-community", 86 | "repo": "lib-aggregate", 87 | "type": "github" 88 | } 89 | }, 90 | "nixpkgs": { 91 | "locked": { 92 | "lastModified": 1746843136, 93 | "narHash": "sha256-uOKsY0wdreAlbxuMTJlKDr8pIfWB7ghfYdT8zbbZCH8=", 94 | "owner": "NixOS", 95 | "repo": "nixpkgs", 96 | "rev": "6a0960ad4b3d13bff34bd78e9fcefc4310507707", 97 | "type": "github" 98 | }, 99 | "original": { 100 | "owner": "NixOS", 101 | "ref": "master", 102 | "repo": "nixpkgs", 103 | "type": "github" 104 | } 105 | }, 106 | "nixpkgs-lib": { 107 | "locked": { 108 | "lastModified": 1746321463, 109 | "narHash": "sha256-43ZRYqB6pkhfKPZamMbuD/JrGYcapX87feHxMNyfyDQ=", 110 | "owner": "nix-community", 111 | "repo": "nixpkgs.lib", 112 | "rev": "168ab62539da203ca62ab16b7f8cf411530b91e7", 113 | "type": "github" 114 | }, 115 | "original": { 116 | "owner": "nix-community", 117 | "repo": "nixpkgs.lib", 118 | "type": "github" 119 | } 120 | }, 121 | "root": { 122 | "inputs": { 123 | "home-manager": "home-manager", 124 | "impermanence": "impermanence", 125 | "nixpkgs": "nixpkgs", 126 | "wayland": "wayland" 127 | } 128 | }, 129 | "systems": { 130 | "locked": { 131 | "lastModified": 1681028828, 132 | "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", 133 | "owner": "nix-systems", 134 | "repo": "default", 135 | "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", 136 | "type": "github" 137 | }, 138 | "original": { 139 | "owner": "nix-systems", 140 | "repo": "default", 141 | "type": "github" 142 | } 143 | }, 144 | "wayland": { 145 | "inputs": { 146 | "flake-compat": "flake-compat", 147 | "lib-aggregate": "lib-aggregate", 148 | "nixpkgs": [ 149 | "nixpkgs" 150 | ] 151 | }, 152 | "locked": { 153 | "lastModified": 1746797390, 154 | "narHash": "sha256-UIPEX+L7NPOA4453TlNfi4TfbuKzrG5Qy2UUhM0ENwg=", 155 | "owner": "nix-community", 156 | "repo": "nixpkgs-wayland", 157 | "rev": "81c858e12865b04c792ae582306cfded4053918c", 158 | "type": "github" 159 | }, 160 | "original": { 161 | "owner": "nix-community", 162 | "repo": "nixpkgs-wayland", 163 | "type": "github" 164 | } 165 | } 166 | }, 167 | "root": "root", 168 | "version": 7 169 | } 170 | -------------------------------------------------------------------------------- /flake.nix: -------------------------------------------------------------------------------- 1 | { 2 | description = "NixOS configurations for my PCs"; 3 | inputs = { 4 | nixpkgs.url = "github:NixOS/nixpkgs/master"; 5 | nixpkgs.inputs.nixpkgs.follows = "nixpkgs"; 6 | 7 | home-manager.url = "github:nix-community/home-manager"; 8 | home-manager.inputs.nixpkgs.follows = "nixpkgs"; 9 | 10 | wayland.url = "github:nix-community/nixpkgs-wayland"; 11 | wayland.inputs.nixpkgs.follows = "nixpkgs"; 12 | 13 | impermanence.url = "github:nix-community/impermanence"; 14 | }; 15 | outputs = 16 | { 17 | nixpkgs, 18 | home-manager, 19 | wayland, 20 | impermanence, 21 | ... 22 | }: 23 | { 24 | legacyPackages.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.extend ( 25 | final: prev: 26 | prev 27 | // (import ./pkgs/default.nix { inherit nixpkgs; } final prev) 28 | // (import ./pkgs/temporary.nix { inherit nixpkgs; } final prev) 29 | ); 30 | 31 | ## test 32 | nixosConfigurations = 33 | let 34 | nixosSystem = 35 | opts: 36 | (import ./lib/nixosSystem.nix { 37 | inherit nixpkgs; 38 | inherit (opts) system patches; 39 | }) 40 | { 41 | inherit (opts) 42 | hostname 43 | profile 44 | overlays 45 | modules 46 | ; 47 | }; 48 | in 49 | { 50 | nixos = nixosSystem { 51 | hostname = "nixos"; 52 | profile = import ./system/profile/NyZen9.nix; 53 | system = "x86_64-linux"; 54 | patches = [ ]; 55 | overlays = [ 56 | wayland.overlay 57 | (import ./pkgs/default.nix { inherit nixpkgs; }) 58 | (import ./pkgs/temporary.nix { inherit nixpkgs; }) 59 | ]; 60 | 61 | modules = [ 62 | impermanence.nixosModules.impermanence 63 | home-manager.nixosModules.home-manager 64 | (_: { 65 | home-manager = { 66 | useGlobalPkgs = true; 67 | useUserPackages = false; 68 | users.nyarla = import ./dotfiles/user/nyarla.nix; 69 | }; 70 | }) 71 | ]; 72 | }; 73 | }; 74 | }; 75 | } 76 | -------------------------------------------------------------------------------- /lib/nixosSystem.nix: -------------------------------------------------------------------------------- 1 | let 2 | nixosSystem = 3 | { 4 | nixpkgs, 5 | system, 6 | patches, 7 | }: 8 | let 9 | applyPatch = 10 | patches: 11 | nixpkgs.legacyPackages.${system}.applyPatches { 12 | name = "nixpkgs-patched-${nixpkgs.shortRev}"; 13 | src = nixpkgs; 14 | inherit patches; 15 | }; 16 | 17 | flake = applyPatch patches; 18 | in 19 | { 20 | hostname, 21 | profile, 22 | overlays, 23 | modules, 24 | }: 25 | import "${flake}/nixos/lib/eval-config.nix" { 26 | inherit system; 27 | specialArgs = { 28 | modulesPath = toString (flake + "/nixos/modules"); 29 | }; 30 | baseModules = import (flake + "/nixos/modules/module-list.nix"); 31 | 32 | modules = modules ++ [ 33 | ( 34 | { pkgs, ... }: 35 | { 36 | 37 | # hostname 38 | networking.hostName = hostname; 39 | 40 | # nix 41 | nix = { 42 | # workaround for devenv 1.0.8 43 | package = pkgs.nixVersions.nix_2_24; 44 | registry = { 45 | nixpkgs = { 46 | inherit flake; 47 | }; 48 | }; 49 | settings = { 50 | trusted-public-keys = [ 51 | "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" 52 | "nixpkgs-wayland.cachix.org-1:3lwxaILxMRkVhehr5StQprHdEo4IrE8sRho9R9HOLYA=" 53 | ]; 54 | 55 | trusted-users = [ 56 | "root" 57 | "@wheel" 58 | ]; 59 | 60 | substituters = [ 61 | "https://cache.nixos.org" 62 | "https://nixpkgs-wayland.cachix.org" 63 | ]; 64 | 65 | experimental-features = [ 66 | "nix-command" 67 | "flakes" 68 | ]; 69 | }; 70 | 71 | nixPath = [ "nixpkgs=${flake}" ]; 72 | }; 73 | 74 | nixpkgs = { 75 | inherit overlays; 76 | config = { 77 | allowUnfree = true; 78 | }; 79 | }; 80 | 81 | systemd.tmpfiles.rules = [ "L+ /etc/nixpkgs - - - - ${flake}" ]; 82 | } 83 | ) 84 | 85 | profile 86 | ]; 87 | }; 88 | in 89 | nixosSystem 90 | -------------------------------------------------------------------------------- /patches/tmux3.5a-utf8.patch: -------------------------------------------------------------------------------- 1 | diff --git a/utf8.c b/utf8.c 2 | index bc7c8fd2..2856f0ac 100644 3 | --- a/utf8.c 4 | +++ b/utf8.c 5 | @@ -26,171 +26,7 @@ 6 | 7 | #include "compat.h" 8 | #include "tmux.h" 9 | - 10 | -static const wchar_t utf8_force_wide[] = { 11 | - 0x0261D, 12 | - 0x026F9, 13 | - 0x0270A, 14 | - 0x0270B, 15 | - 0x0270C, 16 | - 0x0270D, 17 | - 0x1F1E6, 18 | - 0x1F1E7, 19 | - 0x1F1E8, 20 | - 0x1F1E9, 21 | - 0x1F1EA, 22 | - 0x1F1EB, 23 | - 0x1F1EC, 24 | - 0x1F1ED, 25 | - 0x1F1EE, 26 | - 0x1F1EF, 27 | - 0x1F1F0, 28 | - 0x1F1F1, 29 | - 0x1F1F2, 30 | - 0x1F1F3, 31 | - 0x1F1F4, 32 | - 0x1F1F5, 33 | - 0x1F1F6, 34 | - 0x1F1F7, 35 | - 0x1F1F8, 36 | - 0x1F1F9, 37 | - 0x1F1FA, 38 | - 0x1F1FB, 39 | - 0x1F1FC, 40 | - 0x1F1FD, 41 | - 0x1F1FE, 42 | - 0x1F1FF, 43 | - 0x1F385, 44 | - 0x1F3C2, 45 | - 0x1F3C3, 46 | - 0x1F3C4, 47 | - 0x1F3C7, 48 | - 0x1F3CA, 49 | - 0x1F3CB, 50 | - 0x1F3CC, 51 | - 0x1F3FB, 52 | - 0x1F3FC, 53 | - 0x1F3FD, 54 | - 0x1F3FE, 55 | - 0x1F3FF, 56 | - 0x1F442, 57 | - 0x1F443, 58 | - 0x1F446, 59 | - 0x1F447, 60 | - 0x1F448, 61 | - 0x1F449, 62 | - 0x1F44A, 63 | - 0x1F44B, 64 | - 0x1F44C, 65 | - 0x1F44D, 66 | - 0x1F44E, 67 | - 0x1F44F, 68 | - 0x1F450, 69 | - 0x1F466, 70 | - 0x1F467, 71 | - 0x1F468, 72 | - 0x1F469, 73 | - 0x1F46B, 74 | - 0x1F46C, 75 | - 0x1F46D, 76 | - 0x1F46E, 77 | - 0x1F470, 78 | - 0x1F471, 79 | - 0x1F472, 80 | - 0x1F473, 81 | - 0x1F474, 82 | - 0x1F475, 83 | - 0x1F476, 84 | - 0x1F477, 85 | - 0x1F478, 86 | - 0x1F47C, 87 | - 0x1F481, 88 | - 0x1F482, 89 | - 0x1F483, 90 | - 0x1F485, 91 | - 0x1F486, 92 | - 0x1F487, 93 | - 0x1F48F, 94 | - 0x1F491, 95 | - 0x1F4AA, 96 | - 0x1F574, 97 | - 0x1F575, 98 | - 0x1F57A, 99 | - 0x1F590, 100 | - 0x1F595, 101 | - 0x1F596, 102 | - 0x1F645, 103 | - 0x1F646, 104 | - 0x1F647, 105 | - 0x1F64B, 106 | - 0x1F64C, 107 | - 0x1F64D, 108 | - 0x1F64E, 109 | - 0x1F64F, 110 | - 0x1F6A3, 111 | - 0x1F6B4, 112 | - 0x1F6B5, 113 | - 0x1F6B6, 114 | - 0x1F6C0, 115 | - 0x1F6CC, 116 | - 0x1F90C, 117 | - 0x1F90F, 118 | - 0x1F918, 119 | - 0x1F919, 120 | - 0x1F91A, 121 | - 0x1F91B, 122 | - 0x1F91C, 123 | - 0x1F91D, 124 | - 0x1F91E, 125 | - 0x1F91F, 126 | - 0x1F926, 127 | - 0x1F930, 128 | - 0x1F931, 129 | - 0x1F932, 130 | - 0x1F933, 131 | - 0x1F934, 132 | - 0x1F935, 133 | - 0x1F936, 134 | - 0x1F937, 135 | - 0x1F938, 136 | - 0x1F939, 137 | - 0x1F93D, 138 | - 0x1F93E, 139 | - 0x1F977, 140 | - 0x1F9B5, 141 | - 0x1F9B6, 142 | - 0x1F9B8, 143 | - 0x1F9B9, 144 | - 0x1F9BB, 145 | - 0x1F9CD, 146 | - 0x1F9CE, 147 | - 0x1F9CF, 148 | - 0x1F9D1, 149 | - 0x1F9D2, 150 | - 0x1F9D3, 151 | - 0x1F9D4, 152 | - 0x1F9D5, 153 | - 0x1F9D6, 154 | - 0x1F9D7, 155 | - 0x1F9D8, 156 | - 0x1F9D9, 157 | - 0x1F9DA, 158 | - 0x1F9DB, 159 | - 0x1F9DC, 160 | - 0x1F9DD, 161 | - 0x1FAC3, 162 | - 0x1FAC4, 163 | - 0x1FAC5, 164 | - 0x1FAF0, 165 | - 0x1FAF1, 166 | - 0x1FAF2, 167 | - 0x1FAF3, 168 | - 0x1FAF4, 169 | - 0x1FAF5, 170 | - 0x1FAF6, 171 | - 0x1FAF7, 172 | - 0x1FAF8 173 | -}; 174 | +#include "utf8_force_wide.h" 175 | 176 | struct utf8_item { 177 | RB_ENTRY(utf8_item) index_entry; 178 | -------------------------------------------------------------------------------- /patches/weylus.patch: -------------------------------------------------------------------------------- 1 | diff --git a/ts/lib.ts b/ts/lib.ts 2 | index 53f72d4..d93169f 100644 3 | --- a/ts/lib.ts 4 | +++ b/ts/lib.ts 5 | @@ -944,7 +944,7 @@ function handle_messages( 6 | let msg = JSON.parse(event.data); 7 | if (typeof msg == "string") { 8 | if (msg == "NewVideo") { 9 | - let MS = window.ManagedMediaSource ? window.ManagedMediaSource : window.MediaSource; 10 | + let MS = window.MediaSource; 11 | mediaSource = new MS(); 12 | sourceBuffer = null; 13 | video.src = URL.createObjectURL(mediaSource); 14 | -------------------------------------------------------------------------------- /pkgs/aria-misskey/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | stdenv, 3 | lib, 4 | runCommand, 5 | fetchFromGitHub, 6 | 7 | flutter329, 8 | rustPlatform, 9 | cargo, 10 | yq, 11 | }: 12 | let 13 | source = fetchFromGitHub { 14 | owner = "poppingmoon"; 15 | repo = "aria"; 16 | rev = "7a6ec27c9c2f1a5bef0cc4ebff67833c76908478"; 17 | hash = "sha256-akIAJmeb4jiYhRCmf3XDrS8h8R3wdfOcpMJ5a9+XB3U="; 18 | fetchSubmodules = true; 19 | }; 20 | 21 | src = runCommand "aria-src" { } '' 22 | mkdir -p $out 23 | cp -r '${source}'/* "$out" 24 | 25 | chmod -R +w $out 26 | cd $out 27 | patch -p1 -i ${./rust_lib_aria.patch} 28 | ''; 29 | in 30 | flutter329.buildFlutterApplication rec { 31 | pname = "aria"; 32 | version = "v1.0.0-beta.9"; 33 | inherit src; 34 | 35 | pubspecLock = 36 | let 37 | lockfile = runCommand "build-aria-pubspec.json" { nativeBuildInputs = [ yq ]; } '' 38 | yq '.' ${src}/pubspec.lock > $out 39 | ''; 40 | in 41 | lib.importJSON "${lockfile}"; 42 | 43 | gitHashes = { 44 | "flutter_apns_only" = "sha256-5KlICoKqekSE4LCzd1MP+o8Ezq0xLZmzeAQZExXBalM="; 45 | "flutter_highlighting" = "sha256-YtCAFbFrSwjW4WRqMXWty60Q4GFVX0OTIBqn2GsLRj4="; 46 | "flutter_html" = "sha256-/BrcXZ6im/Sb3UVbdlfjYV3R3lOzKdmoAWY4ikgoVRg=;"; 47 | "highlighting" = "sha256-IedjKNGFBSbU4vu5x8GI28WL4uJ8B/kvw6iGkX2+uGg="; 48 | "image_compression" = "sha256-9RBjKId8TYdx3O0wT2We8FbCiJYkqJlyBY7TYDUxsMg="; 49 | "material_off_icons" = "sha256-jMO1abOm1YgFAAbFaTFgTjrmQGW6d7Z1J4o2wTynto4="; 50 | "mfm_parser" = "sha256-GJUTuX3cPYe3Weo5VzYVXJuvc0EmrLmxCGgStYfH1lk="; 51 | "misskey_dart" = "sha256-SXHpV8ZeKAojgongzIyf28Yj2aK7s1j1cQoJ9lmojp8="; 52 | "receive_sharing_intent" = "sha256-8D5ZENARPZ7FGrdIErxOoV3Ao35/XoQ2tleegI42ZUY="; 53 | "tinycolor2" = "sha256-RGjhuX6487TJ2ofNdJS1FCMl6ciKU0qkGKg4yfkPE+w="; 54 | "twemoji_v2" = "sha256-Gi9PIMpw4NWkk357X+iZPUhzIKMDg5WdzTPHvJDBzSg="; 55 | "webcrypto" = "sha256-KXPJk/Da9LiM0q8URqGz5zAioHpJALlqbUNeZLNrNMY="; 56 | }; 57 | 58 | targetFlutterPlatform = "linux"; 59 | 60 | cargoRoot = "rust"; 61 | cargoDeps = rustPlatform.importCargoLock { 62 | lockFile = src + /rust/Cargo.lock; 63 | outputHashes = { 64 | "aiscript-0.1.0" = "sha256-4OGaYbMlQn/Ejh8Ff2uhJbHTkf85CwoGOPdr9m5/B0U="; 65 | }; 66 | }; 67 | 68 | dontCargoBuild = true; 69 | cargoBuildFlags = "--lib"; 70 | cargoBuildType = "release"; 71 | 72 | preBuild = '' 73 | preBuild=() 74 | cd rust 75 | cargoBuildHook 76 | mv ./target/*/release/librust_lib_aria.* ./target/release/ 77 | cd .. 78 | ''; 79 | 80 | nativeBuildInputs = [ 81 | cargo 82 | rustPlatform.cargoSetupHook 83 | rustPlatform.cargoBuildHook 84 | rustPlatform.bindgenHook 85 | ]; 86 | 87 | postInstall = '' 88 | rm $out/bin/aria 89 | cat <$out/bin/aria 90 | #!${stdenv.shell} 91 | export LD_LIBRARY_PATH=$out/app/aria/lib 92 | exec $out/app/aria/aria 93 | EOF 94 | 95 | chmod +x $out/bin/aria 96 | ''; 97 | } 98 | -------------------------------------------------------------------------------- /pkgs/aria-misskey/rust_lib_aria.patch: -------------------------------------------------------------------------------- 1 | diff --git a/rust_builder/linux/CMakeLists.txt b/rust_builder/linux/CMakeLists.txt 2 | index 8661930..b8cf0c5 100644 3 | --- a/rust_builder/linux/CMakeLists.txt 4 | +++ b/rust_builder/linux/CMakeLists.txt 5 | @@ -7,13 +7,10 @@ cmake_minimum_required(VERSION 3.10) 6 | set(PROJECT_NAME "rust_lib_aria") 7 | project(${PROJECT_NAME} LANGUAGES CXX) 8 | 9 | -include("../cargokit/cmake/cargokit.cmake") 10 | -apply_cargokit(${PROJECT_NAME} ../../rust rust_lib_aria "") 11 | - 12 | # List of absolute paths to libraries that should be bundled with the plugin. 13 | # This list could contain prebuilt libraries, or libraries created by an 14 | # external build triggered from this build file. 15 | set(rust_lib_aria_bundled_libraries 16 | - "${${PROJECT_NAME}_cargokit_lib}" 17 | + "../rust/target/release/librust_lib_aria.so" 18 | PARENT_SCOPE 19 | ) 20 | -------------------------------------------------------------------------------- /pkgs/audiogridder/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | stdenv, 3 | fetchFromGitHub, 4 | lib, 5 | runCommand, 6 | binutils, 7 | cmake, 8 | findutils, 9 | pkg-config, 10 | python3, 11 | alsa-lib, 12 | atk, 13 | boost178, 14 | cairo, 15 | curlFull, 16 | freetype, 17 | gdk-pixbuf, 18 | glib, 19 | graphviz, 20 | gtk3, 21 | gtkmm3, 22 | harfbuzz, 23 | ladspa-sdk, 24 | libGLU, 25 | libappindicator-gtk3, 26 | libdatrie, 27 | libdbusmenu, 28 | libepoxy, 29 | libjack2, 30 | libjpeg_turbo, 31 | libpng, 32 | libselinux, 33 | libsepol, 34 | libsysprof-capture, 35 | libthai, 36 | libxkbcommon, 37 | pango, 38 | pcre, 39 | pcre2, 40 | sqlite, 41 | util-linux, 42 | webkitgtk, 43 | xorg, 44 | zlib, 45 | vst2-sdk, 46 | }: 47 | let 48 | deps = fetchFromGitHub { 49 | owner = "apohl79"; 50 | repo = "audiogridder-deps"; 51 | rev = "6a7a41c06b9ca9d4a260febe79ee1f6e96618e0a"; 52 | sha256 = "sha256-ESgeLkX/CQPY4/x3yl+H0OdpM9uc2z6dh4vMzcvXTR8="; 53 | }; 54 | 55 | sdks = runCommand "ag-sdks" { } '' 56 | mkdir -p $out/vstsdk2.4 57 | cp -r ${vst2-sdk}/* $out/vstsdk2.4/ 58 | ''; 59 | 60 | boost178Static = boost178.override { 61 | enableShared = false; 62 | enableStatic = true; 63 | }; 64 | in 65 | stdenv.mkDerivation rec { 66 | pname = "audiogridder-modded"; 67 | version = "1.2.0-mod"; 68 | 69 | src = fetchFromGitHub { 70 | owner = "nyarla"; 71 | repo = "audiogridder-modded"; 72 | rev = "dc01e87a00b2de7f30a8d65628ceac7e4292661f"; 73 | hash = "sha256-DdCpULUVTclcRBbTinE6cOx1jDg1Hst21DRkb3CCru8="; 74 | fetchSubmodules = true; 75 | }; 76 | 77 | nativeBuildInputs = [ 78 | cmake 79 | pkg-config 80 | python3 81 | findutils 82 | binutils 83 | ]; 84 | buildInputs = 85 | [ 86 | alsa-lib 87 | atk 88 | boost178Static 89 | cairo 90 | curlFull 91 | curlFull.dev 92 | freetype 93 | gdk-pixbuf 94 | glib 95 | glib.dev 96 | graphviz 97 | gtk3 98 | gtk3.dev 99 | gtkmm3 100 | gtkmm3.dev 101 | harfbuzz 102 | ladspa-sdk 103 | libGLU 104 | libappindicator-gtk3 105 | libappindicator-gtk3.dev 106 | libdatrie.dev 107 | libdatrie.out 108 | libdbusmenu 109 | libepoxy.dev 110 | libepoxy.out 111 | libjack2 112 | libjpeg_turbo 113 | libpng 114 | libselinux.dev 115 | libselinux.out 116 | libsepol.dev 117 | libsepol.out 118 | libsysprof-capture 119 | libthai.dev 120 | libthai.out 121 | libxkbcommon.dev 122 | libxkbcommon.out 123 | pango 124 | pcre.dev 125 | pcre.out 126 | pcre2.dev 127 | pcre2.out 128 | sqlite.dev 129 | sqlite.out 130 | util-linux.dev 131 | util-linux.out 132 | webkitgtk 133 | zlib 134 | ] 135 | ++ (with xorg; [ 136 | libX11 137 | libXcomposite 138 | libXcursor 139 | libXdmcp.dev 140 | libXdmcp.out 141 | libXext 142 | libXinerama 143 | libXrandr 144 | libXrender 145 | libXtst 146 | libxcb 147 | ]); 148 | 149 | libPath = lib.makeLibraryPath ( 150 | buildInputs 151 | ++ [ 152 | stdenv.cc.cc 153 | stdenv.cc.libc 154 | ] 155 | ); 156 | 157 | postPatch = '' 158 | export binutils=${binutils} 159 | 160 | substituteAllInPlace CMakeLists.txt 161 | substituteAllInPlace Plugin/Source/PluginProcessor.cpp 162 | substituteAllInPlace Server/Source/App.cpp 163 | substituteAllInPlace Server/Source/ProcessorClient.cpp 164 | substituteAllInPlace Server/Source/Server.cpp 165 | ''; 166 | 167 | cmakeFlags = [ 168 | "-DAG_DEPS_ROOT=${deps}/linux-x86_64" 169 | "-DAG_SDKS_ROOT=${sdks}" 170 | "-DAG_VST2_PLUGIN_ENABLED=ON" 171 | "-DAG_WITH_PLUGIN=ON" 172 | "-DAG_WITH_SERVER=ON" 173 | "-DCMAKE_AR=${stdenv.cc.cc}/bin/gcc-ar" 174 | "-DCMAKE_BUILD_TYPE=Release" 175 | "-DCMAKE_RANLIB=${stdenv.cc.cc}/bin/gcc-ranlib" 176 | "-DFFMPEG_ROOT=${deps}/linux-x86_64" 177 | "-DWEBP_ROOT=${deps}/linux-x86_64" 178 | ]; 179 | 180 | installPhase = '' 181 | mkdir -p $out/bin 182 | mkdir -p $out/lib/vst 183 | mkdir -p $out/lib/vst3 184 | mkdir -p $out/share/audiogridder/images 185 | 186 | cp -R ../Server/Resources/* $out/share/audiogridder/images 187 | 188 | for fn in Fx Inst Midi ; do 189 | mv Plugin/AudioGridder''${fn}_artefacts/Release/VST3/* $out/lib/vst3/ 190 | mv Plugin/AudioGridder''${fn}_artefacts/Release/VST/* $out/lib/vst/ 191 | done 192 | 193 | cp PluginTray/AudioGridderPluginTray_artefacts/Release/AudioGridderPluginTray $out/bin/ 194 | cp Server/AudioGridderServer_artefacts/Release/AudioGridderServer $out/bin/ 195 | 196 | chmod +x $out/bin/* 197 | ''; 198 | 199 | fixupPhase = '' 200 | for exe in $(ls $out/bin); do 201 | patchelf --set-rpath "${libPath}" $out/bin/$exe 202 | done 203 | 204 | find $out/lib -type f -name '*.so' -exec patchelf --set-rpath "${libPath}" {} \; 205 | ''; 206 | } 207 | -------------------------------------------------------------------------------- /pkgs/carla/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | carla, 3 | glibc, 4 | pkgsCross, 5 | wine, 6 | multiStdenv, 7 | fetchFromGitHub, 8 | }: 9 | let 10 | pkgsMinGW = bit: if bit == 32 then pkgsCross.mingw32 else pkgsCross.mingwW64; 11 | 12 | mingw32 = pkgsMinGW 32; 13 | mingwW64 = pkgsMinGW 64; 14 | 15 | mcfgthreadsw32 = mingw32.windows.mcfgthreads.overrideAttrs (_: { 16 | dontDisableStatic = true; 17 | }); 18 | mcfgthreadsW64 = mingwW64.windows.mcfgthreads.overrideAttrs (_: { 19 | dontDisableStatic = true; 20 | }); 21 | in 22 | (carla.override { stdenv = multiStdenv; }).overrideAttrs (old: rec { 23 | version = "2024-11-24"; # keep same version of ildaeil 24 | src = fetchFromGitHub { 25 | inherit (old.src) owner repo; 26 | rev = "17000e7fe99459b25a50094a8b00bdfa12f2bfbc"; 27 | hash = "sha256-nM4XUnMuWctYyLNYAO/JAn0KhtILXXuQ14n0p5H/UB4="; 28 | fetchSubmodules = true; 29 | }; 30 | 31 | nativeBuildInputs = old.nativeBuildInputs ++ [ 32 | wine 33 | mingw32.buildPackages.gcc 34 | mingwW64.buildPackages.gcc 35 | ]; 36 | 37 | buildInputs = old.buildInputs ++ [ 38 | mcfgthreadsw32.dev 39 | mcfgthreadsW64.dev 40 | ]; 41 | 42 | dontStrip = true; 43 | 44 | patches = [ ./nixos.patch ]; 45 | 46 | postPatch = 47 | old.postPatch 48 | + '' 49 | export carla=$out 50 | export wine=${wine} 51 | 52 | substituteAllInPlace source/jackbridge/Makefile 53 | substituteAllInPlace source/modules/dgl/Makefile 54 | substituteAllInPlace source/backend/CarlaStandalone.cpp 55 | substituteAllInPlace source/backend/engine/CarlaEngineJack.cpp 56 | ''; 57 | 58 | postBuild = '' 59 | make win32 \ 60 | CC=i686-w64-mingw32-gcc \ 61 | CXX=i686-w64-mingw32-g++ \ 62 | CFLAGS="-I${mingw32.windows.mingw_w64_pthreads}/include -I${mcfgthreadsw32.dev}/include" \ 63 | CXXFLAGS="-I${mingw32.windows.mingw_w64_pthreads}/include -I${mcfgthreadsw32.dev}/include" \ 64 | LDFLAGS="-L${mingw32.windows.mingw_w64_pthreads}/lib -L${mcfgthreadsw32}/lib" 65 | 66 | make wine32 \ 67 | CC="winegcc -m32" \ 68 | CXX="winegcc -m32" \ 69 | CFLAGS="-I${glibc.dev}/include" \ 70 | CXXFLAGS="-I${glibc.dev}/include" \ 71 | 72 | make win64 \ 73 | CC=x86_64-w64-mingw32-gcc \ 74 | CXX=x86_64-w64-mingw32-g++ \ 75 | CFLAGS="-I${mingwW64.windows.mingw_w64_pthreads}/include -I${mcfgthreadsW64.dev}/include" \ 76 | CXXFLAGS="-I${mingwW64.windows.mingw_w64_pthreads}/include -I${mcfgthreadsW64.dev}/include" \ 77 | LDFLAGS="-L${mingwW64.windows.mingw_w64_pthreads}/lib -L${mcfgthreadsW64}/lib" 78 | 79 | make wine64 \ 80 | CC="winegcc" \ 81 | CXX="winegcc" \ 82 | CFLAGS="-I${glibc.dev}/include" \ 83 | CXXFLAGS="-I${glibc.dev}/include" 84 | ''; 85 | }) 86 | -------------------------------------------------------------------------------- /pkgs/carla/nixos.patch: -------------------------------------------------------------------------------- 1 | diff --git a/source/backend/CarlaStandalone.cpp b/source/backend/CarlaStandalone.cpp 2 | index 44a8cdc72..bcf10e301 100644 3 | --- a/source/backend/CarlaStandalone.cpp 4 | +++ b/source/backend/CarlaStandalone.cpp 5 | @@ -216,7 +216,7 @@ static void carla_engine_init_common(const CarlaHostStandalone& standalone, Carl 6 | engine->setFileCallback(standalone.fileCallback, standalone.fileCallbackPtr); 7 | 8 | using water::File; 9 | - const File waterBinaryDir(File::getSpecialLocation(File::currentExecutableFile).getParentDirectory()); 10 | + const File waterBinaryDir("@carla@"); 11 | 12 | #ifdef BUILD_BRIDGE 13 | /* 14 | @@ -278,12 +278,12 @@ static void carla_engine_init_common(const CarlaHostStandalone& standalone, Carl 15 | if (const char* const binaryDir = std::getenv("ENGINE_OPTION_PATH_BINARIES")) 16 | engine->setOption(CB::ENGINE_OPTION_PATH_BINARIES, 0, binaryDir); 17 | else 18 | - engine->setOption(CB::ENGINE_OPTION_PATH_BINARIES, 0, waterBinaryDir.getFullPathName().toRawUTF8()); 19 | + engine->setOption(CB::ENGINE_OPTION_PATH_BINARIES, 0, "@carla@/lib/carla"); 20 | 21 | if (const char* const resourceDir = std::getenv("ENGINE_OPTION_PATH_RESOURCES")) 22 | engine->setOption(CB::ENGINE_OPTION_PATH_RESOURCES, 0, resourceDir); 23 | else 24 | - engine->setOption(CB::ENGINE_OPTION_PATH_RESOURCES, 0, waterBinaryDir.getChildFile("resources").getFullPathName().toRawUTF8()); 25 | + engine->setOption(CB::ENGINE_OPTION_PATH_RESOURCES, 0, "@carla@/share/carla/resources"); 26 | 27 | if (const char* const preventBadBehaviour = std::getenv("ENGINE_OPTION_PREVENT_BAD_BEHAVIOUR")) 28 | engine->setOption(CB::ENGINE_OPTION_PREVENT_BAD_BEHAVIOUR, (std::strcmp(preventBadBehaviour, "true") == 0) ? 1 : 0, nullptr); 29 | diff --git a/source/backend/engine/CarlaEngineJack.cpp b/source/backend/engine/CarlaEngineJack.cpp 30 | index df4fffbc1..976e81de4 100644 31 | --- a/source/backend/engine/CarlaEngineJack.cpp 32 | +++ b/source/backend/engine/CarlaEngineJack.cpp 33 | @@ -4557,8 +4557,8 @@ int jack_initialize(jack_client_t* const client, const char* const load_init) 34 | #endif 35 | 36 | // FIXME 37 | - engine->setOption(ENGINE_OPTION_PATH_BINARIES, 0, "/usr/lib/carla"); 38 | - engine->setOption(ENGINE_OPTION_PATH_RESOURCES, 0, "/usr/share/resources"); 39 | + engine->setOption(ENGINE_OPTION_PATH_BINARIES, 0, "@carla@/lib/carla"); 40 | + engine->setOption(ENGINE_OPTION_PATH_RESOURCES, 0, "@carla@/share/resources"); 41 | 42 | if (engine->initInternal(client)) 43 | return 0; 44 | diff --git a/source/jackbridge/Makefile b/source/jackbridge/Makefile 45 | index 69a30ac0e..1499b97b3 100644 46 | --- a/source/jackbridge/Makefile 47 | +++ b/source/jackbridge/Makefile 48 | @@ -36,7 +36,7 @@ WINE_LINK_FLAGS += -lstdc++ 49 | ifneq ($(MACOS),true) 50 | WINE_32BIT_FLAGS += -I/usr/include/wine/wine/windows 51 | WINE_32BIT_FLAGS += -I/usr/include/wine-development/windows 52 | -WINE_32BIT_FLAGS += -I/opt/wine-devel/include/wine/windows 53 | +WINE_32BIT_FLAGS += -I@wine@/include/wine/windows 54 | WINE_32BIT_FLAGS += -L/usr/lib32/wine 55 | WINE_32BIT_FLAGS += -L/usr/lib/wine 56 | WINE_32BIT_FLAGS += -L/usr/lib/i386-linux-gnu/wine 57 | @@ -45,13 +45,13 @@ WINE_32BIT_FLAGS += -L/usr/lib/i386-linux-gnu/wine-development/i386-unix 58 | WINE_32BIT_FLAGS += -L/opt/wine-stable/lib 59 | WINE_32BIT_FLAGS += -L/opt/wine-stable/lib/wine 60 | WINE_32BIT_FLAGS += -L/opt/wine-stable/lib/wine/i386-unix 61 | -WINE_32BIT_FLAGS += -L/opt/wine-staging/lib 62 | -WINE_32BIT_FLAGS += -L/opt/wine-staging/lib/wine 63 | -WINE_32BIT_FLAGS += -L/opt/wine-staging/lib/wine/i386-unix 64 | +WINE_32BIT_FLAGS += -L@wine@/lib 65 | +WINE_32BIT_FLAGS += -L@wine@/lib/wine 66 | +WINE_32BIT_FLAGS += -L@wine@/lib/wine/i386-unix 67 | 68 | WINE_64BIT_FLAGS += -I/usr/include/wine/wine/windows 69 | WINE_64BIT_FLAGS += -I/usr/include/wine-development/windows 70 | -WINE_64BIT_FLAGS += -I/opt/wine-devel/include/wine/windows 71 | +WINE_64BIT_FLAGS += -I@wine@/include/wine/windows 72 | WINE_64BIT_FLAGS += -L/usr/lib64/wine 73 | WINE_64BIT_FLAGS += -L/usr/lib/x86_64-linux-gnu/wine 74 | WINE_64BIT_FLAGS += -L/usr/lib/x86_64-linux-gnu/wine-development 75 | @@ -59,9 +59,9 @@ WINE_64BIT_FLAGS += -L/usr/lib/x86_64-linux-gnu/wine-development/x86_64-unix 76 | WINE_64BIT_FLAGS += -L/opt/wine-stable/lib64 77 | WINE_64BIT_FLAGS += -L/opt/wine-stable/lib64/wine 78 | WINE_64BIT_FLAGS += -L/opt/wine-stable/lib64/wine/x86_64-unix 79 | -WINE_64BIT_FLAGS += -L/opt/wine-staging/lib64 80 | -WINE_64BIT_FLAGS += -L/opt/wine-staging/lib64/wine 81 | -WINE_64BIT_FLAGS += -L/opt/wine-staging/lib64/wine/x86_64-unix 82 | +WINE_64BIT_FLAGS += -L@wine@/lib 83 | +WINE_64BIT_FLAGS += -L@wine@/lib/wine 84 | +WINE_64BIT_FLAGS += -L@wine@/lib/wine/x86_64-unix 85 | 86 | WINE_LINK_FLAGS += -lrt 87 | endif 88 | diff --git a/source/modules/dgl/Makefile b/source/modules/dgl/Makefile 89 | index 50eab4b88..207ac5916 100644 90 | --- a/source/modules/dgl/Makefile 91 | +++ b/source/modules/dgl/Makefile 92 | @@ -16,7 +16,7 @@ BUILD_CXX_FLAGS += -Isrc/pugl-upstream/include 93 | ifneq ($(MACOS),true) 94 | WINE_FLAGS = -I/usr/include/wine/wine/windows 95 | WINE_FLAGS += -I/usr/include/wine-development/windows 96 | -WINE_FLAGS += -I/opt/wine-devel/include/wine/windows 97 | +WINE_FLAGS += -I@wine@/include/wine/windows 98 | endif 99 | 100 | # --------------------------------------------------------------------------------------------------------------------- 101 | -------------------------------------------------------------------------------- /pkgs/cskk/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | fetchFromGitHub, 3 | rustPlatform, 4 | cargo-c, 5 | rust-bindgen, 6 | libxkbcommon, 7 | }: 8 | rustPlatform.buildRustPackage rec { 9 | pname = "cskk"; 10 | version = "v3.1.5"; 11 | src = fetchFromGitHub { 12 | owner = "naokiri"; 13 | repo = "cskk"; 14 | rev = "af413a14bcafc811264bdedbe3bd5f943d2e7f5e"; 15 | hash = "sha256-sYtYwwBPP1nTbIYLQGdMEYO8lybkaTaLjwqHO7b0Puo="; 16 | }; 17 | 18 | useFetchVendor = true; 19 | cargoHash = "sha256-eKH7DJV5a0IhBAsXsmhzc/EF0S2KxyVwzd47HlgGj3s="; 20 | 21 | buildInputs = [ libxkbcommon.dev ]; 22 | nativeBuildInputs = [ 23 | cargo-c 24 | rust-bindgen 25 | ]; 26 | 27 | postInstall = '' 28 | cargo cinstall --prefix=$out 29 | ''; 30 | } 31 | -------------------------------------------------------------------------------- /pkgs/cuda-shell/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | gcc9Stdenv, 3 | lib, 4 | buildFHSEnv, 5 | cudaPackages, 6 | nvidia_x11, 7 | }: 8 | let 9 | libPath = lib.makeLibraryPath ( 10 | [ 11 | nvidia_x11 12 | gcc9Stdenv.cc.cc 13 | gcc9Stdenv.cc.libc 14 | ] 15 | ++ (with cudaPackages; [ 16 | cudatoolkit 17 | cudnn 18 | ]) 19 | ); 20 | in 21 | buildFHSEnv { 22 | name = "cuda-shell"; 23 | targetPkgs = 24 | p: 25 | (with p; [ 26 | autoconf 27 | binutils 28 | curl 29 | freeglut 30 | git 31 | gitRepo 32 | glib 33 | gnumake 34 | gnupg 35 | gperf 36 | gperftools 37 | libGL 38 | libGLU 39 | m4 40 | ncurses5 41 | procps 42 | unzip 43 | util-linux 44 | xorg.libX11 45 | xorg.libXext 46 | xorg.libXi 47 | xorg.libXmu 48 | xorg.libXrandr 49 | xorg.libXv 50 | zlib 51 | ]) 52 | ++ (with cudaPackages; [ 53 | cudatoolkit 54 | cudnn 55 | ]) 56 | ++ [ gcc9Stdenv.cc ]; 57 | 58 | multiPkgs = pkgs: with pkgs; [ zlib ]; 59 | runScript = "bash"; 60 | profile = '' 61 | export CUDA_PATH=${cudaPackages.cudatoolkit} 62 | export CUDA_LD_LIBRARY_PATH=${libPath} 63 | export LDFLAGS="-L${nvidia_x11}/lib -L${cudaPackages.cudatoolkit}/lib -L${cudaPackages.cudnn}/lib" 64 | export CFLAGS="-I${cudaPackages.cudatoolkit}/include -I${cudaPackages.cudnn}/include" 65 | ''; 66 | } 67 | -------------------------------------------------------------------------------- /pkgs/currennt/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | stdenv, 3 | fetchFromGitHub, 4 | cmake, 5 | pkg-config, 6 | boost, 7 | cudatoolkit, 8 | netcdf, 9 | }: 10 | stdenv.mkDerivation rec { 11 | pname = "currennt"; 12 | version = "git"; 13 | src = fetchFromGitHub { 14 | owner = "nii-yamagishilab"; 15 | repo = "project-CURRENNT-public"; 16 | rev = "7ca0103e13d7e868a451690679e16fa6a59d1146"; 17 | sha256 = "0kizzi2qlm8xknayi8kb5sfr9mqqiigqsg5swxcrqlzvs2zxzppx"; 18 | }; 19 | 20 | nativeBuildInputs = [ 21 | cmake 22 | pkg-config 23 | ]; 24 | buildInputs = [ 25 | boost.dev 26 | cudatoolkit 27 | netcdf 28 | ]; 29 | 30 | postUnpack = '' 31 | sourceRoot=source/CURRENNT_codes 32 | ''; 33 | 34 | installPhase = '' 35 | mkdir -p $out/bin 36 | cp currennt $out/bin/ 37 | chmod +x $out/bin/currennt 38 | ''; 39 | } 40 | -------------------------------------------------------------------------------- /pkgs/deadbeef-fb/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | stdenv, 3 | fetchFromGitLab, 4 | pkg-config, 5 | deadbeef, 6 | gtk3, 7 | autoconf, 8 | automake, 9 | libtool, 10 | glib, 11 | }: 12 | stdenv.mkDerivation { 13 | pname = "deadbeef-fb"; 14 | version = "git"; 15 | src = fetchFromGitLab { 16 | owner = "zykure"; 17 | repo = "deadbeef-fb"; 18 | rev = "17accd5345adeb3b81315d284dd81ac881517cc6"; 19 | hash = "sha256-xmC0m47OnEQS4nXRG+bq5vMiAui0+ehhCrcWF8n1t/s="; 20 | }; 21 | nativeBuildInputs = [ 22 | autoconf 23 | automake 24 | libtool 25 | pkg-config 26 | ]; 27 | buildInputs = [ 28 | deadbeef 29 | glib 30 | gtk3 31 | ]; 32 | 33 | preConfigure = '' 34 | ./autogen.sh 35 | ''; 36 | 37 | configureFlags = [ 38 | "--prefix=$(out)" 39 | "--disable-gtk2" 40 | ]; 41 | } 42 | -------------------------------------------------------------------------------- /pkgs/default.nix: -------------------------------------------------------------------------------- 1 | { nixpkgs, ... }: 2 | final: prev: 3 | let 4 | require = path: prev.callPackage (import path); 5 | in 6 | { 7 | # custom packages 8 | aria-misskey = require ./aria-misskey { }; 9 | audiogridder = require ./audiogridder { }; 10 | cskk = require ./cskk { }; 11 | deadbeef-fb = require ./deadbeef-fb { }; 12 | fluent-kde = require ./fluent-kde { }; 13 | galendae = require ./galendae { }; 14 | glibc-locales-eaw = require ./glibc-locales-eaw { }; 15 | gyazo-diy = require ./gyazo-diy { }; 16 | igsc = require ./igsc { }; 17 | kaunas = require ./kaunas { }; 18 | noise-suppression-for-voice = require ./noise-suppression-for-voice { }; 19 | noto-fonts-jp = require ./noto-fonts-jp { }; 20 | nvim-run = require ./nvim-run { }; 21 | openjtalk = require ./openjtalk { }; 22 | perl-shell = require ./perl-shell { }; 23 | restic-run = require ./restic-run { }; 24 | shoreman = require ./shoreman { }; 25 | skk-dicts-xl = require ./skk-dicts-xl { }; 26 | sononym-bin = require ./sononym-bin { }; 27 | stability-matrix = require ./stability-matrix { }; 28 | wcwidth-cjk = require ./wcwidh-cjk { }; 29 | xembed-sni-proxy = require ./xembed-sni-proxy { }; 30 | 31 | # fcitx5 packages 32 | fcitx5-fbterm = require ./fcitx5-fbterm { }; 33 | fcitx5-cskk = prev.libsForQt5.callPackage (import ./fcitx5-cskk) { }; 34 | fcitx5-cskk-qt5 = prev.libsForQt5.callPackage (import ./fcitx5-cskk) { enableQt = true; }; 35 | fcitx5-cskk-qt6 = prev.qt6Packages.callPackage (import ./fcitx5-cskk) { 36 | enableQt = true; 37 | useQt6 = true; 38 | }; 39 | 40 | # cuda-related packages 41 | cuda-shell = require ./cuda-shell { 42 | inherit (prev) cudaPackages; 43 | nvidia_x11 = null; 44 | }; 45 | currennt = require ./currennt { inherit (prev.cudaPackages) cudatoolkit; }; 46 | 47 | # customized packages 48 | bitwig-studio3 = prev.bitwig-studio3.override { 49 | libjack2 = prev.pipewire.jack; 50 | }; 51 | 52 | calibre = prev.calibre.overrideAttrs (old: { 53 | buildInputs = old.buildInputs ++ [ prev.python3Packages.pycrypto ]; 54 | doInstallCheck = false; 55 | }); 56 | 57 | firefox-bin-unwrapped = prev.firefox-bin-unwrapped.override { systemLocale = "ja_JP"; }; 58 | 59 | labwc = prev.labwc.overrideAttrs (_: { 60 | patches = [ 61 | (prev.fetchpatch { 62 | name = "text-input-v1.patch"; 63 | url = "https://aur.archlinux.org/cgit/aur.git/plain/0001-IME-support-text-input-v1.patch?h=labwc-im&id=62363809aff2bfdf032942bb0f0e6ca926cda5f6"; 64 | sha256 = "1r5rpxzgzynjbpfws6ji2s2sdg68riyq205n216hzkcqazgmddzg"; 65 | }) 66 | ]; 67 | }); 68 | 69 | pixelorama = prev.pixelorama.overrideAttrs (old: { 70 | runtimeDependencies = old.runtimeDependencies ++ prev.godot_4.runtimeDependencies; 71 | }); 72 | 73 | speechd-with-openjtalk = prev.speechd.overrideAttrs (old: { 74 | src = prev.fetchurl { 75 | url = "https://github.com/brailcom/speechd/releases/download/0.12.0-rc3/speech-dispatcher-0.12.0-rc3.tar.gz"; 76 | hash = "sha256-vStiv9z3RVKs2F6dpOQv0f8SuOoYYQpqG9aDXfdntmM="; 77 | }; 78 | buildInputs = old.buildInputs ++ [ final.openjtalk ]; 79 | configureFlags = old.configureFlags ++ [ "--with-openjtalk" ]; 80 | }); 81 | 82 | thunderbird-bin-unwrapped = prev.thunderbird-bin-unwrapped.override { systemLocale = "ja_JP"; }; 83 | 84 | tmux = prev.tmux.overrideAttrs (_: { 85 | preConfigure = '' 86 | cp ${../patches/utf8_force_wide.h} utf8_force_wide.h 87 | ''; 88 | patches = [ ../patches/tmux3.5a-utf8.patch ]; 89 | }); 90 | 91 | tunefish = prev.tunefish.overrideAttrs (_: { 92 | src = prev.fetchFromGitHub { 93 | owner = "paynebc"; 94 | repo = "tunefish"; 95 | rev = "7e48ce8683155d5c37eb317b7ed509481c76a352"; 96 | hash = "sha256-oY8+hgn5eJuEgTAlGsAnGiGsD+PE5l5hbMFpsWBhlY0="; 97 | }; 98 | 99 | CFLAGS = "-I${prev.vst2-sdk}"; 100 | 101 | installPhase = '' 102 | mkdir -p $out/lib/vst 103 | mkdir -p $out/lib/vst3 104 | 105 | cp src/tunefish4/Builds/LinuxMakefile/build/Tunefish4.so \ 106 | $out/lib/vst/ 107 | 108 | cp -r src/tunefish4/Builds/LinuxMakefile/build/Tunefish4.vst3 \ 109 | $out/lib/vst3/Tunefish4.vst3 110 | ''; 111 | }); 112 | 113 | weylus = prev.rustPlatform.buildRustPackage rec { 114 | pname = "weylus"; 115 | version = "2025-02-24"; 116 | src = prev.fetchFromGitHub { 117 | owner = "H-M-H"; 118 | repo = "Weylus"; 119 | rev = "5202806798ccca67c24da52ba51ee50b973b7089"; 120 | hash = "sha256-lx1ZVp5DkQiL9/vw6PAZ34Lge+K8dfEVh6vLnCUNf7M="; 121 | }; 122 | 123 | patches = [ 124 | ../patches/weylus.patch 125 | ]; 126 | 127 | inherit (prev.weylus) 128 | nativeBuildInputs 129 | cargoBuildFlags 130 | cargoTestFlags 131 | postInstall 132 | postFixup 133 | meta 134 | ; 135 | 136 | buildInputs = 137 | prev.weylus.buildInputs 138 | ++ (with prev; [ 139 | wayland.dev 140 | libxkbcommon.dev 141 | ]); 142 | 143 | cargoLock = { 144 | lockFile = "${src}/Cargo.lock"; 145 | outputHashes = { 146 | "autopilot-0.4.0" = "sha256-1DRuhAAXaIADUmXlDVr8UNbI/Ab2PYdrx9Qh0j9rTX8="; 147 | }; 148 | }; 149 | }; 150 | 151 | # custom wine-related packages 152 | wine-staging-run = require ./wine-run { 153 | pname = "wine-staging"; 154 | paths = prev.lib.makeBinPath [ prev.wineWowPackages.stagingFull ]; 155 | }; 156 | 157 | wine-vst-run = require ./wine-run { 158 | pname = "wine-vst"; 159 | paths = prev.lib.makeBinPath [ 160 | prev.wineWowPackages.yabridge 161 | (final.wineasio.override { wine = prev.wineWowPackages.yabridge; }) 162 | ]; 163 | }; 164 | 165 | wineasio = require ./wineasio { }; 166 | 167 | carla-with-wine = require ./carla { 168 | inherit (prev) carla; 169 | wine = prev.wineWowPackages.yabridge; 170 | }; 171 | 172 | ildaeil = require ./ildaeil { 173 | carla = final.carla-with-wine; 174 | wine = prev.wineWowPackages.yabridge; 175 | }; 176 | 177 | wine-vst-wrapper = require ./wine-vst-wrapper { 178 | wine = prev.wineWowPackages.yabridge; 179 | }; 180 | 181 | yabridge = prev.yabridge.override { wine = prev.wineWowPackages.yabridge; }; 182 | yabridgectl = prev.yabridgectl.override { 183 | inherit (final) yabridge; 184 | wine = prev.wineWowPackages.yabridge; 185 | }; 186 | } 187 | -------------------------------------------------------------------------------- /pkgs/dexed/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | stdenv, 3 | fetchFromGitHub, 4 | pkg-config, 5 | cmake, 6 | alsa-lib, 7 | curlFull, 8 | doxygen, 9 | freetype, 10 | glib, 11 | graphviz, 12 | gtk3, 13 | ladspa-sdk, 14 | libjack2, 15 | libjpeg_turbo, 16 | libpng, 17 | pcre, 18 | python3, 19 | webkitgtk, 20 | zlib, 21 | xorg, 22 | libGLU, 23 | lib, 24 | }: 25 | stdenv.mkDerivation rec { 26 | pname = "dexed"; 27 | version = "git"; 28 | 29 | src = fetchFromGitHub { 30 | owner = "asb2m10"; 31 | repo = "dexed"; 32 | rev = "e4b536dc1194a008a0dfb4087242b6f8641946c8"; 33 | hash = "sha256-1tWdCVtp3uMkbVa1aoEx63MbVuaIL4svBN0G4ELUJLo="; 34 | fetchSubmodules = true; 35 | }; 36 | 37 | dontFixup = true; 38 | 39 | cmakeFlags = [ 40 | "-DCMAKE_AR=${stdenv.cc.cc}/bin/gcc-ar" 41 | "-DCMAKE_RANLIB=${stdenv.cc.cc}/bin/gcc-ranlib" 42 | ]; 43 | 44 | nativeBuildInputs = [ 45 | cmake 46 | pkg-config 47 | doxygen 48 | python3 49 | ]; 50 | buildInputs = 51 | [ 52 | alsa-lib 53 | curlFull.dev 54 | freetype 55 | glib.dev 56 | graphviz 57 | gtk3 58 | ladspa-sdk 59 | libGLU 60 | libjack2 61 | libjpeg_turbo 62 | libpng 63 | pcre 64 | webkitgtk 65 | zlib 66 | ] 67 | ++ (with xorg; [ 68 | libX11 69 | libXcomposite 70 | libXcursor 71 | libXext 72 | libXinerama 73 | libXrandr 74 | libXrender 75 | ]); 76 | 77 | libPath = lib.makeLibraryPath ( 78 | buildInputs 79 | ++ [ 80 | curlFull.out 81 | stdenv.cc.cc 82 | stdenv.cc.libc 83 | ] 84 | ); 85 | 86 | installPhase = '' 87 | mkdir -p $out/bin 88 | mkdir -p $out/lib/vst3 89 | 90 | cp Source/Dexed_artefacts/Release/Standalone/Dexed \ 91 | $out/bin 92 | 93 | chmod +x $out/bin/Dexed 94 | 95 | cp -R Source/Dexed_artefacts/Release/VST3/Dexed.vst3 \ 96 | $out/lib/vst3/Dexed.vst3 97 | 98 | patchelf --set-rpath "${libPath}" $out/bin/Dexed 99 | patchelf --set-rpath "${libPath}" $out/lib/vst3/Dexed.vst3/Contents/x86_64-linux/Dexed.so 100 | ''; 101 | } 102 | -------------------------------------------------------------------------------- /pkgs/fcitx5-cskk/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | stdenv, 3 | lib, 4 | fetchFromGitHub, 5 | cmake, 6 | extra-cmake-modules, 7 | pkg-config, 8 | gettext, 9 | fcitx5, 10 | fcitx5-qt, 11 | qtbase, 12 | wrapQtAppsHook, 13 | cskk, 14 | skkDictionaries, 15 | enableQt ? false, 16 | useQt6 ? false, 17 | }: 18 | stdenv.mkDerivation rec { 19 | pname = "fcitx5-cskk"; 20 | version = "v1.2.0"; 21 | src = fetchFromGitHub { 22 | owner = "fcitx"; 23 | repo = "fcitx5-cskk"; 24 | rev = "223c99a5dde7362f51059a15849edceb4a030d0a"; 25 | hash = "sha256-NSYtVX7XE9WkI8g1s+pC4/7QHEbQ3GO87ZZA9oMo090="; 26 | }; 27 | 28 | nativeBuildInputs = [ 29 | cmake 30 | extra-cmake-modules 31 | pkg-config 32 | gettext 33 | ] ++ lib.optional enableQt wrapQtAppsHook; 34 | 35 | buildInputs = 36 | [ 37 | fcitx5 38 | cskk 39 | ] 40 | ++ lib.optionals enableQt [ 41 | fcitx5-qt 42 | qtbase 43 | ]; 44 | 45 | cmakeFlags = [ 46 | "-DENABLE_QT=${toString enableQt}" 47 | "-DUSE_QT6=${toString useQt6}" 48 | "-DSKK_DICT_DEFAULT_PATH=${skkDictionaries.l}/share/SKK-JISYO.L" 49 | ]; 50 | } 51 | -------------------------------------------------------------------------------- /pkgs/fcitx5-fbterm/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | stdenv, 3 | glib, 4 | fcitx5, 5 | fcitx5-gtk, 6 | cmake, 7 | gnumake, 8 | pkg-config, 9 | fetchFromGitHub, 10 | }: 11 | stdenv.mkDerivation rec { 12 | pname = "fcitx5-fbterm"; 13 | version = "git"; 14 | src = fetchFromGitHub { 15 | owner = "fcitx"; 16 | repo = "fcitx5-fbterm"; 17 | rev = "620980bc6dc491448fe22e853b3e1b188996bba1"; 18 | sha256 = "08h538xzfgw05az63px5m41qy9vsbiy3wndpifc12basnr13fwkj"; 19 | }; 20 | 21 | nativeBuildInputs = [ 22 | cmake 23 | gnumake 24 | pkg-config 25 | ]; 26 | buildInputs = [ 27 | fcitx5 28 | fcitx5-gtk 29 | glib.dev 30 | ]; 31 | 32 | installPhase = '' 33 | mkdir -p $out/bin 34 | cp src/fcitx5-fbterm $out/bin/ 35 | chmod +x $out/bin/* 36 | ''; 37 | } 38 | -------------------------------------------------------------------------------- /pkgs/fluent-kde/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | fetchFromGitHub, 3 | stdenvNoCC, 4 | }: 5 | stdenvNoCC.mkDerivation rec { 6 | pname = "Fluent-kde"; 7 | version = "git"; 8 | src = fetchFromGitHub { 9 | owner = "vinceliuice"; 10 | repo = "Fluent-kde"; 11 | rev = "9d6b7d4733707c38f72e8a614528f1df591419f3"; 12 | hash = "sha256-eRAM4f2scGLSDNljI3qjyn5XF7zjrsp8ArIGswNyimY="; 13 | }; 14 | 15 | installPhase = '' 16 | mkdir -p $out/share/Kvantum 17 | mkdir -p $out/share/aurorae/themes 18 | mkdir -p $out/share/color-schemes 19 | mkdir -p $out/share/plasma 20 | 21 | cp -r Kvantum/Fluent* $out/share/Kvantum/ 22 | cp -r aurorae/Fluent* $out/share/aurorae/themes/ 23 | cp -r color-schemes/* $out/share/color-schemes/ 24 | cp -r plasma/* $out/share/plasma/ 25 | ''; 26 | } 27 | -------------------------------------------------------------------------------- /pkgs/galendae/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | stdenv, 3 | fetchFromGitHub, 4 | gtk3, 5 | pkg-config, 6 | wrapGAppsHook, 7 | }: 8 | stdenv.mkDerivation rec { 9 | pname = "galendae"; 10 | version = "git"; 11 | src = fetchFromGitHub { 12 | owner = "chris-marsh"; 13 | repo = "galendae"; 14 | rev = "7cf032bba678c0782412d3407fabdc750f966f3f"; 15 | sha256 = "07mnmj1fh1s763vs97hpmzsiyx52fss52m8d6jf8frgxasap6sb1"; 16 | }; 17 | 18 | buildInputs = [ 19 | gtk3.dev 20 | pkg-config 21 | ]; 22 | nativeBuildInupts = [ wrapGAppsHook ]; 23 | 24 | patchPhase = '' 25 | sed 's|CFLAGS += -DVERSION|#CFLAGS += -DVERSION|' makefile 26 | ''; 27 | 28 | buildPhase = '' 29 | make -f makefile release 30 | ''; 31 | 32 | installPhase = '' 33 | mkdir -p $out/bin 34 | cp galendae $out/bin/ 35 | chmod +x $out/bin/* 36 | ''; 37 | } 38 | -------------------------------------------------------------------------------- /pkgs/glibc-locales-eaw/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | glibcLocales, 3 | fetchurl, 4 | allLocales ? true, 5 | locales ? [ "en_US.UTF-8/UTF-8" ], 6 | }: 7 | 8 | let 9 | UTF-8-EAW-CONSOLE = fetchurl { 10 | url = "https://github.com/hamano/locale-eaw/raw/7623d45f9b87d9b44dca6ef8c46fc97b22690f50/dist/UTF-8-EAW-CONSOLE"; 11 | sha256 = "1jm54m7abyc0fvvavr2qilrbiilcp8fz5k9d4fp6pdqpq87k9irv"; 12 | }; 13 | in 14 | 15 | (glibcLocales.override { 16 | inherit allLocales; 17 | inherit locales; 18 | }).overrideAttrs 19 | (old: { 20 | preBuild = 21 | '' 22 | cp ${UTF-8-EAW-CONSOLE} $(find .. -type d -name 'glibc-2*' | head -n1)/localedata/charmaps/UTF-8-EAW-CONSOLE 23 | echo 'ja_JP.UTF-8/UTF-8-EAW-CONSOLE \' >> ../glibc-2*/localedata/SUPPORTED 24 | echo 'en_US.UTF-8/UTF-8-EAW-CONSOLE \' >> ../glibc-2*/localedata/SUPPORTED 25 | '' 26 | + old.preBuild; 27 | }) 28 | -------------------------------------------------------------------------------- /pkgs/gyazo-diy/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | runCommand, 3 | lib, 4 | writeShellScript, 5 | coreutils, 6 | curl, 7 | grim, 8 | jq, 9 | slurp, 10 | xdg-utils, 11 | }: 12 | let 13 | gyazoScript = writeShellScript "gyazo.sh" '' 14 | set -euo pipefail 15 | 16 | export PATH=${ 17 | lib.makeBinPath [ 18 | coreutils 19 | curl 20 | grim 21 | slurp 22 | jq 23 | xdg-utils 24 | ] 25 | }:$PATH 26 | 27 | source ~/.config/gyazo/env 28 | 29 | fn() { 30 | echo ~/Pictures/Screenshots/$(date +%Y-%m-%dT%H-%M-%S).png 31 | } 32 | 33 | upload() { 34 | local file=$1 35 | xdg-open $(curl -s \ 36 | -F access_token=''${ACCESS_TOKEN} \ 37 | -F imagedata=@$file \ 38 | -F created_at=$(date +%s) \ 39 | -F collection_id=''${COLLECTION_ID} \ 40 | https://upload.gyazo.com/api/upload \ 41 | | jq -r .permalink_url) 42 | } 43 | 44 | capture() { 45 | local filename=$(fn) 46 | slurp | grim -g - -t png $filename 47 | upload $filename 48 | } 49 | 50 | screenshot() { 51 | local filename=$(fn) 52 | grim -t png $filename 53 | upload $filename 54 | } 55 | 56 | main() { 57 | case "''${1:-}" in 58 | capture) 59 | capture 60 | ;; 61 | screenshot) 62 | screenshot 63 | ;; 64 | esac 65 | } 66 | 67 | main $@ 68 | ''; 69 | in 70 | runCommand "gyazo.sh" { } '' 71 | mkdir -p $out/bin/ 72 | cp ${gyazoScript} $out/bin/gyazo 73 | chmod +x $out/bin/gyazo 74 | '' 75 | -------------------------------------------------------------------------------- /pkgs/igsc/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | stdenv, 3 | fetchFromGitHub, 4 | cmake, 5 | pkg-config, 6 | systemd, 7 | }: 8 | let 9 | metee = stdenv.mkDerivation { 10 | pname = "metee"; 11 | version = "4.2.1"; 12 | src = fetchFromGitHub { 13 | owner = "intel"; 14 | repo = "metee"; 15 | rev = "bc8ffd2236b644ee1d62ae6afc6a6026ba784a90"; 16 | hash = "sha256-MYGHoRiNUcuCviu2mpFkErfYxm2JLB1qov6NPNtnRZs="; 17 | }; 18 | 19 | nativeBuildInputs = [ 20 | cmake 21 | pkg-config 22 | ]; 23 | }; 24 | in 25 | stdenv.mkDerivation { 26 | pname = "igsc"; 27 | version = "0.9.5"; 28 | src = fetchFromGitHub { 29 | owner = "intel"; 30 | repo = "igsc"; 31 | rev = "fcfa86452b50f62e30393ba5e554d413c7b6dca9"; 32 | hash = "sha256-r6lJi21xiMnQDufrO+LHADhSaJXnD/rvc6+xWVjW2GE="; 33 | }; 34 | 35 | buildInputs = [ 36 | metee 37 | systemd.dev 38 | ]; 39 | 40 | nativeBuildInputs = [ 41 | cmake 42 | pkg-config 43 | ]; 44 | } 45 | -------------------------------------------------------------------------------- /pkgs/ildaeil/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | stdenv, 3 | fetchFromGitHub, 4 | autoPatchelfHook, 5 | pkg-config, 6 | patchelf, 7 | qt5, 8 | findutils, 9 | bzip2, 10 | carla, 11 | dbus, 12 | file, 13 | flac, 14 | libGL, 15 | libcap, 16 | libglvnd, 17 | libjack2, 18 | libogg, 19 | libopus, 20 | libsndfile, 21 | libvorbis, 22 | wine, 23 | xorg, 24 | zstd, 25 | }: 26 | stdenv.mkDerivation rec { 27 | pname = "ildaeil"; 28 | version = "2024-09-25"; 29 | src = fetchFromGitHub { 30 | owner = "DISTRHO"; 31 | repo = "Ildaeil"; 32 | rev = "c66bcccb678ce5eec7447674f3e69d9e777af5f8"; 33 | hash = "sha256-1HnFiQx6jzdVGmSXP6v1Gus6plPps8ZvYHFshOubVwQ="; 34 | fetchSubmodules = true; 35 | }; 36 | 37 | nativeBuildInputs = [ 38 | findutils 39 | pkg-config 40 | patchelf 41 | autoPatchelfHook 42 | qt5.wrapQtAppsHook 43 | ]; 44 | 45 | buildInputs = [ 46 | bzip2.dev 47 | carla 48 | dbus.dev 49 | file.dev 50 | flac.dev 51 | libGL.dev 52 | libcap.dev 53 | libglvnd.dev 54 | libjack2 55 | libogg.dev 56 | libopus.dev 57 | libsndfile.dev 58 | libvorbis.dev 59 | xorg.libX11.dev 60 | xorg.libXcursor.dev 61 | xorg.libXext.dev 62 | xorg.libXrandr.dev 63 | zstd.dev 64 | ]; 65 | 66 | postUnpack = '' 67 | rm carla -rf 68 | cp -R ${carla.src} carla 69 | chmod -R +w carla 70 | ''; 71 | 72 | patches = [ ./nixos.patch ]; 73 | 74 | postPatch = '' 75 | cd carla 76 | export carla=${carla} 77 | export wine=${wine} 78 | 79 | substituteAllInPlace source/jackbridge/Makefile 80 | substituteAllInPlace source/modules/dgl/Makefile 81 | substituteAllInPlace source/backend/CarlaStandalone.cpp 82 | substituteAllInPlace source/backend/engine/CarlaEngineJack.cpp 83 | cd .. 84 | 85 | substituteAllInPlace plugins/Common/IldaeilPlugin.cpp 86 | patchShebangs --build dpf/utils 87 | ''; 88 | 89 | installFlags = [ "PREFIX=$(out)" ]; 90 | makeFlags = [ "USE_SYSTEM_CARLA_BINS=true" ]; 91 | 92 | preFixup = '' 93 | patchelf --add-needed libjack.so.0 $out/bin/Ildaeil 94 | find $out/lib -type f -name '*.so' -exec patchelf --add-needed libjack.so.0 {} \; 95 | find $out/lib -type f -name '*.clap' -exec patchelf --add-needed libjack.so.0 {} \; 96 | ''; 97 | } 98 | -------------------------------------------------------------------------------- /pkgs/ildaeil/nixos.patch: -------------------------------------------------------------------------------- 1 | diff --git a/plugins/Common/IldaeilPlugin.cpp b/plugins/Common/IldaeilPlugin.cpp 2 | index e10861c..3aa6a13 100644 3 | --- a/plugins/Common/IldaeilPlugin.cpp 4 | +++ b/plugins/Common/IldaeilPlugin.cpp 5 | @@ -424,9 +424,9 @@ public: 6 | carla_set_engine_option(fCarlaHostHandle, ENGINE_OPTION_PATH_BINARIES, 0, "/Applications/Carla.app/Contents/MacOS"); 7 | carla_set_engine_option(fCarlaHostHandle, ENGINE_OPTION_PATH_RESOURCES, 0, "/Applications/Carla.app/Contents/MacOS/resources"); 8 | #else 9 | - fBinaryPath = "/usr/lib/carla"; 10 | - carla_set_engine_option(fCarlaHostHandle, ENGINE_OPTION_PATH_BINARIES, 0, "/usr/lib/carla"); 11 | - carla_set_engine_option(fCarlaHostHandle, ENGINE_OPTION_PATH_RESOURCES, 0, "/usr/share/carla/resources"); 12 | + fBinaryPath = "@carla@/lib/carla"; 13 | + carla_set_engine_option(fCarlaHostHandle, ENGINE_OPTION_PATH_BINARIES, 0, "@carla@/lib/carla"); 14 | + carla_set_engine_option(fCarlaHostHandle, ENGINE_OPTION_PATH_RESOURCES, 0, "@carla@/share/carla/resources"); 15 | #endif 16 | } 17 | 18 | diff --git a/carla/source/backend/CarlaStandalone.cpp b/carla/source/backend/CarlaStandalone.cpp 19 | index 44a8cdc72..bcf10e301 100644 20 | --- a/carla/source/backend/CarlaStandalone.cpp 21 | +++ b/carla/source/backend/CarlaStandalone.cpp 22 | @@ -216,7 +216,7 @@ static void carla_engine_init_common(const CarlaHostStandalone& standalone, Carl 23 | engine->setFileCallback(standalone.fileCallback, standalone.fileCallbackPtr); 24 | 25 | using water::File; 26 | - const File waterBinaryDir(File::getSpecialLocation(File::currentExecutableFile).getParentDirectory()); 27 | + const File waterBinaryDir("@carla@"); 28 | 29 | #ifdef BUILD_BRIDGE 30 | /* 31 | @@ -278,12 +278,12 @@ static void carla_engine_init_common(const CarlaHostStandalone& standalone, Carl 32 | if (const char* const binaryDir = std::getenv("ENGINE_OPTION_PATH_BINARIES")) 33 | engine->setOption(CB::ENGINE_OPTION_PATH_BINARIES, 0, binaryDir); 34 | else 35 | - engine->setOption(CB::ENGINE_OPTION_PATH_BINARIES, 0, waterBinaryDir.getFullPathName().toRawUTF8()); 36 | + engine->setOption(CB::ENGINE_OPTION_PATH_BINARIES, 0, "@carla@/lib/carla"); 37 | 38 | if (const char* const resourceDir = std::getenv("ENGINE_OPTION_PATH_RESOURCES")) 39 | engine->setOption(CB::ENGINE_OPTION_PATH_RESOURCES, 0, resourceDir); 40 | else 41 | - engine->setOption(CB::ENGINE_OPTION_PATH_RESOURCES, 0, waterBinaryDir.getChildFile("resources").getFullPathName().toRawUTF8()); 42 | + engine->setOption(CB::ENGINE_OPTION_PATH_RESOURCES, 0, "@carla@/share/carla/resources"); 43 | 44 | if (const char* const preventBadBehaviour = std::getenv("ENGINE_OPTION_PREVENT_BAD_BEHAVIOUR")) 45 | engine->setOption(CB::ENGINE_OPTION_PREVENT_BAD_BEHAVIOUR, (std::strcmp(preventBadBehaviour, "true") == 0) ? 1 : 0, nullptr); 46 | diff --git a/carla/source/backend/engine/CarlaEngineJack.cpp b/carla/source/backend/engine/CarlaEngineJack.cpp 47 | index df4fffbc1..976e81de4 100644 48 | --- a/carla/source/backend/engine/CarlaEngineJack.cpp 49 | +++ b/carla/source/backend/engine/CarlaEngineJack.cpp 50 | @@ -4557,8 +4557,8 @@ int jack_initialize(jack_client_t* const client, const char* const load_init) 51 | #endif 52 | 53 | // FIXME 54 | - engine->setOption(ENGINE_OPTION_PATH_BINARIES, 0, "/usr/lib/carla"); 55 | - engine->setOption(ENGINE_OPTION_PATH_RESOURCES, 0, "/usr/share/resources"); 56 | + engine->setOption(ENGINE_OPTION_PATH_BINARIES, 0, "@carla@/lib/carla"); 57 | + engine->setOption(ENGINE_OPTION_PATH_RESOURCES, 0, "@carla@/share/resources"); 58 | 59 | if (engine->initInternal(client)) 60 | return 0; 61 | diff --git a/carla/source/jackbridge/Makefile b/carla/source/jackbridge/Makefile 62 | index 69a30ac0e..1499b97b3 100644 63 | --- a/carla/source/jackbridge/Makefile 64 | +++ b/carla/source/jackbridge/Makefile 65 | @@ -36,7 +36,7 @@ WINE_LINK_FLAGS += -lstdc++ 66 | ifneq ($(MACOS),true) 67 | WINE_32BIT_FLAGS += -I/usr/include/wine/wine/windows 68 | WINE_32BIT_FLAGS += -I/usr/include/wine-development/windows 69 | -WINE_32BIT_FLAGS += -I/opt/wine-devel/include/wine/windows 70 | +WINE_32BIT_FLAGS += -I@wine@/include/wine/windows 71 | WINE_32BIT_FLAGS += -L/usr/lib32/wine 72 | WINE_32BIT_FLAGS += -L/usr/lib/wine 73 | WINE_32BIT_FLAGS += -L/usr/lib/i386-linux-gnu/wine 74 | @@ -45,13 +45,13 @@ WINE_32BIT_FLAGS += -L/usr/lib/i386-linux-gnu/wine-development/i386-unix 75 | WINE_32BIT_FLAGS += -L/opt/wine-stable/lib 76 | WINE_32BIT_FLAGS += -L/opt/wine-stable/lib/wine 77 | WINE_32BIT_FLAGS += -L/opt/wine-stable/lib/wine/i386-unix 78 | -WINE_32BIT_FLAGS += -L/opt/wine-staging/lib 79 | -WINE_32BIT_FLAGS += -L/opt/wine-staging/lib/wine 80 | -WINE_32BIT_FLAGS += -L/opt/wine-staging/lib/wine/i386-unix 81 | +WINE_32BIT_FLAGS += -L@wine@/lib 82 | +WINE_32BIT_FLAGS += -L@wine@/lib/wine 83 | +WINE_32BIT_FLAGS += -L@wine@/lib/wine/i386-unix 84 | 85 | WINE_64BIT_FLAGS += -I/usr/include/wine/wine/windows 86 | WINE_64BIT_FLAGS += -I/usr/include/wine-development/windows 87 | -WINE_64BIT_FLAGS += -I/opt/wine-devel/include/wine/windows 88 | +WINE_64BIT_FLAGS += -I@wine@/include/wine/windows 89 | WINE_64BIT_FLAGS += -L/usr/lib64/wine 90 | WINE_64BIT_FLAGS += -L/usr/lib/x86_64-linux-gnu/wine 91 | WINE_64BIT_FLAGS += -L/usr/lib/x86_64-linux-gnu/wine-development 92 | @@ -59,9 +59,9 @@ WINE_64BIT_FLAGS += -L/usr/lib/x86_64-linux-gnu/wine-development/x86_64-unix 93 | WINE_64BIT_FLAGS += -L/opt/wine-stable/lib64 94 | WINE_64BIT_FLAGS += -L/opt/wine-stable/lib64/wine 95 | WINE_64BIT_FLAGS += -L/opt/wine-stable/lib64/wine/x86_64-unix 96 | -WINE_64BIT_FLAGS += -L/opt/wine-staging/lib64 97 | -WINE_64BIT_FLAGS += -L/opt/wine-staging/lib64/wine 98 | -WINE_64BIT_FLAGS += -L/opt/wine-staging/lib64/wine/x86_64-unix 99 | +WINE_64BIT_FLAGS += -L@wine@/lib 100 | +WINE_64BIT_FLAGS += -L@wine@/lib/wine 101 | +WINE_64BIT_FLAGS += -L@wine@/lib/wine/x86_64-unix 102 | 103 | WINE_LINK_FLAGS += -lrt 104 | endif 105 | diff --git a/carla/source/modules/dgl/Makefile b/carla/source/modules/dgl/Makefile 106 | index 50eab4b88..207ac5916 100644 107 | --- a/carla/source/modules/dgl/Makefile 108 | +++ b/carla/source/modules/dgl/Makefile 109 | @@ -16,7 +16,7 @@ BUILD_CXX_FLAGS += -Isrc/pugl-upstream/include 110 | ifneq ($(MACOS),true) 111 | WINE_FLAGS = -I/usr/include/wine/wine/windows 112 | WINE_FLAGS += -I/usr/include/wine-development/windows 113 | -WINE_FLAGS += -I/opt/wine-devel/include/wine/windows 114 | +WINE_FLAGS += -I@wine@/include/wine/windows 115 | endif 116 | 117 | # --------------------------------------------------------------------------------------------------------------------- 118 | 119 | -------------------------------------------------------------------------------- /pkgs/kaunas/default.nix: -------------------------------------------------------------------------------- 1 | { stdenvNoCC, fetchFromGitHub }: 2 | stdenvNoCC.mkDerivation rec { 3 | pname = "Kaunas"; 4 | version = "git"; 5 | src = fetchFromGitHub { 6 | owner = "Dovias"; 7 | repo = pname; 8 | rev = "98a7b76c2c42c94a83db0d0c1205bf6f7a171084"; 9 | hash = "sha256-+fonEBF+LKrLdySQeM6cjrj5UgjXLLCwWosoGOxXPBU="; 10 | }; 11 | 12 | installPhase = '' 13 | runHook preInstall 14 | 15 | mkdir -p $out/share/themes/${pname} 16 | cp -R ${src}/openbox-3 $out/share/themes/${pname}/openbox-3 17 | 18 | runHook postInstall 19 | ''; 20 | } 21 | -------------------------------------------------------------------------------- /pkgs/noise-suppression-for-voice/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | stdenv, 3 | fetchFromGitHub, 4 | cmake, 5 | pkg-config, 6 | juce, 7 | }: 8 | stdenv.mkDerivation rec { 9 | pname = "noise-suppression-for-voice"; 10 | version = "2024-05-18"; 11 | src = fetchFromGitHub { 12 | owner = "werman"; 13 | repo = "noise-suppression-for-voice"; 14 | rev = "9c4e5c28d8950e2cef837d8a0abd36c2fd9b5c2d"; 15 | hash = "sha256-HtWDwKZ4UFLE7k93ONcubrMmvFYvDKgZwFSkqgXiCXY="; 16 | fetchSubmodules = true; 17 | }; 18 | 19 | inherit (juce) buildInputs; 20 | 21 | nativeBuildInputs = [ 22 | cmake 23 | pkg-config 24 | ]; 25 | } 26 | -------------------------------------------------------------------------------- /pkgs/noto-fonts-jp/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | stdenvNoCC, 3 | lib, 4 | fetchurl, 5 | }: 6 | let 7 | fonts = import ./fonts.nix; 8 | in 9 | stdenvNoCC.mkDerivation rec { 10 | version = "V2.0003"; 11 | name = "noto-fonts-jp-${version}"; 12 | 13 | files = map ( 14 | { 15 | name, 16 | url, 17 | sha256, 18 | }: 19 | fetchurl { inherit name url sha256; } 20 | ) fonts; 21 | 22 | unpackPhase = '' 23 | mkdir -p noto 24 | 25 | ${lib.strings.concatMapStrings (font: '' 26 | cp ${font} noto/${font.name} 27 | '') files} 28 | ''; 29 | 30 | installPhase = '' 31 | mkdir -p $out/share/fonts/ 32 | mv noto $out/share/fonts/ 33 | ''; 34 | } 35 | -------------------------------------------------------------------------------- /pkgs/noto-fonts-jp/fonts.nix: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | name = "NotoSansCJKjp-Black.otf"; 4 | url = "https://github.com/googlefonts/noto-cjk/raw/main/Sans/OTF/Japanese/NotoSansCJKjp-Black.otf"; 5 | sha256 = "0k8bl7vli28gycwnc7d9nd8zpnnfdx00m6ajwwps8qd8jijnhrnd"; 6 | } 7 | { 8 | name = "NotoSansCJKjp-Bold.otf"; 9 | url = "https://github.com/googlefonts/noto-cjk/raw/main/Sans/OTF/Japanese/NotoSansCJKjp-Bold.otf"; 10 | sha256 = "0xhzmxw0c5xxhfwbc64v4ba83fw2yg9fpqda05fy88i9rc6wngg5"; 11 | } 12 | { 13 | name = "NotoSansCJKjp-DemiLight.otf"; 14 | url = "https://github.com/googlefonts/noto-cjk/raw/main/Sans/OTF/Japanese/NotoSansCJKjp-DemiLight.otf"; 15 | sha256 = "0rq2r9mwbdsh8z02qxvs0dqx68fkqssc5skzmzpi9r250hlsdy2k"; 16 | } 17 | { 18 | name = "NotoSansCJKjp-Medium.otf"; 19 | url = "https://github.com/googlefonts/noto-cjk/raw/main/Sans/OTF/Japanese/NotoSansCJKjp-Medium.otf"; 20 | sha256 = "0ln0lv9dip1b9jjbdkz33620zhilwmjby0fpna0c84rl1rc3wlnx"; 21 | } 22 | { 23 | name = "NotoSansCJKjp-Regular.otf"; 24 | url = "https://github.com/googlefonts/noto-cjk/raw/main/Sans/OTF/Japanese/NotoSansCJKjp-Regular.otf"; 25 | sha256 = "1dbmyf3xavwllvx4z79hi6yk6dmg3ncpkyzjf6rjfahbh2cgr8v8"; 26 | } 27 | { 28 | name = "NotoSansCJKjp-Thin.otf"; 29 | url = "https://github.com/googlefonts/noto-cjk/raw/main/Sans/OTF/Japanese/NotoSansCJKjp-Thin.otf"; 30 | sha256 = "0b3pk30yp41jxwwqd37ljzal15xhissx0apmzs8rpsfdv297afr9"; 31 | } 32 | { 33 | name = "NotoSerifCJKjp-Black.otf"; 34 | url = "https://github.com/googlefonts/noto-cjk/raw/main/Serif/OTF/Japanese/NotoSerifCJKjp-Black.otf"; 35 | sha256 = "0xlfbrwr359znas5x730hi69gaddnhg4sa11n1ixrv99sxnqp33s"; 36 | } 37 | { 38 | name = "NotoSerifCJKjp-Bold.otf"; 39 | url = "https://github.com/googlefonts/noto-cjk/raw/main/Serif/OTF/Japanese/NotoSerifCJKjp-Bold.otf"; 40 | sha256 = "1y1sa1faa6p51q9gp4h4ixi14gznvqzqrgk2q92kgci41qn2n6l6"; 41 | } 42 | { 43 | name = "NotoSerifCJKjp-ExtraLight.otf"; 44 | url = "https://github.com/googlefonts/noto-cjk/raw/main/Serif/OTF/Japanese/NotoSerifCJKjp-ExtraLight.otf"; 45 | sha256 = "0iklfn8735sz6wwb5lzbx3ylpcydsr7b6zznj6n0v0rzj2sch10d"; 46 | } 47 | { 48 | name = "NotoSerifCJKjp-Light.otf"; 49 | url = "https://github.com/googlefonts/noto-cjk/raw/main/Serif/OTF/Japanese/NotoSerifCJKjp-Light.otf"; 50 | sha256 = "0q42rk9g29yd1ln991c3ayhw7532jhn8vj5jyyk7pwwhz96p50m2"; 51 | } 52 | { 53 | name = "NotoSerifCJKjp-Medium.otf"; 54 | url = "https://github.com/googlefonts/noto-cjk/raw/main/Serif/OTF/Japanese/NotoSerifCJKjp-Medium.otf"; 55 | sha256 = "0y4lfynvq0vmffcmhn3r4y79j0cg1gi9ijjbicl0f1hc44q6lb1n"; 56 | } 57 | { 58 | name = "NotoSerifCJKjp-Regular.otf"; 59 | url = "https://github.com/googlefonts/noto-cjk/raw/main/Serif/OTF/Japanese/NotoSerifCJKjp-Regular.otf"; 60 | sha256 = "1lq352ni9xgrsvz27n3w005xxf2fsrpqan15jfkvaw7iirx4r1fr"; 61 | } 62 | { 63 | name = "NotoSerifCJKjp-SemiBold.otf"; 64 | url = "https://github.com/googlefonts/noto-cjk/raw/main/Serif/OTF/Japanese/NotoSerifCJKjp-SemiBold.otf"; 65 | sha256 = "0302is6nr3may2qd1fh0psyra88h6mvvp9y1h9mnkhdly988aq8l"; 66 | } 67 | ] 68 | -------------------------------------------------------------------------------- /pkgs/noto-fonts-jp/update.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -euo pipefail 4 | 5 | out() { 6 | echo "${1}" >>fonts.nix 7 | } 8 | 9 | fetch() { 10 | local name=$1 url=$2 11 | out "{ name = \"${1}\"; url = \"${url}\"; sha256 = \"$(nix-prefetch-url "${url}")\"; }" 12 | } 13 | 14 | test ! -e fonts.nix || rm fonts.nix 15 | out '[' 16 | 17 | for weight in Black Bold DemiLight Medium Regular Thin; do 18 | name="NotoSansCJKjp-${weight}.otf" 19 | url="https://github.com/googlefonts/noto-cjk/raw/main/Sans/OTF/Japanese/${name}" 20 | 21 | fetch $name $url 22 | done 23 | 24 | for weight in Black Bold ExtraLight Light Medium Regular SemiBold; do 25 | name="NotoSerifCJKjp-${weight}.otf" 26 | url="https://github.com/googlefonts/noto-cjk/raw/main/Serif/OTF/Japanese/${name}" 27 | 28 | fetch $name $url 29 | done 30 | 31 | out ']' 32 | 33 | nixfmt fonts.nix 34 | -------------------------------------------------------------------------------- /pkgs/nvim-run/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | lib, 3 | pkgs, 4 | writeShellScriptBin, 5 | neovim, 6 | }: 7 | let 8 | PATH = lib.makeBinPath ( 9 | with pkgs; 10 | [ 11 | # linter 12 | deadnix 13 | hadolint 14 | shellcheck 15 | statix 16 | 17 | # formatter 18 | go 19 | gotools 20 | nixfmt-rfc-style 21 | nodePackages.prettier 22 | perlPackages.PerlTidy 23 | stylua 24 | 25 | # language server 26 | gopls 27 | lua-language-server 28 | nixd 29 | nodePackages.bash-language-server 30 | nodePackages.typescript-language-server 31 | nodePackages.vscode-langservers-extracted 32 | perlnavigator 33 | sqls 34 | tailwindcss-language-server 35 | taplo 36 | 37 | # all-in-one toolchains 38 | biome 39 | deno 40 | sqlfluff 41 | 42 | # for test 43 | hello 44 | ] 45 | ); 46 | in 47 | writeShellScriptBin "nvim" '' 48 | export PATH=$PATH:${PATH} 49 | 50 | if [[ -e $HOME/.config/llm/env ]]; then 51 | eval "$(cat $HOME/.config/llm/env)" 52 | fi 53 | 54 | exec -a nvim ${neovim}/bin/nvim "''${@}" 55 | '' 56 | -------------------------------------------------------------------------------- /pkgs/openjtalk/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | stdenv, 3 | stdenvNoCC, 4 | fetchurl, 5 | }: 6 | let 7 | htsengine = stdenv.mkDerivation rec { 8 | pname = "hts_engine"; 9 | version = "1.10"; 10 | src = fetchurl { 11 | url = "mirror://sourceforge/hts-engine/hts_engine_API-${version}.tar.gz"; 12 | hash = "sha256-4hMr5YYNj7SkYL52ZFTP18PiHPZ7UJxI4YBP6rFJaPc="; 13 | }; 14 | }; 15 | 16 | open-jtalk-mecab-naist-jdic-utf8 = stdenvNoCC.mkDerivation rec { 17 | pname = "open-jtalk-mecab-naist-jdic-utf-8"; 18 | version = "1.11"; 19 | src = fetchurl { 20 | url = "mirror://sourceforge/open-jtalk/open_jtalk_dic_utf_8-${version}.tar.gz"; 21 | hash = "sha256-M+nNJRvEGqK9fKNvV6u/YerjVDyiXKiSrjReOUyxBUk="; 22 | }; 23 | 24 | installPhase = '' 25 | mkdir -p $out/share/openjtalk/dict 26 | cp -r . $out/share/openjtalk/dict 27 | ''; 28 | }; 29 | 30 | hts-voice-nitech-jp-atr503-m001 = stdenvNoCC.mkDerivation rec { 31 | pname = "hts_voice_nitech_jp_atr503_m001"; 32 | version = "1.05"; 33 | src = fetchurl { 34 | url = "mirror://sourceforge/open-jtalk/hts_voice_nitech_jp_atr503_m001-${version}.tar.gz"; 35 | hash = "sha256-LlVciEgiZ7KTHH28fswOPfFA1vaPyROqSCLzNsngrfw="; 36 | }; 37 | 38 | installPhase = '' 39 | mkdir -p $out/share/openjtalk/voice 40 | cp -r . $out/share/openjtalk/voice 41 | ''; 42 | }; 43 | 44 | openjtalk = stdenv.mkDerivation rec { 45 | pname = "openjtalk"; 46 | version = "1.11"; 47 | src = fetchurl { 48 | url = "mirror://sourceforge/open-jtalk/open_jtalk-${version}.tar.gz"; 49 | hash = "sha256-IP3GrrbHV4ZgNKvBdYIFc9tD5ChHB8hm/NAsjsGN5x8="; 50 | }; 51 | 52 | buildInputs = [ htsengine ]; 53 | configureFlags = [ 54 | "--with-hts-engine-header-path=${htsengine}/include" 55 | "--with-hts-engine-library-path=${htsengine}/lib" 56 | ]; 57 | 58 | passthru = { 59 | inherit htsengine open-jtalk-mecab-naist-jdic-utf8 hts-voice-nitech-jp-atr503-m001; 60 | }; 61 | }; 62 | in 63 | openjtalk 64 | -------------------------------------------------------------------------------- /pkgs/perl-shell/default.nix: -------------------------------------------------------------------------------- 1 | { buildFHSEnv, writeShellScript }: 2 | buildFHSEnv rec { 3 | name = "perl-shell"; 4 | targetPkgs = 5 | pkgs: with pkgs; [ 6 | gnumake 7 | libxcrypt 8 | openssl.dev 9 | perl 10 | perlPackages.Carton 11 | perlPackages.Appcpanminus 12 | perlPackages.Appcpm 13 | perlPackages.PerlTidy 14 | perlPackages.locallib 15 | pkg-config 16 | stdenv.cc.cc 17 | stdenv.cc.libc 18 | ]; 19 | runScript = writeShellScript "perl-env.sh" '' 20 | exec env IN_PERL_SHELL=1 zsh "''${@}" 21 | ''; 22 | } 23 | -------------------------------------------------------------------------------- /pkgs/restic-run/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | runCommand, 3 | writeShellScriptBin, 4 | restic, 5 | rclone, 6 | lib, 7 | }: 8 | let 9 | restic-run = writeShellScriptBin "restic-run" '' 10 | set -euo pipefail 11 | 12 | export PATH=${ 13 | lib.makeBinPath [ 14 | restic 15 | rclone 16 | ] 17 | }:$PATH 18 | 19 | export HOME=/home/nyarla 20 | 21 | export RESTIC_PASSWORD_FILE=$HOME/.config/rclone/restic 22 | export RESTIC_REPOSITORY=rclone:Teracloud:Backup/NixOS 23 | 24 | exec "''${@}" 25 | ''; 26 | 27 | restic-backup = writeShellScriptBin "restic-backup" '' 28 | set -euo pipefail 29 | 30 | export RESTIC_FORGET_ARGS="--prune --keep-daily 7 --keep-weekly 3 --keep-monthly 3" 31 | export RESTIC_BACKUP_ARGS="--exclude-file $HOME/.config/rclone/ignore" 32 | 33 | DIR="$1" 34 | 35 | if test "z$DIR" = "z"; then 36 | echo "Usage: restic-backup [DIR]" >&2 37 | exit 1 38 | fi 39 | 40 | shift 1 41 | 42 | ${restic-run}/bin/restic-run ${restic}/bin/restic cache --cleanup 43 | ${restic-run}/bin/restic-run ${restic}/bin/restic unlock --remove-all 44 | ${restic-run}/bin/restic-run ${restic}/bin/restic repair index 45 | ${restic-run}/bin/restic-run ${restic}/bin/restic prune 46 | ${restic-run}/bin/restic-run ${restic}/bin/restic backup $RESTIC_BACKUP_ARGS "$DIR" 47 | ${restic-run}/bin/restic-run ${restic}/bin/restic forget $RESTIC_FORGET_ARGS 48 | ''; 49 | in 50 | runCommand "restic-run" { } '' 51 | mkdir -p $out/bin 52 | cp -r ${restic-run}/bin/* $out/bin/ 53 | cp -r ${restic-backup}/bin/* $out/bin/ 54 | chmod +x $out/bin/* 55 | '' 56 | -------------------------------------------------------------------------------- /pkgs/shoreman/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | fetchurl, 3 | bash, 4 | runCommand, 5 | }: 6 | let 7 | shoreman = fetchurl { 8 | url = "https://raw.githubusercontent.com/chrismytton/shoreman/master/shoreman.sh"; 9 | sha256 = "05xqmmwx97y1fh67xgaal1zrsfzxpadllkh9cm2mkf1b0ziwq6m2"; 10 | }; 11 | in 12 | runCommand "shoreman" { } '' 13 | mkdir -p $out/bin 14 | echo '#!${bash}/bin/bash' >>$out/bin/shoreman 15 | echo 'export PATH=${bash}/bin:$PATH' >>$out/bin/shoreman 16 | cat ${shoreman} >>$out/bin/shoreman 17 | 18 | chmod +x $out/bin/shoreman 19 | '' 20 | -------------------------------------------------------------------------------- /pkgs/skk-dicts-xl/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | stdenv, 3 | lib, 4 | fetchurl, 5 | skktools, 6 | libiconv, 7 | }: 8 | let 9 | dicts = lib.strings.concatStringsSep " + " ( 10 | lib.lists.forEach (import ./skk.nix) (x: fetchurl { inherit (x) name url sha256; }) 11 | ); 12 | in 13 | stdenv.mkDerivation rec { 14 | pname = "skk-dicts-xl"; 15 | version = "2022-07-07"; 16 | dontUnpack = true; 17 | 18 | nativeBuildInputs = [ skktools ]; 19 | 20 | installPhase = '' 21 | mkdir -p $out/share/skk/ 22 | 23 | echo ';; -*- mode: fundamental; coding: euc-jp -*-' >$out/share/skk/SkK-JISYO.XL 24 | skkdic-expr2 ${dicts} >>$out/share/skk/SkK-JISYO.XL 25 | 26 | iconv -c -f EUC-JISX0213 -t utf8 < $out/share/skk/SkK-JISYO.XL >$out/share/skk/SKK-JISYO.XL.utf8 27 | sed -i 's|coding: euc-jp|coding: utf8|' $out/share/skk/SKK-JISYO.XL.utf8 28 | ''; 29 | } 30 | -------------------------------------------------------------------------------- /pkgs/skk-dicts-xl/skk.nix: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | name = "SKK-JISYO.S"; 4 | url = "https://raw.githubusercontent.com/skk-dev/dict/master/SKK-JISYO.S"; 5 | sha256 = "11cjrc8m99hj4xpl2nvzxanlswpapi92vmgk9d6yimdz0jidb6cq"; 6 | } 7 | { 8 | name = "SKK-JISYO.M"; 9 | url = "https://raw.githubusercontent.com/skk-dev/dict/master/SKK-JISYO.M"; 10 | sha256 = "0pwjp9qjmn9sq6zc0k6632l7dc2dbjn45585ibckvvl9iwfqqxdp"; 11 | } 12 | { 13 | name = "SKK-JISYO.ML"; 14 | url = "https://raw.githubusercontent.com/skk-dev/dict/master/SKK-JISYO.ML"; 15 | sha256 = "165dxadrwhl34ijs61l4dp0q0r8wgdv5s92fpsilh74wsjfj4wf1"; 16 | } 17 | { 18 | name = "SKK-JISYO.L"; 19 | url = "https://raw.githubusercontent.com/skk-dev/dict/master/SKK-JISYO.L"; 20 | sha256 = "090gl7vmhvvcr4mw8ghx2wl03g2w86zf9x3c4730nnhqwi2zr5p8"; 21 | } 22 | { 23 | name = "SKK-JISYO.fullname"; 24 | url = "https://raw.githubusercontent.com/skk-dev/dict/master/SKK-JISYO.fullname"; 25 | sha256 = "1cx8cd1ji9jks692x3sddbn5cs0kb0jxi4wdwvlax4cvwqpm0d5h"; 26 | } 27 | { 28 | name = "SKK-JISYO.geo"; 29 | url = "https://raw.githubusercontent.com/skk-dev/dict/master/SKK-JISYO.geo"; 30 | sha256 = "0y6h4yri5dbs5yc1zp29254gig5nh0wq01xxw1w3cw11la894j82"; 31 | } 32 | { 33 | name = "SKK-JISYO.law"; 34 | url = "https://raw.githubusercontent.com/skk-dev/dict/master/SKK-JISYO.law"; 35 | sha256 = "1gh3myk892g4r2faf7x82pgqjz9ffsw7zq0nl8mx21mir3gp9ihi"; 36 | } 37 | { 38 | name = "SKK-JISYO.okinawa"; 39 | url = "https://raw.githubusercontent.com/skk-dev/dict/master/SKK-JISYO.okinawa"; 40 | sha256 = "1zcx4gyabb1k1fwim1gqg2pjfgvqgy1bas3azxmdaamvc0xs5yl8"; 41 | } 42 | { 43 | name = "SKK-JISYO.propernoun"; 44 | url = "https://raw.githubusercontent.com/skk-dev/dict/master/SKK-JISYO.propernoun"; 45 | sha256 = "0a5lkp69cpjhgya3m983d5hwf1zdsp8w81pdk8arw03s5hy6j8hm"; 46 | } 47 | { 48 | name = "SKK-JISYO.station"; 49 | url = "https://raw.githubusercontent.com/skk-dev/dict/master/SKK-JISYO.station"; 50 | sha256 = "1gil9kz0f8hdi04akk6dsz02jbg7pwah9ypbcm9lp3373fzhh1q0"; 51 | } 52 | { 53 | name = "SKK-JISYO.neologd"; 54 | url = "https://raw.githubusercontent.com/tokuhirom/skk-jisyo-neologd/master/SKK-JISYO.neologd"; 55 | sha256 = "08pdzbzrzcfw2f62fnw1njrnpqkgn04kbhx0wkrrm5cg8b948n6k"; 56 | } 57 | ] 58 | -------------------------------------------------------------------------------- /pkgs/skk-dicts-xl/update.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | out() { 4 | echo "${1}" >>skk.nix 5 | } 6 | 7 | fetch() { 8 | local name=$1 url=$2 9 | out "{ name = \"${1}\"; url = \"${url}\"; sha256 = \"$(nix-prefetch-url "${url}")\"; }" 10 | } 11 | 12 | main() { 13 | test ! -e skk.nix || rm skk.nix 14 | 15 | out '[' 16 | for dict in S M ML L fullname geo law okinawa propernoun station; do 17 | name="SKK-JISYO.${dict}" 18 | fetch $name "https://raw.githubusercontent.com/skk-dev/dict/master/${name}" 19 | done 20 | 21 | fetch "SKK-JISYO.neologd" "https://raw.githubusercontent.com/tokuhirom/skk-jisyo-neologd/master/SKK-JISYO.neologd" 22 | 23 | out ']' 24 | 25 | nixfmt skk.nix 26 | } 27 | 28 | main; 29 | -------------------------------------------------------------------------------- /pkgs/sononym-bin/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | stdenv, 3 | lib, 4 | fetchurl, 5 | autoPatchelfHook, 6 | makeWrapper, 7 | alsa-lib, 8 | at-spi2-atk, 9 | at-spi2-core, 10 | atk, 11 | cairo, 12 | cups, 13 | dbus, 14 | expat, 15 | fontconfig, 16 | freetype, 17 | gdk-pixbuf, 18 | glib, 19 | gtk3, 20 | libappindicator-gtk3, 21 | libcap, 22 | libdbusmenu, 23 | libdrm, 24 | libglvnd, 25 | libgpg-error, 26 | libjack2, 27 | libnotify, 28 | libsecret, 29 | libuuid, 30 | libxkbcommon, 31 | mesa, 32 | nspr, 33 | nss, 34 | pango, 35 | systemd, 36 | unzip, 37 | xorg, 38 | zlib, 39 | }: 40 | stdenv.mkDerivation rec { 41 | pname = "sononym"; 42 | version = "1.5.6"; 43 | 44 | src = fetchurl { 45 | url = "https://www.sononym.net/download/sononym-${version}.tar.bz2"; 46 | hash = "sha256-b4g7FY6JyQBco3bf1xe+Rga0oBUO9sgW/Dy02jKY7kw="; 47 | }; 48 | 49 | nativeBuildInputs = [ 50 | autoPatchelfHook 51 | makeWrapper 52 | ]; 53 | 54 | buildInputs = 55 | [ 56 | alsa-lib 57 | at-spi2-atk 58 | at-spi2-core 59 | atk 60 | cairo 61 | cups 62 | dbus 63 | expat 64 | fontconfig.out 65 | freetype 66 | gdk-pixbuf 67 | glib.out 68 | gtk3 69 | libappindicator-gtk3 70 | libcap 71 | libdbusmenu 72 | libdrm 73 | libglvnd 74 | libgpg-error 75 | libjack2 76 | libnotify 77 | libsecret 78 | libuuid.out 79 | libxkbcommon 80 | mesa 81 | nspr 82 | nss 83 | pango.out 84 | stdenv.cc.cc 85 | stdenv.cc.libc 86 | stdenv.cc.cc.lib 87 | systemd 88 | unzip 89 | zlib 90 | ] 91 | ++ (with xorg; [ 92 | libX11 93 | libXScrnSaver 94 | libXcomposite 95 | libXcursor 96 | libXdamage 97 | libXext 98 | libXfixes 99 | libXi 100 | libXrandr 101 | libXrender 102 | libXtst 103 | libxcb 104 | libxkbfile 105 | libxshmfence 106 | ]); 107 | 108 | libPath = 109 | lib.makeLibraryPath buildInputs + (":" + lib.makeSearchPathOutput "lib" "lib64" buildInputs); 110 | 111 | buildPhase = '' 112 | runHook preBuild 113 | 114 | mkdir -p $out/opt/sononym 115 | cp -r . $out/opt/sononym 116 | 117 | runHook postBuild 118 | ''; 119 | 120 | dontStirp = true; 121 | 122 | installPhase = '' 123 | runHook preInstall 124 | 125 | mkdir -p $out/bin 126 | ln -sf $out/opt/sononym/sononym $out/bin/sononym 127 | 128 | runHook postInstall 129 | ''; 130 | 131 | postInstall = '' 132 | wrapProgram $out/bin/sononym \ 133 | --prefix LD_LIBRARY_PATH : "${libPath}:$out/opt/sononym" 134 | ''; 135 | } 136 | -------------------------------------------------------------------------------- /pkgs/stability-matrix/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | buildDotnetModule, 3 | dotnetCorePackages, 4 | fetchFromGitHub, 5 | buildFHSEnv, 6 | writeShellScript, 7 | }: 8 | 9 | let 10 | app = buildDotnetModule rec { 11 | pname = "StabilityMatrix"; 12 | version = "2.13.4"; 13 | 14 | src = fetchFromGitHub { 15 | owner = "LykosAI"; 16 | repo = pname; 17 | rev = "v${version}"; 18 | hash = "sha256-D6IdNFpKqPb4xcfMCYL0YGmc+eSve6dwWYSh5MNrHAI="; 19 | }; 20 | 21 | patches = [ 22 | ./nixos.patch 23 | ]; 24 | 25 | postPatch = '' 26 | # workaround for my environment 27 | sed -i 's!RegisterUriSchemeLinux();!/* RegisterUriSchemeLinux(); */!' \ 28 | StabilityMatrix.Avalonia/Helpers/UriHandler.cs 29 | ''; 30 | 31 | projectFile = "StabilityMatrix.Avalonia/StabilityMatrix.Avalonia.csproj"; 32 | nugetDeps = ./deps.nix; 33 | 34 | dotnet-runtime = dotnetCorePackages.runtime_9_0; 35 | dotnet-sdk = dotnetCorePackages.sdk_9_0; 36 | 37 | preConfigure = '' 38 | dotnet tool uninstall husky 39 | dotnet tool uninstall xamlstyler.console 40 | dotnet tool uninstall csharpier 41 | dotnet tool uninstall dotnet-script 42 | dotnet tool uninstall refitter 43 | 44 | export HUSKY=0 45 | ''; 46 | 47 | executables = [ "StabilityMatrix.Avalonia" ]; 48 | }; 49 | in 50 | buildFHSEnv { 51 | name = "StabilityMatrix"; 52 | targetPkgs = 53 | p: 54 | ( 55 | with p; 56 | [ 57 | python310Full 58 | 59 | # dependences for pytyon 3.10.x runtime 60 | expat 61 | glib 62 | libGL 63 | libxcrypt-legacy 64 | tcl 65 | tclx 66 | tix 67 | tk 68 | xorg.libX11 69 | xorg.xorgproto 70 | zlib 71 | ] 72 | ++ python310Full.buildInputs 73 | ) 74 | ++ [ app ]; 75 | 76 | # # workaround for my environment 77 | runScript = toString ( 78 | writeShellScript "StabilityMatrix" '' 79 | export HOME=/persist/home/nyarla 80 | export XDG_CONFIG_HOME=$HOME/.config 81 | export XDG_DATA_HOME=$HOME/.local/share 82 | export XDG_STATE_HOME=$HOME/.local/state 83 | 84 | exec -a StabilityMatrix.Avalonia ${app}/bin/StabilityMatrix.Avalonia ''${@:-}; 85 | '' 86 | ); 87 | } 88 | -------------------------------------------------------------------------------- /pkgs/stability-matrix/nixos.patch: -------------------------------------------------------------------------------- 1 | diff --git a/StabilityMatrix.Core/Helper/Compat.cs b/StabilityMatrix.Core/Helper/Compat.cs 2 | index 1a619bab..fb3da197 100644 3 | --- a/StabilityMatrix.Core/Helper/Compat.cs 4 | +++ b/StabilityMatrix.Core/Helper/Compat.cs 5 | @@ -130,10 +130,7 @@ public static class Compat 6 | { 7 | Platform = PlatformKind.Linux | PlatformKind.Unix; 8 | 9 | - // For AppImage builds, the path is in `$APPIMAGE` 10 | - var appPath = Environment.GetEnvironmentVariable("APPIMAGE") ?? AppContext.BaseDirectory; 11 | - AppCurrentDir = 12 | - Path.GetDirectoryName(appPath) ?? throw new Exception("Could not find application directory"); 13 | + AppCurrentDir = new DirectoryPath(AppContext.BaseDirectory); 14 | ExeExtension = ""; 15 | DllExtension = ".so"; 16 | } 17 | @@ -185,17 +182,7 @@ public static class Compat 18 | { 19 | if (IsLinux) 20 | { 21 | - // Use name component of APPIMAGE 22 | - var appImage = Environment.GetEnvironmentVariable("APPIMAGE"); 23 | - if (string.IsNullOrEmpty(appImage)) 24 | - { 25 | -#if DEBUG 26 | - return "DEBUG_NOT_RUNNING_IN_APPIMAGE"; 27 | -#else 28 | - throw new Exception("Could not find APPIMAGE environment variable"); 29 | -#endif 30 | - } 31 | - return Path.GetFileName(appImage); 32 | + return AppName + ".Avalonia"; 33 | } 34 | using var process = Process.GetCurrentProcess(); 35 | var fullPath = process.MainModule?.ModuleName; 36 | -------------------------------------------------------------------------------- /pkgs/temporary.nix: -------------------------------------------------------------------------------- 1 | _: _: prev: { 2 | bristol = prev.bristol.overrideAttrs (_: { 3 | CFLAGS = "-Wno-implicit-int -Wno-implicit-int8 -Wno-implicit-function-declaration"; 4 | }); 5 | 6 | fluent-icon-theme = prev.fluent-icon-theme.overrideAttrs (_: { 7 | version = "2025-03-27"; # last confirm date 8 | src = prev.fetchFromGitHub { 9 | owner = "vinceliuice"; 10 | repo = "Fluent-icon-theme"; 11 | rev = "0ca5770bcf1e15019bccb877194f005bda53c6f9"; 12 | hash = "sha256-6m/PYE35GxKMHjaXvdhO49BHj+ipOBg0/QbUKxFAMgA="; 13 | }; 14 | 15 | }); 16 | 17 | whipper = 18 | let 19 | python3 = 20 | let 21 | packageOverrides = _: before: { 22 | pycdio = before.pycdio.overridePythonAttrs (_: { 23 | nativeBuildInputs = with prev; [ 24 | pkg-config 25 | swig 26 | ]; 27 | 28 | checkPhase = "true"; 29 | }); 30 | }; 31 | in 32 | prev.python3.override { inherit packageOverrides; }; 33 | in 34 | (prev.whipper.override { inherit python3; }).overrideAttrs (_: { 35 | postPatch = '' 36 | sed -i 's|cd-paranoia|${prev.cdparanoia}/bin/cdparanoia|g' whipper/program/cdparanoia.py 37 | ''; 38 | }); 39 | } 40 | -------------------------------------------------------------------------------- /pkgs/wcwidh-cjk/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | stdenv, 3 | fetchFromGitHub, 4 | autoreconfHook, 5 | }: 6 | stdenv.mkDerivation { 7 | pname = "wcwidth-cjk"; 8 | version = "a1b1e2c+locale-eaw-console"; 9 | src = fetchFromGitHub { 10 | owner = "fumiyas"; 11 | repo = "wcwidth-cjk"; 12 | rev = "a1b1e2c346a563f6538e46e1d29c265bdd5b1c9a"; 13 | hash = "sha256-EppA8b1WzQK4TW/65+50WGrnKyrShCRcPyKLKeAZX6A="; 14 | }; 15 | 16 | patches = [ 17 | ./locale-eaw-console.patch 18 | ]; 19 | 20 | nativeBuildInputs = [ autoreconfHook ]; 21 | } 22 | -------------------------------------------------------------------------------- /pkgs/wcwidh-cjk/locale-eaw-console.patch: -------------------------------------------------------------------------------- 1 | diff --git a/wcwidth.c b/wcwidth.c 2 | index 279b793..ea28d67 100644 3 | --- a/wcwidth.c 4 | +++ b/wcwidth.c 5 | @@ -24,6 +24,7 @@ 6 | #include "config.h" 7 | #endif 8 | 9 | +#include 10 | #include 11 | 12 | struct interval { 13 | @@ -51,161 +52,6 @@ static int bisearch(wchar_t ucs, const struct interval *table, int max) { 14 | return 0; 15 | } 16 | 17 | - 18 | -/* The following two functions define the column width of an ISO 10646 19 | - * character as follows: 20 | - * 21 | - * - The null character (U+0000) has a column width of 0. 22 | - * 23 | - * - Other C0/C1 control characters and DEL will lead to a return 24 | - * value of -1. 25 | - * 26 | - * - Non-spacing and enclosing combining characters (general 27 | - * category code Mn or Me in the Unicode database) have a 28 | - * column width of 0. 29 | - * 30 | - * - SOFT HYPHEN (U+00AD) has a column width of 1. 31 | - * 32 | - * - Other format characters (general category code Cf in the Unicode 33 | - * database) and ZERO WIDTH SPACE (U+200B) have a column width of 0. 34 | - * 35 | - * - Hangul Jamo medial vowels and final consonants (U+1160-U+11FF) 36 | - * have a column width of 0. 37 | - * 38 | - * - Spacing characters in the East Asian Wide (W) or East Asian 39 | - * Full-width (F) category as defined in Unicode Technical 40 | - * Report #11 have a column width of 2. 41 | - * 42 | - * - All remaining characters (including all printable 43 | - * ISO 8859-1 and WGL4 characters, Unicode control characters, 44 | - * etc.) have a column width of 1. 45 | - * 46 | - * This implementation assumes that wchar_t characters are encoded 47 | - * in ISO 10646. 48 | - */ 49 | - 50 | -int wcwidth_ucs(wchar_t ucs) 51 | -{ 52 | - /* sorted list of non-overlapping intervals of non-spacing characters */ 53 | - /* generated by "uniset +cat=Me +cat=Mn +cat=Cf -00AD +1160-11FF +200B c" */ 54 | - static const struct interval combining[] = { 55 | - { 0x0300, 0x036f }, { 0x0483, 0x0486 }, { 0x0488, 0x0489 }, 56 | - { 0x0591, 0x05bd }, { 0x05bf, 0x05bf }, { 0x05c1, 0x05c2 }, 57 | - { 0x05c4, 0x05c5 }, { 0x05c7, 0x05c7 }, { 0x0600, 0x0603 }, 58 | - { 0x0610, 0x0615 }, { 0x064b, 0x065e }, { 0x0670, 0x0670 }, 59 | - { 0x06d6, 0x06e4 }, { 0x06e7, 0x06e8 }, { 0x06ea, 0x06ed }, 60 | - { 0x070f, 0x070f }, { 0x0711, 0x0711 }, { 0x0730, 0x074a }, 61 | - { 0x07a6, 0x07b0 }, { 0x07eb, 0x07f3 }, { 0x0901, 0x0902 }, 62 | - { 0x093c, 0x093c }, { 0x0941, 0x0948 }, { 0x094d, 0x094d }, 63 | - { 0x0951, 0x0954 }, { 0x0962, 0x0963 }, { 0x0981, 0x0981 }, 64 | - { 0x09bc, 0x09bc }, { 0x09c1, 0x09c4 }, { 0x09cd, 0x09cd }, 65 | - { 0x09e2, 0x09e3 }, { 0x0a01, 0x0a02 }, { 0x0a3c, 0x0a3c }, 66 | - { 0x0a41, 0x0a42 }, { 0x0a47, 0x0a48 }, { 0x0a4b, 0x0a4d }, 67 | - { 0x0a70, 0x0a71 }, { 0x0a81, 0x0a82 }, { 0x0abc, 0x0abc }, 68 | - { 0x0ac1, 0x0ac5 }, { 0x0ac7, 0x0ac8 }, { 0x0acd, 0x0acd }, 69 | - { 0x0ae2, 0x0ae3 }, { 0x0b01, 0x0b01 }, { 0x0b3c, 0x0b3c }, 70 | - { 0x0b3f, 0x0b3f }, { 0x0b41, 0x0b43 }, { 0x0b4d, 0x0b4d }, 71 | - { 0x0b56, 0x0b56 }, { 0x0b82, 0x0b82 }, { 0x0bc0, 0x0bc0 }, 72 | - { 0x0bcd, 0x0bcd }, { 0x0c3e, 0x0c40 }, { 0x0c46, 0x0c48 }, 73 | - { 0x0c4a, 0x0c4d }, { 0x0c55, 0x0c56 }, { 0x0cbc, 0x0cbc }, 74 | - { 0x0cbf, 0x0cbf }, { 0x0cc6, 0x0cc6 }, { 0x0ccc, 0x0ccd }, 75 | - { 0x0ce2, 0x0ce3 }, { 0x0d41, 0x0d43 }, { 0x0d4d, 0x0d4d }, 76 | - { 0x0dca, 0x0dca }, { 0x0dd2, 0x0dd4 }, { 0x0dd6, 0x0dd6 }, 77 | - { 0x0e31, 0x0e31 }, { 0x0e34, 0x0e3a }, { 0x0e47, 0x0e4e }, 78 | - { 0x0eb1, 0x0eb1 }, { 0x0eb4, 0x0eb9 }, { 0x0ebb, 0x0ebc }, 79 | - { 0x0ec8, 0x0ecd }, { 0x0f18, 0x0f19 }, { 0x0f35, 0x0f35 }, 80 | - { 0x0f37, 0x0f37 }, { 0x0f39, 0x0f39 }, { 0x0f71, 0x0f7e }, 81 | - { 0x0f80, 0x0f84 }, { 0x0f86, 0x0f87 }, { 0x0f90, 0x0f97 }, 82 | - { 0x0f99, 0x0fbc }, { 0x0fc6, 0x0fc6 }, { 0x102d, 0x1030 }, 83 | - { 0x1032, 0x1032 }, { 0x1036, 0x1037 }, { 0x1039, 0x1039 }, 84 | - { 0x1058, 0x1059 }, { 0x1160, 0x11ff }, { 0x135f, 0x135f }, 85 | - { 0x1712, 0x1714 }, { 0x1732, 0x1734 }, { 0x1752, 0x1753 }, 86 | - { 0x1772, 0x1773 }, { 0x17b4, 0x17b5 }, { 0x17b7, 0x17bd }, 87 | - { 0x17c6, 0x17c6 }, { 0x17c9, 0x17d3 }, { 0x17dd, 0x17dd }, 88 | - { 0x180b, 0x180d }, { 0x18a9, 0x18a9 }, { 0x1920, 0x1922 }, 89 | - { 0x1927, 0x1928 }, { 0x1932, 0x1932 }, { 0x1939, 0x193b }, 90 | - { 0x1a17, 0x1a18 }, { 0x1b00, 0x1b03 }, { 0x1b34, 0x1b34 }, 91 | - { 0x1b36, 0x1b3a }, { 0x1b3c, 0x1b3c }, { 0x1b42, 0x1b42 }, 92 | - { 0x1b6b, 0x1b73 }, { 0x1dc0, 0x1dca }, { 0x1dfe, 0x1dff }, 93 | - { 0x200b, 0x200f }, { 0x202a, 0x202e }, { 0x2060, 0x2063 }, 94 | - { 0x206a, 0x206f }, { 0x20d0, 0x20ef }, { 0x302a, 0x302f }, 95 | -#ifndef __APPLE__ 96 | - { 0x3099, 0x309a }, 97 | -#endif 98 | - { 0xa806, 0xa806 }, { 0xa80b, 0xa80b }, 99 | - { 0xa825, 0xa826 }, { 0xfb1e, 0xfb1e }, { 0xfe00, 0xfe0f }, 100 | - { 0xfe20, 0xfe23 }, { 0xfeff, 0xfeff }, { 0xfff9, 0xfffb }, 101 | - { 0x10a01, 0x10a03 }, { 0x10a05, 0x10a06 }, { 0x10a0c, 0x10a0f }, 102 | - { 0x10a38, 0x10a3a }, { 0x10a3f, 0x10a3f }, { 0x1d167, 0x1d169 }, 103 | - { 0x1d173, 0x1d182 }, { 0x1d185, 0x1d18b }, { 0x1d1aa, 0x1d1ad }, 104 | - { 0x1d242, 0x1d244 }, { 0xe0001, 0xe0001 }, { 0xe0020, 0xe007f }, 105 | - { 0xe0100, 0xe01ef } 106 | - }; 107 | - 108 | - /* test for 8-bit control characters */ 109 | - if (ucs == 0) 110 | - return 0; 111 | - if (ucs < 32 || (ucs >= 0x7f && ucs < 0xa0)) 112 | - return -1; 113 | - 114 | - /* binary search in table of non-spacing characters */ 115 | - if (bisearch(ucs, combining, 116 | - sizeof(combining) / sizeof(struct interval) - 1)) 117 | - return 0; 118 | - 119 | - /* if we arrive here, ucs is not a combining or C0/C1 control character */ 120 | - 121 | - /* fast test for majority of non-wide scripts */ 122 | - if (ucs < 0x1100) 123 | - return 1; 124 | - 125 | - return 1 + 126 | - (ucs >= 0x1100 && 127 | - (ucs <= 0x115f || /* Hangul Jamo init. consonants */ 128 | - ucs == 0x2329 || ucs == 0x232a || 129 | - (ucs >= 0x2e80 && ucs <= 0xa4cf && 130 | - ucs != 0x303f) || /* CJK ... Yi */ 131 | - (ucs >= 0xac00 && ucs <= 0xd7a3) || /* Hangul Syllables */ 132 | - (ucs >= 0xf900 && ucs <= 0xfaff) || /* CJK Compatibility Ideographs */ 133 | - (ucs >= 0xfe10 && ucs <= 0xfe19) || /* Vertical forms */ 134 | - (ucs >= 0xfe30 && ucs <= 0xfe6f) || /* CJK Compatibility Forms */ 135 | - (ucs >= 0xff00 && ucs <= 0xff60) || /* Fullwidth Forms */ 136 | - (ucs >= 0xffe0 && ucs <= 0xffe6) || 137 | - (ucs >= 0x20000 && ucs <= 0x2fffd) || 138 | - (ucs >= 0x30000 && ucs <= 0x3fffd))); 139 | -} 140 | - 141 | -#if 0 /* original */ 142 | -int wcswidth_ucs(const wchar_t *pwcs, size_t n) 143 | -{ 144 | - int w, width = 0; 145 | - 146 | - for (;*pwcs && n-- > 0; pwcs++) 147 | - if ((w = wcwidth_ucs(*pwcs)) < 0) 148 | - return -1; 149 | - else 150 | - width += w; 151 | - 152 | - return width; 153 | -} 154 | -#endif 155 | - 156 | -/* 157 | - * The following functions are the same as wcwidth_ucs() and 158 | - * wcwidth_cjk(), except that spacing characters in the East Asian 159 | - * Ambiguous (A) category as defined in Unicode Technical Report #11 160 | - * have a column width of 2. This variant might be useful for users of 161 | - * CJK legacy encodings who want to migrate to UCS without changing 162 | - * the traditional terminal character-width behaviour. It is not 163 | - * otherwise recommended for general use. 164 | - */ 165 | -/* 166 | - * In addition to the explanation mentioned above, 167 | - * several characters in the East Asian Narrow (Na) and Not East Asian 168 | - * (Neutral) category as defined in Unicode Technical Report #11 169 | - * actually have a column width of 2 in CJK legacy encodings. 170 | - */ 171 | - 172 | #define wcwidth_cjk wcwidth 173 | #define wcswidth_cjk wcswidth 174 | 175 | @@ -214,95 +60,198 @@ int wcswidth_ucs(const wchar_t *pwcs, size_t n) 176 | # undef wcwidth 177 | #endif 178 | 179 | +typedef int (*wcwidth_t)(wchar_t); 180 | + 181 | int wcwidth_cjk(wchar_t ucs) 182 | { 183 | - /* sorted list of non-overlapping intervals of East Asian Ambiguous 184 | - * characters, generated by "uniset +WIDTH-A -cat=Me -cat=Mn -cat=Cf c" */ 185 | - static const struct interval ambiguous[] = { 186 | - { 0x00a1, 0x00a1 }, { 0x00a4, 0x00a4 }, { 0x00a7, 0x00a8 }, 187 | - { 0x00aa, 0x00aa }, { 0x00ae, 0x00ae }, { 0x00b0, 0x00b4 }, 188 | - { 0x00b6, 0x00ba }, { 0x00bc, 0x00bf }, { 0x00c6, 0x00c6 }, 189 | - { 0x00d0, 0x00d0 }, { 0x00d7, 0x00d8 }, { 0x00de, 0x00e1 }, 190 | - { 0x00e6, 0x00e6 }, { 0x00e8, 0x00ea }, { 0x00ec, 0x00ed }, 191 | - { 0x00f0, 0x00f0 }, { 0x00f2, 0x00f3 }, { 0x00f7, 0x00fa }, 192 | - { 0x00fc, 0x00fc }, { 0x00fe, 0x00fe }, { 0x0101, 0x0101 }, 193 | - { 0x0111, 0x0111 }, { 0x0113, 0x0113 }, { 0x011b, 0x011b }, 194 | - { 0x0126, 0x0127 }, { 0x012b, 0x012b }, { 0x0131, 0x0133 }, 195 | - { 0x0138, 0x0138 }, { 0x013f, 0x0142 }, { 0x0144, 0x0144 }, 196 | - { 0x0148, 0x014b }, { 0x014d, 0x014d }, { 0x0152, 0x0153 }, 197 | - { 0x0166, 0x0167 }, { 0x016b, 0x016b }, { 0x01ce, 0x01ce }, 198 | - { 0x01d0, 0x01d0 }, { 0x01d2, 0x01d2 }, { 0x01d4, 0x01d4 }, 199 | - { 0x01d6, 0x01d6 }, { 0x01d8, 0x01d8 }, { 0x01da, 0x01da }, 200 | - { 0x01dc, 0x01dc }, { 0x0251, 0x0251 }, { 0x0261, 0x0261 }, 201 | - { 0x02c4, 0x02c4 }, { 0x02c7, 0x02c7 }, { 0x02c9, 0x02cb }, 202 | - { 0x02cd, 0x02cd }, { 0x02d0, 0x02d0 }, { 0x02d8, 0x02db }, 203 | - { 0x02dd, 0x02dd }, { 0x02df, 0x02df }, { 0x0391, 0x03a1 }, 204 | - { 0x03a3, 0x03a9 }, { 0x03b1, 0x03c1 }, { 0x03c3, 0x03c9 }, 205 | - { 0x0401, 0x0401 }, { 0x0410, 0x044f }, { 0x0451, 0x0451 }, 206 | - { 0x2010, 0x2010 }, { 0x2013, 0x2016 }, { 0x2018, 0x2019 }, 207 | - { 0x201c, 0x201d }, { 0x2020, 0x2022 }, { 0x2024, 0x2027 }, 208 | - { 0x2030, 0x2030 }, { 0x2032, 0x2033 }, { 0x2035, 0x2035 }, 209 | - { 0x203b, 0x203b }, { 0x203e, 0x203e }, { 0x2074, 0x2074 }, 210 | - { 0x207f, 0x207f }, { 0x2081, 0x2084 }, { 0x20ac, 0x20ac }, 211 | - { 0x2103, 0x2103 }, { 0x2105, 0x2105 }, { 0x2109, 0x2109 }, 212 | - { 0x2113, 0x2113 }, { 0x2116, 0x2116 }, { 0x2121, 0x2122 }, 213 | - { 0x2126, 0x2126 }, { 0x212b, 0x212b }, { 0x2153, 0x2154 }, 214 | - { 0x215b, 0x215e }, { 0x2160, 0x216b }, { 0x2170, 0x2179 }, 215 | - { 0x2190, 0x2199 }, { 0x21b8, 0x21b9 }, { 0x21d2, 0x21d2 }, 216 | - { 0x21d4, 0x21d4 }, { 0x21e7, 0x21e7 }, { 0x2200, 0x2200 }, 217 | - { 0x2202, 0x2203 }, { 0x2207, 0x2208 }, { 0x220b, 0x220b }, 218 | - { 0x220f, 0x220f }, { 0x2211, 0x2211 }, { 0x2215, 0x2215 }, 219 | - { 0x221a, 0x221a }, { 0x221d, 0x2220 }, { 0x2223, 0x2223 }, 220 | - { 0x2225, 0x2225 }, { 0x2227, 0x222c }, { 0x222e, 0x222e }, 221 | - { 0x2234, 0x2237 }, { 0x223c, 0x223d }, { 0x2248, 0x2248 }, 222 | - { 0x224c, 0x224c }, { 0x2252, 0x2252 }, { 0x2260, 0x2261 }, 223 | - { 0x2264, 0x2267 }, { 0x226a, 0x226b }, { 0x226e, 0x226f }, 224 | - { 0x2282, 0x2283 }, { 0x2286, 0x2287 }, { 0x2295, 0x2295 }, 225 | - { 0x2299, 0x2299 }, { 0x22a5, 0x22a5 }, { 0x22bf, 0x22bf }, 226 | - { 0x2312, 0x2312 }, { 0x2460, 0x24e9 }, { 0x24eb, 0x254b }, 227 | - { 0x2550, 0x2573 }, { 0x2580, 0x258f }, { 0x2592, 0x2595 }, 228 | - { 0x25a0, 0x25a1 }, { 0x25a3, 0x25a9 }, { 0x25b2, 0x25b3 }, 229 | - { 0x25b6, 0x25b7 }, { 0x25bc, 0x25bd }, { 0x25c0, 0x25c1 }, 230 | - { 0x25c6, 0x25c8 }, { 0x25cb, 0x25cb }, { 0x25ce, 0x25d1 }, 231 | - { 0x25e2, 0x25e5 }, { 0x25ef, 0x25ef }, { 0x2605, 0x2606 }, 232 | - { 0x2609, 0x2609 }, { 0x260e, 0x260f }, { 0x2614, 0x2615 }, 233 | - { 0x261c, 0x261c }, { 0x261e, 0x261e }, { 0x2640, 0x2640 }, 234 | - { 0x2642, 0x2642 }, { 0x2660, 0x2661 }, { 0x2663, 0x2665 }, 235 | - { 0x2667, 0x266a }, { 0x266c, 0x266d }, { 0x266f, 0x266f }, 236 | - { 0x273d, 0x273d }, { 0x2776, 0x277f }, { 0xe000, 0xf8ff }, 237 | - { 0xfffd, 0xfffd }, { 0xf0000, 0xffffd }, { 0x100000, 0x10fffd } 238 | - }; 239 | + wcwidth_t fallback = (wcwidth_t)dlsym(RTLD_NEXT, "wcwidth"); 240 | 241 | -#ifdef JA_LEGACY 242 | - /* For Japanese legacy encodings, the following characters are added. */ 243 | - static const struct interval legacy_ja[] = { 244 | - { 0x00A2, 0x00A3 }, { 0x00A5, 0x00A6 }, { 0x00AC, 0x00AC }, 245 | - { 0x00AF, 0x00AF }, { 0x2212, 0x2212 } 246 | + /* 247 | + * This table makes from https://github.com/hamano/locale-eaw 248 | + * */ 249 | + static const struct interval fullwidth[] = { 250 | + { 0x00A1, 0x00A1 }, 251 | + { 0x00A4, 0x00A4 }, 252 | + { 0x00A7, 0x00A8 }, 253 | + { 0x00AA, 0x00AA }, 254 | + { 0x00AD, 0x00AE }, 255 | + { 0x00B0, 0x00B4 }, 256 | + { 0x00B6, 0x00BA }, 257 | + { 0x00BC, 0x00BF }, 258 | + { 0x00C6, 0x00C6 }, 259 | + { 0x00D0, 0x00D0 }, 260 | + { 0x00D7, 0x00D8 }, 261 | + { 0x00DE, 0x00E1 }, 262 | + { 0x00E6, 0x00E6 }, 263 | + { 0x00E8, 0x00EA }, 264 | + { 0x00EC, 0x00ED }, 265 | + { 0x00F0, 0x00F0 }, 266 | + { 0x00F2, 0x00F3 }, 267 | + { 0x00F7, 0x00FA }, 268 | + { 0x00FC, 0x00FC }, 269 | + { 0x00FE, 0x00FE }, 270 | + { 0x0101, 0x0101 }, 271 | + { 0x0111, 0x0111 }, 272 | + { 0x0113, 0x0113 }, 273 | + { 0x011B, 0x011B }, 274 | + { 0x0126, 0x0127 }, 275 | + { 0x012B, 0x012B }, 276 | + { 0x0131, 0x0133 }, 277 | + { 0x0138, 0x0138 }, 278 | + { 0x013F, 0x0142 }, 279 | + { 0x0144, 0x0144 }, 280 | + { 0x0148, 0x014B }, 281 | + { 0x014D, 0x014D }, 282 | + { 0x0152, 0x0153 }, 283 | + { 0x0166, 0x0167 }, 284 | + { 0x016B, 0x016B }, 285 | + { 0x01CE, 0x01CE }, 286 | + { 0x01D0, 0x01D0 }, 287 | + { 0x01D2, 0x01D2 }, 288 | + { 0x01D4, 0x01D4 }, 289 | + { 0x01D6, 0x01D6 }, 290 | + { 0x01D8, 0x01D8 }, 291 | + { 0x01DA, 0x01DA }, 292 | + { 0x01DC, 0x01DC }, 293 | + { 0x0251, 0x0251 }, 294 | + { 0x0261, 0x0261 }, 295 | + { 0x02C4, 0x02C4 }, 296 | + { 0x02C7, 0x02C7 }, 297 | + { 0x02C9, 0x02CB }, 298 | + { 0x02CD, 0x02CD }, 299 | + { 0x02D0, 0x02D0 }, 300 | + { 0x02D8, 0x02DB }, 301 | + { 0x02DD, 0x02DD }, 302 | + { 0x02DF, 0x02DF }, 303 | + { 0x0391, 0x03A1 }, 304 | + { 0x03A3, 0x03A9 }, 305 | + { 0x03B1, 0x03C1 }, 306 | + { 0x03C3, 0x03C9 }, 307 | + { 0x0401, 0x0401 }, 308 | + { 0x0410, 0x044F }, 309 | + { 0x0451, 0x0451 }, 310 | + { 0x2010, 0x2010 }, 311 | + { 0x2013, 0x2016 }, 312 | + { 0x2018, 0x2019 }, 313 | + { 0x201C, 0x201D }, 314 | + { 0x2020, 0x2022 }, 315 | + { 0x2024, 0x2027 }, 316 | + { 0x2030, 0x2030 }, 317 | + { 0x2032, 0x2033 }, 318 | + { 0x2035, 0x2035 }, 319 | + { 0x203B, 0x203B }, 320 | + { 0x203E, 0x203E }, 321 | + { 0x2074, 0x2074 }, 322 | + { 0x207F, 0x207F }, 323 | + { 0x2081, 0x2084 }, 324 | + { 0x20AC, 0x20AC }, 325 | + { 0x2103, 0x2103 }, 326 | + { 0x2105, 0x2105 }, 327 | + { 0x2109, 0x2109 }, 328 | + { 0x2113, 0x2113 }, 329 | + { 0x2116, 0x2116 }, 330 | + { 0x2121, 0x2122 }, 331 | + { 0x2126, 0x2126 }, 332 | + { 0x212B, 0x212B }, 333 | + { 0x2153, 0x2154 }, 334 | + { 0x215B, 0x215E }, 335 | + { 0x2160, 0x216B }, 336 | + { 0x2170, 0x2179 }, 337 | + { 0x2189, 0x2189 }, 338 | + { 0x2190, 0x2199 }, 339 | + { 0x21B8, 0x21B9 }, 340 | + { 0x21D2, 0x21D2 }, 341 | + { 0x21D4, 0x21D4 }, 342 | + { 0x21E7, 0x21E7 }, 343 | + { 0x2200, 0x2200 }, 344 | + { 0x2202, 0x2203 }, 345 | + { 0x2207, 0x2208 }, 346 | + { 0x220B, 0x220B }, 347 | + { 0x220F, 0x220F }, 348 | + { 0x2211, 0x2211 }, 349 | + { 0x2215, 0x2215 }, 350 | + { 0x221A, 0x221A }, 351 | + { 0x221D, 0x2220 }, 352 | + { 0x2223, 0x2223 }, 353 | + { 0x2225, 0x2225 }, 354 | + { 0x2227, 0x222C }, 355 | + { 0x222E, 0x222E }, 356 | + { 0x2234, 0x2237 }, 357 | + { 0x223C, 0x223D }, 358 | + { 0x2248, 0x2248 }, 359 | + { 0x224C, 0x224C }, 360 | + { 0x2252, 0x2252 }, 361 | + { 0x2260, 0x2261 }, 362 | + { 0x2264, 0x2267 }, 363 | + { 0x226A, 0x226B }, 364 | + { 0x226E, 0x226F }, 365 | + { 0x2282, 0x2283 }, 366 | + { 0x2286, 0x2287 }, 367 | + { 0x2295, 0x2295 }, 368 | + { 0x2299, 0x2299 }, 369 | + { 0x22A5, 0x22A5 }, 370 | + { 0x22BF, 0x22BF }, 371 | + { 0x2312, 0x2312 }, 372 | + { 0x2460, 0x24E9 }, 373 | + { 0x24EB, 0x254B }, 374 | + { 0x2550, 0x2573 }, 375 | + { 0x2580, 0x258F }, 376 | + { 0x2592, 0x2595 }, 377 | + { 0x25A0, 0x25A1 }, 378 | + { 0x25A3, 0x25A9 }, 379 | + { 0x25B2, 0x25B3 }, 380 | + { 0x25B6, 0x25B7 }, 381 | + { 0x25BC, 0x25BD }, 382 | + { 0x25C0, 0x25C1 }, 383 | + { 0x25C6, 0x25C8 }, 384 | + { 0x25CB, 0x25CB }, 385 | + { 0x25CE, 0x25D1 }, 386 | + { 0x25E2, 0x25E5 }, 387 | + { 0x25EF, 0x25EF }, 388 | + { 0x2605, 0x2606 }, 389 | + { 0x2609, 0x2609 }, 390 | + { 0x260E, 0x260F }, 391 | + { 0x261C, 0x261C }, 392 | + { 0x261E, 0x261E }, 393 | + { 0x2640, 0x2640 }, 394 | + { 0x2642, 0x2642 }, 395 | + { 0x2660, 0x2661 }, 396 | + { 0x2663, 0x2665 }, 397 | + { 0x2667, 0x266A }, 398 | + { 0x266C, 0x266D }, 399 | + { 0x266F, 0x266F }, 400 | + { 0x269E, 0x269F }, 401 | + { 0x26BF, 0x26BF }, 402 | + { 0x26C6, 0x26CD }, 403 | + { 0x26CF, 0x26D3 }, 404 | + { 0x26D5, 0x26E1 }, 405 | + { 0x26E3, 0x26E3 }, 406 | + { 0x26E8, 0x26E9 }, 407 | + { 0x26EB, 0x26F1 }, 408 | + { 0x26F4, 0x26F4 }, 409 | + { 0x26F6, 0x26F9 }, 410 | + { 0x26FB, 0x26FC }, 411 | + { 0x26FE, 0x26FF }, 412 | + { 0x273D, 0x273D }, 413 | + { 0x2776, 0x277F }, 414 | + { 0x2B56, 0x2B59 }, 415 | + { 0x3248, 0x324F }, 416 | + { 0xE000, 0xF8FF }, 417 | + { 0xFFFD, 0xFFFD }, 418 | + { 0x1F100, 0x1F10A }, 419 | + { 0x1F110, 0x1F12D }, 420 | + { 0x1F130, 0x1F169 }, 421 | + { 0x1F170, 0x1F18D }, 422 | + { 0x1F18F, 0x1F190 }, 423 | + { 0x1F19B, 0x1F1AC }, 424 | + { 0xF0000, 0x10FFFD }, 425 | }; 426 | -#endif /* JA_LEGACY */ 427 | 428 | - /* binary search in table of non-spacing characters */ 429 | - if (bisearch(ucs, ambiguous, 430 | - sizeof(ambiguous) / sizeof(struct interval) - 1)) 431 | + if (bisearch(ucs, fullwidth, sizeof(fullwidth) / sizeof(struct interval) - 1)) { 432 | return 2; 433 | -#ifdef JA_LEGACY 434 | - if (bisearch(ucs, legacy_ja, 435 | - sizeof(legacy_ja) / sizeof(struct interval) - 1)) 436 | - return 2; 437 | -#endif /* JA_LEGACY */ 438 | - 439 | -#ifdef EMOJI 440 | - static const struct interval emoji[] = { 441 | - { 0x2600, 0x27BF }, 442 | - { 0x1F300, 0x1F64F }, { 0x1F680, 0x1F6FF }, { 0x1F900, 0x1F9FF }, 443 | - }; 444 | - 445 | - if (bisearch(ucs, emoji, 446 | - sizeof(emoji) / sizeof(struct interval) - 1)) 447 | - return 2; 448 | -#endif /* EMOJI */ 449 | + } 450 | 451 | - return wcwidth_ucs(ucs); 452 | + return fallback(ucs); 453 | } 454 | 455 | int wcswidth_cjk(const wchar_t *pwcs, size_t n) 456 | -------------------------------------------------------------------------------- /pkgs/wine-run/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | lib, 3 | runCommand, 4 | writeShellScript, 5 | pname ? "wine", 6 | paths ? "", 7 | }: 8 | let 9 | env = lib.optionalString (paths != "") '' 10 | export PATH=${paths}:$PATH 11 | ''; 12 | 13 | wine-runtime = writeShellScript "${pname}" '' 14 | ${env} 15 | unset LD_PRELOAD 16 | 17 | if [[ ! -d $(pwd)/drive_c ]]; then 18 | echo 'This directory is not wine prefix' >&2 19 | exit 1 20 | fi 21 | 22 | export WINEPREFIX=$(pwd) 23 | exec "''${@:-}" 24 | ''; 25 | 26 | wine-setup = writeShellScript "${pname}-setup" '' 27 | ${wine-run} wineboot -u 28 | ${wine-run} winetricks corefonts fakejapanese 29 | ${wine-run} wineboot -s 30 | ''; 31 | 32 | wine-run = writeShellScript "${pname}-wine" '' 33 | ${env} 34 | 35 | case "''${0:-}" in 36 | *64) 37 | exec wine64 "''${@:-}" 38 | ;; 39 | *) 40 | exec wine "''${@:-}" 41 | ;; 42 | esac 43 | ''; 44 | in 45 | runCommand "wine-run" { } '' 46 | mkdir -p $out/bin 47 | cp ${wine-runtime} $out/bin/${pname} 48 | cp ${wine-setup} $out/bin/${pname}-setup 49 | cp ${wine-run} $out/bin/${pname}-wine 50 | cp ${wine-run} $out/bin/${pname}-wine64 51 | 52 | chmod +x $out/bin/* 53 | '' 54 | -------------------------------------------------------------------------------- /pkgs/wine-vst-wrapper/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | stdenv, 3 | fetchFromGitHub, 4 | pkgsCross, 5 | }: 6 | stdenv.mkDerivation rec { 7 | pname = "wine-vst-wrapper"; 8 | version = "git"; 9 | src = fetchFromGitHub { 10 | owner = "nyarla"; 11 | repo = "WineVSTWrapper"; 12 | rev = "6f4c3017dfe2a3fb50240b1ce3b3226739106a8b"; 13 | sha256 = "1w00wq5641kr6224gdll38rpqkngf0ir42vd7a2cpnk655wiwwq3"; 14 | }; 15 | 16 | nativeBuildInputs = [ pkgsCross.mingwW64.buildPackages.gcc ]; 17 | 18 | buildPhase = '' 19 | make 20 | ''; 21 | 22 | installPhase = '' 23 | mkdir -p $out/share/wine-vst-wrapper/ 24 | cp vst.dll $out/share/wine-vst-wrapper/vst.dll 25 | ''; 26 | } 27 | -------------------------------------------------------------------------------- /pkgs/wineasio/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | multiStdenv, 3 | fetchFromGitHub, 4 | libjack2, 5 | pkg-config, 6 | wine, 7 | pkgsi686Linux, 8 | qt5, 9 | python3, 10 | }: 11 | 12 | multiStdenv.mkDerivation rec { 13 | pname = "wineasio"; 14 | version = "2024-03-02"; 15 | src = fetchFromGitHub { 16 | owner = pname; 17 | repo = pname; 18 | rev = "652964155dcee005078c7cb652656e8a0b995186"; 19 | hash = "sha256-2wMZ+TIuD8eECTfJ0rz5JmL4sdLGVm6GMxW9CAkvIoI="; 20 | fetchSubmodules = true; 21 | }; 22 | 23 | nativeBuildInputs = [ 24 | pkg-config 25 | wine 26 | qt5.wrapQtAppsHook 27 | python3.pkgs.wrapPython 28 | ]; 29 | buildInputs = [ 30 | pkgsi686Linux.libjack2 31 | libjack2 32 | python3.pkgs.pyqt5 33 | qt5.qtbase 34 | ]; 35 | pythonPath = with python3.pkgs; [ pyqt5 ]; 36 | 37 | dontConfigure = true; 38 | makeFlags = [ "PREFIX=${wine}" ]; 39 | 40 | buildPhase = '' 41 | runHook preBuild 42 | 43 | make ''${makeFlags[@]} 32 44 | make ''${makeFlags[@]} 64 45 | 46 | cd gui 47 | make regen 48 | cd .. 49 | 50 | cat <wineasio-settings 51 | #!${multiStdenv.shell} 52 | exec $out/share/wineasio/settings.py "$@" 53 | EOF 54 | 55 | runHook postBuild 56 | ''; 57 | 58 | installPhase = '' 59 | runHook preInstall 60 | install -D build32/wineasio32.dll $out/lib/wine/i386-windows/wineasio32.dll 61 | install -D build32/wineasio32.dll.so $out/lib/wine/i386-unix/wineasio32.dll.so 62 | install -D build64/wineasio64.dll $out/lib/wine/x86_64-windows/wineasio64.dll 63 | install -D build64/wineasio64.dll.so $out/lib/wine/x86_64-unix/wineasio64.dll.so 64 | 65 | cd gui 66 | mkdir -p $out/share/wineasio 67 | install -m 644 -D *.py $out/share/wineasio/ 68 | cd .. 69 | 70 | install -D wineasio-settings -m 755 $out/bin/wineasio-settings 71 | 72 | cat <$out/bin/wineasio-register 73 | if [[ ! -e drive_c ]]; then 74 | echo 'This directory is not wine prefix!' >&2; exit 1 75 | fi 76 | 77 | case "''${1:-}" in 78 | 32) 79 | [[ ! -e drive_c/windows/system32/wineasio32.dll ]] || chmod +w drive_c/windows/system32/wineasio32.dll 80 | cp $out/lib/wine/i386-unix/wineasio32.dll.so \ 81 | drive_c/windows/system32/wineasio32.dll 82 | wine regsvr32 wineasio32.dll 83 | ;; 84 | 85 | 64) 86 | [[ ! -e drive_c/windows/system32/wineasio64.dll ]] || chmod +w drive_c/windows/system32/wineasio64.dll 87 | 88 | cp $out/lib/wine/x86_64-unix/wineasio64.dll.so \ 89 | drive_c/windows/system32/wineasio64.dll 90 | 91 | wine64 regsvr32 wineasio64.dll 92 | ;; 93 | 94 | wow) 95 | [[ ! -e drive_c/windows/system32/wineasio32.dll ]] || chmod +w drive_c/winsows/syswow64/wineasio32.dll 96 | cp $out/lib/wine/i386-unix/wineasio32.dll.so \ 97 | drive_c/windows/syswow64/wineasio32.dll 98 | wine regsvr32 wineasio32.dll 99 | ;; 100 | 101 | *) 102 | echo "Usage: wineasio-register [32|64|wow]"; 103 | exit 0; 104 | ;; 105 | esac 106 | EOF 107 | 108 | chmod +x $out/bin/wineasio-register 109 | 110 | runHook postInstall 111 | ''; 112 | 113 | fixupPhase = '' 114 | sed -i "s#/usr/bin/python3#${python3}/bin/python3#" $out/bin/wineasio-settings 115 | sed -i "s#X-PREFIX-X#$out#" $out/bin/wineasio-settings 116 | 117 | chmod +x $out/share/wineasio/settings.py 118 | wrapProgram $out/share/wineasio/settings.py \ 119 | ''${qtWrapperArgs[@]} \ 120 | --prefix PYTHONPATH : $PYTHONPATH 121 | ''; 122 | 123 | dontStrip = true; 124 | } 125 | -------------------------------------------------------------------------------- /pkgs/xembed-sni-proxy/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | libsForQt5, 3 | fetchpatch, 4 | xorg, 5 | }: 6 | libsForQt5.plasma-workspace.overrideAttrs (old: rec { 7 | pname = "xembed-sni-proxy"; 8 | inherit (old) version; 9 | 10 | patches = [ 11 | (fetchpatch { 12 | url = "https://aur.archlinux.org/cgit/aur.git/plain/cmake.patch?h=xembed-sni-proxy-git"; 13 | sha256 = "1nas6kdxprcvcj3d9p59jp6rqgfnvkkm2g28x9hp2ydydbgi4hmk"; 14 | }) 15 | ]; 16 | 17 | postPatch = '' 18 | sed -i 's|s_embedSize = 32;|s_embedSize = 1;|' xembed-sni-proxy/sniproxy.cpp 19 | ''; 20 | 21 | buildInputs = [ 22 | libsForQt5.qt5.qtx11extras 23 | libsForQt5.kwin 24 | xorg.libXdmcp 25 | xorg.libXtst 26 | ]; 27 | 28 | srcRoot = "xembed-sni-proxy"; 29 | configurePhase = '' 30 | cd xembed-sni-proxy 31 | cmake \ 32 | -DCMAKE_BUILD_TYPE=Release \ 33 | -DCMAKE_INSTALL_PREFIX=$out \ 34 | -DBUILD_TESTING=OFF \ 35 | . 36 | ''; 37 | 38 | buildPhase = '' 39 | make 40 | ''; 41 | 42 | installPhase = '' 43 | make install 44 | ''; 45 | 46 | postFixup = ""; 47 | }) 48 | -------------------------------------------------------------------------------- /system/config/audio/daw.nix: -------------------------------------------------------------------------------- 1 | { ... }: 2 | { 3 | boot.kernelModules = [ 4 | "snd-seq" 5 | "snd-rawmidi" 6 | ]; 7 | security.pam.loginLimits = [ 8 | { 9 | domain = "@audio"; 10 | item = "memlock"; 11 | type = "-"; 12 | value = "unlimited"; 13 | } 14 | { 15 | domain = "@audio"; 16 | item = "rtprio"; 17 | type = "-"; 18 | value = "99"; 19 | } 20 | { 21 | domain = "@audio"; 22 | item = "nofile"; 23 | type = "soft"; 24 | value = "99999"; 25 | } 26 | { 27 | domain = "@audio"; 28 | item = "nofile"; 29 | type = "hard"; 30 | value = "99999"; 31 | } 32 | ]; 33 | } 34 | -------------------------------------------------------------------------------- /system/config/audio/pipewire.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | { 3 | boot.kernelModules = [ "snd_aloop" ]; 4 | boot.kernelParams = [ "snd_aloop.index=10" ]; 5 | 6 | # add packages to system 7 | environment.systemPackages = 8 | with pkgs; 9 | [ 10 | pwvucontrol 11 | pulseaudio 12 | ] 13 | ++ (with pipewire; [ 14 | out 15 | jack 16 | ]); 17 | 18 | # enable to pipewire services 19 | security.rtkit.enable = true; 20 | services.pipewire = { 21 | enable = true; 22 | 23 | # enable to audio backends 24 | alsa.enable = true; 25 | alsa.support32Bit = true; 26 | pulse.enable = true; 27 | jack.enable = true; 28 | 29 | # wireplumber settings 30 | wireplumber = { 31 | enable = true; 32 | }; 33 | 34 | # pipewire configurations 35 | extraConfig = { 36 | # pipewire daemon 37 | pipewire = { 38 | "10-clock-rate" = { 39 | "context.properties" = { 40 | "default.clock.allowed-rates" = [ 41 | 44100 42 | 48000 43 | 88200 44 | 96000 45 | 176400 46 | 192000 47 | ]; 48 | }; 49 | }; 50 | 51 | "98-focusrite-scalette-2gen" = { 52 | "device.rules" = [ 53 | { 54 | matches = [ 55 | { "device.name" = "alsa_card.usb-Focusrite_Scarlett_Solo_USB-00"; } 56 | ]; 57 | actions = { 58 | update-props = { 59 | "alsa.format" = "S32_LE"; 60 | "audio.format" = "S32LE"; 61 | }; 62 | }; 63 | } 64 | ]; 65 | }; 66 | "99-droidcam" = { 67 | "context.objects" = [ 68 | { 69 | # for droidcam 70 | factory = "adapter"; 71 | args = { 72 | "factory.name" = "api.alsa.pcm.source"; 73 | "node.name" = "DroidCam"; 74 | "object.linger" = true; 75 | "audio.channels" = 1; 76 | "api.alsa.path" = "hw:10,1,0"; 77 | "media.class" = "Audio/Source"; 78 | }; 79 | } 80 | ]; 81 | }; 82 | }; 83 | 84 | # client 85 | client = { 86 | "10-clock-rate" = { 87 | "context.properties" = { 88 | "default.clock.allowed-rates" = [ 89 | 44100 90 | 48000 91 | 88200 92 | 96000 93 | 176400 94 | 192000 95 | ]; 96 | }; 97 | }; 98 | }; 99 | 100 | # jackaudio 101 | jack = { 102 | "10-clock-rate" = { 103 | "context.properties" = { 104 | "default.clock.allowed-rates" = [ 105 | 44100 106 | 48000 107 | 88200 108 | 96000 109 | 176400 110 | 192000 111 | ]; 112 | }; 113 | }; 114 | }; 115 | 116 | # pulseaudio 117 | pipewire-pulse = { 118 | "10-clock-rate" = { 119 | "context.properties" = { 120 | "default.clock.allowed-rates" = [ 121 | 44100 122 | 48000 123 | 88200 124 | 96000 125 | 176400 126 | 192000 127 | ]; 128 | }; 129 | }; 130 | "90-pacmd" = { 131 | "pulse.cmd" = [ 132 | { 133 | cmd = "load-module"; 134 | args = "module-native-protocol-tcp listen=192.168.122.1"; 135 | } 136 | ]; 137 | }; 138 | }; 139 | }; 140 | }; 141 | } 142 | -------------------------------------------------------------------------------- /system/config/audio/tts.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | { 3 | environment.systemPackages = ( 4 | with pkgs; 5 | [ 6 | speechd-with-openjtalk 7 | openjtalk 8 | espeak 9 | ] 10 | ++ (with openjtalk; [ 11 | hts-voice-nitech-jp-atr503-m001 12 | open-jtalk-mecab-naist-jdic-utf8 13 | ]) 14 | ); 15 | } 16 | -------------------------------------------------------------------------------- /system/config/cpu/amd.nix: -------------------------------------------------------------------------------- 1 | _: { 2 | hardware.cpu.amd.updateMicrocode = true; 3 | 4 | # fix for kernel stuck on reboot or shutdown process with Ryzen Processor 5 | boot.kernelParams = [ "processor.max_cstate=1" ]; 6 | } 7 | -------------------------------------------------------------------------------- /system/config/cpu/intel.nix: -------------------------------------------------------------------------------- 1 | _: { hardware.cpu.intel.updateMicrocode = true; } 2 | -------------------------------------------------------------------------------- /system/config/datetime/jp.nix: -------------------------------------------------------------------------------- 1 | _: { 2 | # timezone 3 | time.timeZone = "Asia/Tokyo"; 4 | 5 | # ntp sync 6 | services.timesyncd = { 7 | enable = true; 8 | servers = [ 9 | "ntp1.jst.mfeed.ad.jp" 10 | "ntp2.jst.mfeed.ad.jp" 11 | "ntp3.jst.mfeed.ad.jp" 12 | ]; 13 | }; 14 | } 15 | -------------------------------------------------------------------------------- /system/config/desktop/files.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | let 3 | mateApps = with pkgs.mate; [ 4 | atril 5 | engrampa 6 | eom 7 | mate-polkit 8 | pluma 9 | ]; 10 | in 11 | { 12 | environment.systemPackages = mateApps; 13 | services.dbus.packages = mateApps; 14 | 15 | services = { 16 | udisks2.enable = true; 17 | gvfs.enable = true; 18 | tumbler.enable = true; 19 | }; 20 | 21 | programs.thunar = { 22 | enable = true; 23 | plugins = with pkgs.xfce; [ thunar-archive-plugin ]; 24 | }; 25 | 26 | programs.xfconf.enable = true; 27 | 28 | users.groups.storage = { }; 29 | 30 | security.polkit = { 31 | enable = true; 32 | extraConfig = '' 33 | polkit.addRule(function(action, subject) { 34 | if ( action.id === "org.freedesktop.udisks2.encrypted-unlock-system" && subject.isInGroup("storage") ) { 35 | return polkit.Result.YES; 36 | } 37 | if ( (action.id === "org.freedesktop.udisks2.filesystem-mount-system" 38 | || action.id === "org.freedesktop.udisks2.filesystem-mount") && subject.isInGroup("storage") ) { 39 | return polkit.Result.YES; 40 | } 41 | }); 42 | ''; 43 | }; 44 | } 45 | -------------------------------------------------------------------------------- /system/config/desktop/gnome-compatible.nix: -------------------------------------------------------------------------------- 1 | { config, pkgs, ... }: 2 | let 3 | gnomeApps = with pkgs; [ 4 | zenity 5 | dconf-editor 6 | gsound 7 | gcr 8 | ]; 9 | in 10 | { 11 | environment.systemPackages = gnomeApps; 12 | 13 | services = { 14 | accounts-daemon.enable = true; 15 | dbus.enable = true; 16 | dbus.packages = gnomeApps; 17 | system-config-printer.enable = true; 18 | 19 | gnome = { 20 | glib-networking.enable = true; 21 | gnome-keyring.enable = true; 22 | }; 23 | 24 | libinput.enable = true; 25 | }; 26 | 27 | programs.dconf.enable = true; 28 | programs.seahorse.enable = true; 29 | 30 | services.upower.enable = config.powerManagement.enable; 31 | } 32 | -------------------------------------------------------------------------------- /system/config/desktop/wayland.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | { 3 | imports = [ ./gnome-compatible.nix ]; 4 | security.pam.services.swaylock = { }; 5 | services.dbus.packages = with pkgs; [ 6 | xembed-sni-proxy 7 | ]; 8 | environment.systemPackages = with pkgs; [ 9 | xembed-sni-proxy 10 | ]; 11 | } 12 | -------------------------------------------------------------------------------- /system/config/desktop/xdg.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | let 3 | xdgPortalApps = with pkgs; [ 4 | xdg-desktop-portal-gtk 5 | xdg-desktop-portal-hyprland 6 | xdg-desktop-portal-xapp 7 | ]; 8 | in 9 | { 10 | environment.systemPackages = xdgPortalApps ++ (with pkgs; [ xdg-utils ]); 11 | 12 | xdg.portal = { 13 | enable = true; 14 | extraPortals = xdgPortalApps; 15 | configPackages = with pkgs; [ hyprland ]; 16 | }; 17 | } 18 | -------------------------------------------------------------------------------- /system/config/desktop/xorg.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | { 3 | imports = [ ./gnome-compatible.nix ]; 4 | environment.systemPackages = with pkgs; [ xclip ]; 5 | 6 | console.useXkbConfig = true; 7 | services.xserver = { 8 | enable = true; 9 | autorun = false; 10 | exportConfiguration = true; 11 | 12 | displayManager = { 13 | lightdm.enable = false; 14 | }; 15 | }; 16 | } 17 | -------------------------------------------------------------------------------- /system/config/gadgets/android.nix: -------------------------------------------------------------------------------- 1 | _: { programs.adb.enable = true; } 2 | -------------------------------------------------------------------------------- /system/config/graphic/fonts.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | { 3 | fonts = { 4 | packages = with pkgs; [ 5 | # basical fonts 6 | noto-fonts 7 | noto-fonts-jp 8 | noto-fonts-extra 9 | noto-fonts-emoji 10 | 11 | # monospace 12 | hackgen-font 13 | nerd-fonts.hack 14 | 15 | # fallback 16 | dejavu_fonts 17 | ]; 18 | 19 | fontconfig = { 20 | enable = true; 21 | 22 | defaultFonts = { 23 | sansSerif = [ 24 | "Noto Sans CJK JP" 25 | "DejaVu Sans" 26 | "Noto Sans Symbols" 27 | "Noto Sans Symbols2" 28 | ]; 29 | serif = [ 30 | "Noto Serif JP" 31 | "DejaVu Serif" 32 | "Noto Sans Symbols" 33 | "Noto Sans Symbols2" 34 | ]; 35 | monospace = [ 36 | "HackGen Console" 37 | "Hack Nerd Font" 38 | "DejaVu Sans Mono" 39 | "Noto Sans Symbols" 40 | "Noto Sans Symbols2" 41 | ]; 42 | emoji = [ "Noto Color Emoji" ]; 43 | }; 44 | }; 45 | }; 46 | } 47 | -------------------------------------------------------------------------------- /system/config/graphic/hidpi.nix: -------------------------------------------------------------------------------- 1 | _: { 2 | services.xserver.dpi = 192; 3 | fonts.fontconfig.dpi = 192; 4 | 5 | environment.variables = { 6 | GDK_SCALE = "2"; 7 | GDK_DPI_SCALE = "0.5"; 8 | QT_AUTOSCREEN_SCALE_FACTOR = "1"; 9 | }; 10 | } 11 | -------------------------------------------------------------------------------- /system/config/graphic/lodpi.nix: -------------------------------------------------------------------------------- 1 | _: { 2 | fonts.fontconfig.hinting.style = "full"; 3 | fonts.fontconfig.subpixel.lcdfilter = "default"; 4 | } 5 | -------------------------------------------------------------------------------- /system/config/hardware/dell-xps-9560-jp.nix: -------------------------------------------------------------------------------- 1 | _: { 2 | boot.kernelParams = [ 3 | # HW monitor 4 | # "dell-smm-hwmon.ignore_dmi=1" 5 | 6 | # Power saving (Intel) 7 | "i915.enable_fbc=1" 8 | "i195.enable_psr=1" 9 | "i915.disable_power_well=0" 10 | 11 | # dmesg error 12 | # "pcie_aspm=off" 13 | # "pci=nommconf" 14 | 15 | # optimize 16 | "nmi_watchdog=0" 17 | ]; 18 | 19 | boot.cleanTmpDir = true; 20 | boot.tmpOnTmpfs = false; 21 | 22 | services.udev.extraRules = '' 23 | SUBSYSTEM=="usb", ATTRS{idVendor}=="138a", ATTRS{idProduct}=="0091", ATTR{authorized}="0" 24 | ACTION=="add", SUBSYSTEM=="backlight", RUN+="${pkgs.coreutils}/bin/chgrp video /sys/class/backlight/%k/brightness" 25 | ACTION=="add", SUBSYSTEM=="backlight", RUN+="${pkgs.coreutils}/bin/chmod g+w /sys/class/backlight/%k/brightness" 26 | ''; 27 | 28 | services.hardware.bolt.enable = true; 29 | } 30 | -------------------------------------------------------------------------------- /system/config/hardware/firmware.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | { 3 | hardware.enableAllFirmware = true; 4 | hardware.enableRedistributableFirmware = true; 5 | services.fwupd.enable = true; 6 | environment.systemPackages = with pkgs; [ gnome-firmware ]; 7 | } 8 | -------------------------------------------------------------------------------- /system/config/hardware/weylus.nix: -------------------------------------------------------------------------------- 1 | { ... }: 2 | { 3 | programs.weylus = { 4 | enable = true; 5 | users = [ "nyarla" ]; 6 | }; 7 | 8 | networking.firewall.interfaces.wlan0.allowedTCPPorts = [ 9 | 1701 10 | 9001 11 | ]; 12 | } 13 | -------------------------------------------------------------------------------- /system/config/i18n/fcitx5.nix: -------------------------------------------------------------------------------- 1 | { config, pkgs, ... }: 2 | { 3 | i18n.inputMethod = { 4 | enable = true; 5 | type = "fcitx5"; 6 | fcitx5.addons = with pkgs; [ 7 | fcitx5-cskk 8 | fcitx5-cskk-qt5 9 | fcitx5-cskk-qt6 10 | fcitx5-gtk 11 | fcitx5-skk 12 | kdePackages.fcitx5-qt 13 | kdePackages.fcitx5-skk-qt 14 | libsForQt5.fcitx5-qt 15 | libsForQt5.fcitx5-skk-qt 16 | ]; 17 | fcitx5.waylandFrontend = true; 18 | }; 19 | 20 | services.dbus.packages = [ config.i18n.inputMethod.package ]; 21 | environment.systemPackages = with pkgs; [ 22 | skktools 23 | ]; 24 | environment.variables = { 25 | QT_IM_MODULE = "fcitx"; 26 | }; 27 | } 28 | -------------------------------------------------------------------------------- /system/config/i18n/locales.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | { 3 | i18n = rec { 4 | defaultLocale = "en_US.UTF-8"; 5 | supportedLocales = [ 6 | "en_US.UTF-8/UTF-8-EAW-CONSOLE" 7 | "ja_JP.UTF-8/UTF-8-EAW-CONSOLE" 8 | ]; 9 | glibcLocales = pkgs.glibc-locales-eaw.override { 10 | allLocales = false; 11 | locales = supportedLocales; 12 | }; 13 | }; 14 | } 15 | -------------------------------------------------------------------------------- /system/config/keyboard/jp.nix: -------------------------------------------------------------------------------- 1 | _: { 2 | console.useXkbConfig = true; 3 | services.xserver.layout = "jp"; 4 | services.xserver.xkbModel = "pc106"; 5 | services.xserver.xkbOptions = "ctrl:nocaps"; 6 | } 7 | -------------------------------------------------------------------------------- /system/config/keyboard/us.nix: -------------------------------------------------------------------------------- 1 | _: { 2 | console.useXkbConfig = true; 3 | services.xserver.xkb = { 4 | layout = "us"; 5 | model = "pc104"; 6 | options = "ctrl:nocaps"; 7 | }; 8 | } 9 | -------------------------------------------------------------------------------- /system/config/keyboard/zinc.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | { 3 | boot.kernelModules = [ "uinput" ]; 4 | 5 | hardware.keyboard.qmk.enable = true; 6 | 7 | services.udev.extraRules = '' 8 | SUBSYSTEMS=="usb", ATTRS{idVendor}=="04d8", ATTRS{idProduct}=="ea3b", ACTION=="add", GROUP="users", MODE="660" 9 | KERNEL=="uinput", GROUP="input", MODE="660" 10 | ''; 11 | 12 | services.udev.packages = with pkgs; [ vial ]; 13 | 14 | environment.systemPackages = with pkgs; [ 15 | qmk 16 | vial 17 | ]; 18 | } 19 | -------------------------------------------------------------------------------- /system/config/linux/console.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | { 3 | console.colors = [ 4 | "000000" 5 | "FF6633" 6 | "CCFF00" 7 | "FFCC33" 8 | "00CCFF" 9 | "CC99CC" 10 | "00CCCC" 11 | "F9F9F9" 12 | "666666" 13 | "FF6633" 14 | "CCFF00" 15 | "FFCC33" 16 | "00CCFF" 17 | "CC99CC" 18 | "00CCCC" 19 | "FFFFFF" 20 | ]; 21 | 22 | console.earlySetup = true; 23 | } 24 | -------------------------------------------------------------------------------- /system/config/linux/dbus.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | pkgs, 4 | lib, 5 | ... 6 | }: 7 | let 8 | target = lib.lists.remove null config.environment.systemPackages; 9 | 10 | addDBus = pkg: ns: '' 11 | if test -d ${pkg}/${ns} ; then 12 | cd ${pkg}/${ns} 13 | 14 | for file in $(ls); do 15 | if test -f $file ; then 16 | cp -RLf ${pkg}/${ns}/$file $out/${ns}/$file 17 | fi 18 | done 19 | fi 20 | ''; 21 | 22 | dbusBundlePackage = pkgs.runCommand "dbus-bundle" { } '' 23 | mkdir -p $out/etc/dbus-1/interfaces 24 | mkdir -p $out/etc/dbus-1/session.d 25 | mkdir -p $out/etc/dbus-1/system.d 26 | mkdir -p $out/share/dbus-1/interfaces 27 | mkdir -p $out/share/dbus-1/services 28 | mkdir -p $out/share/dbus-1/session.d 29 | mkdir -p $out/share/dbus-1/system-services 30 | mkdir -p $out/share/dbus-1/system.d 31 | 32 | ${lib.concatMapStrings (p: addDBus p "etc/dbus-1/interfaces") target} 33 | ${lib.concatMapStrings (p: addDBus p "etc/dbus-1/session.d") target} 34 | ${lib.concatMapStrings (p: addDBus p "etc/dbus-1/system.d") target} 35 | ${lib.concatMapStrings (p: addDBus p "share/dbus-1/interfaces") target} 36 | ${lib.concatMapStrings (p: addDBus p "share/dbus-1/services") target} 37 | ${lib.concatMapStrings (p: addDBus p "share/dbus-1/session.d") target} 38 | ${lib.concatMapStrings (p: addDBus p "share/dbus-1/system-services") target} 39 | ${lib.concatMapStrings (p: addDBus p "share/dbus-1/system.d") target} 40 | ''; 41 | in 42 | { 43 | services.dbus.packages = lib.mkForce (lib.singleton dbusBundlePackage); 44 | } 45 | -------------------------------------------------------------------------------- /system/config/linux/docker.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | { 3 | virtualisation.docker = { 4 | enable = true; 5 | storageDriver = "overlay2"; 6 | daemon.settings = { 7 | dns = [ 8 | "1.1.1.1" 9 | "1.0.0.1" 10 | ]; 11 | }; 12 | }; 13 | environment.systemPackages = with pkgs; [ docker ]; 14 | } 15 | -------------------------------------------------------------------------------- /system/config/linux/filesystem.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | { 3 | environment.systemPackages = with pkgs; [ 4 | btrfs-progs 5 | cryptsetup 6 | e2fsprogs 7 | exfat 8 | gptfdisk 9 | hfsprogs 10 | ntfs3g 11 | ]; 12 | 13 | programs.fuse.userAllowOther = true; 14 | } 15 | -------------------------------------------------------------------------------- /system/config/linux/hardware.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | { 3 | environment.systemPackages = with pkgs; [ 4 | multipath-tools 5 | pciutils 6 | usbutils 7 | ]; 8 | } 9 | -------------------------------------------------------------------------------- /system/config/linux/lodpi.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | { 3 | console.font = "${pkgs.terminus_font}/share/consolefonts/ter-v16n.psf.gz"; 4 | } 5 | -------------------------------------------------------------------------------- /system/config/linux/optical.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | { 3 | environment.systemPackages = with pkgs; [ whipper ]; 4 | } 5 | -------------------------------------------------------------------------------- /system/config/linux/optimize.nix: -------------------------------------------------------------------------------- 1 | _: { 2 | # kernel 3 | boot.kernelParams = [ "clocksource=hpet" ]; 4 | boot.kernelModules = [ 5 | # enable to tcp bbr 6 | "tcp_bbr" 7 | ]; 8 | 9 | # sysctl 10 | boot.kernel.sysctl = { 11 | # for swap 12 | "vm.swapiness" = 10; 13 | 14 | # for file watching 15 | "fs.inotify.max_user_watches" = 1048576; # 1GB 16 | 17 | # for networking 18 | "net.core.default_qdisc" = "cake"; 19 | "net.ipv4.tcp_congestion_control" = "bbr"; 20 | "net.ipv4.tcp_window_scaling" = 1; 21 | 22 | "net.core.netdev_max_backlog" = 16384; 23 | "net.core.somaxconn" = 8192; 24 | 25 | "net.ipv4.tcp_fastopen" = 3; 26 | }; 27 | 28 | # cpu 29 | powerManagement.enable = true; 30 | powerManagement.powertop.enable = true; 31 | powerManagement.cpuFreqGovernor = "powersave"; 32 | 33 | # udev 34 | services.udev.extraRules = '' 35 | # for audio 36 | KERNEL=="rtc0", GROUP="audio" 37 | KERNEL=="hpet", GROUP="audio" 38 | DEVPATH=="/devices/virtual/misc/cpu_dma_latency", OWNER="root", GROUP="audio", MODE="0660" 39 | 40 | # for storage 41 | ACTION=="add|change", KERNEL=="nvme[0-9]n[0-9]", ATTR{queue/scheduler}="none" 42 | ACTION=="add|change", KERNEL=="sd[a-z]*|mmcblk[0-9]*", ATTR{queue/rotational}=="0", ATTR{queue/scheduler}="brq" 43 | ACTION=="add|change", KERNEL=="sd[a-z]*", ATTR{queue/rotational}=="1", ATTR{queue/scheduler}="bfq" 44 | ''; 45 | } 46 | -------------------------------------------------------------------------------- /system/config/linux/process.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | { 3 | environment.systemPackages = with pkgs; [ 4 | htop 5 | lsof 6 | ]; 7 | } 8 | -------------------------------------------------------------------------------- /system/config/linux/waydroid.nix: -------------------------------------------------------------------------------- 1 | { lib, pkgs, ... }: 2 | { 3 | virtualisation = { 4 | waydroid.enable = true; 5 | lxd.enable = true; 6 | }; 7 | 8 | environment.etc."gbinder.d/waydroid.conf".source = lib.mkForce ( 9 | pkgs.writeText "waydroid.conf" '' 10 | [Protocol] 11 | /dev/binder = aidl3 12 | /dev/vndbinder = aidl3 13 | /dev/hwbinder = hidl 14 | 15 | [ServiceManager] 16 | /dev/binder = aidl3 17 | /dev/vndbinder = aidl3 18 | /dev/hwbinder = hidl 19 | 20 | [General] 21 | ApiLevel = 30 22 | '' 23 | ); 24 | } 25 | -------------------------------------------------------------------------------- /system/config/linux/wine.nix: -------------------------------------------------------------------------------- 1 | _: { 2 | services.udev.extraRules = '' 3 | KERNEL=="winesync", MODE="0644" 4 | ''; 5 | 6 | boot.kernelModules = [ "winesync" ]; 7 | } 8 | -------------------------------------------------------------------------------- /system/config/networking/agent.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | { 3 | environment.systemPackages = with pkgs; [ 4 | aria 5 | bind 6 | curlFull 7 | rclone 8 | restic 9 | restic-run 10 | wget 11 | ]; 12 | } 13 | -------------------------------------------------------------------------------- /system/config/networking/avahi.nix: -------------------------------------------------------------------------------- 1 | _: { 2 | services.avahi = { 3 | enable = true; 4 | ipv4 = true; 5 | ipv6 = true; 6 | reflector = true; 7 | nssmdns4 = true; 8 | publish = { 9 | enable = true; 10 | userServices = true; 11 | addresses = true; 12 | domain = true; 13 | }; 14 | }; 15 | } 16 | -------------------------------------------------------------------------------- /system/config/networking/network-manager.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | { 3 | environment.systemPackages = with pkgs; [ networkmanagerapplet ]; 4 | networking.networkmanager = { 5 | enable = true; 6 | dhcp = "internal"; 7 | wifi = { 8 | backend = "wpa_supplicant"; 9 | powersave = false; 10 | }; 11 | unmanaged = [ 12 | "interface-name:tailscale*" 13 | "interface-name:vboxnet*" 14 | "interface-name:virbr*" 15 | "interface-name:vmnet*" 16 | "interface-name:waydroid*" 17 | "type:bridge" 18 | ]; 19 | }; 20 | 21 | networking.enableIPv6 = true; 22 | } 23 | -------------------------------------------------------------------------------- /system/config/networking/printer.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | { 3 | services.printing.enable = true; 4 | services.printing.drivers = with pkgs; [ cnijfilter2 ]; 5 | 6 | hardware.sane.enable = true; 7 | hardware.sane.extraBackends = with pkgs; [ sane-airscan ]; 8 | } 9 | -------------------------------------------------------------------------------- /system/config/networking/tailscale.nix: -------------------------------------------------------------------------------- 1 | _: { 2 | services.tailscale = { 3 | enable = true; 4 | extraUpFlags = [ "--ssh" ]; 5 | }; 6 | } 7 | -------------------------------------------------------------------------------- /system/config/nixos/gsettings.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | pkgs, 4 | lib, 5 | ... 6 | }: 7 | let 8 | nixos-gsettings-overrides = pkgs.runCommand "nixos-gsettings-overrides" { } '' 9 | mkdir -p $out/share/gsettings-schemas/nixos-gsettings-overrides/glib-2.0/schemas/ 10 | cp -rf ${pkgs.gsettings-desktop-schemas}/share/gsettings-schemas/gsettings-desktop-schemas*/glib-2.0/schemas/*.xml \ 11 | $out/share/gsettings-schemas/nixos-gsettings-overrides/glib-2.0/schemas/ 12 | 13 | ${lib.concatMapStrings (p: '' 14 | if test -d ${p}/share/gsettings-schemas; then 15 | find ${p}/share/gsettings-schemas -name '*.xml' \ 16 | -exec cp -rfH {} $out/share/gsettings-schemas/nixos-gsettings-overrides/glib-2.0/schemas/ \; 17 | fi 18 | '') (lib.lists.remove null config.environment.systemPackages)} 19 | 20 | ${pkgs.glib.dev}/bin/glib-compile-schemas $out/share/gsettings-schemas/nixos-gsettings-overrides/glib-2.0/schemas/ 21 | ''; 22 | in 23 | { 24 | environment.etc."profile.d/gsettings.sh" = { 25 | text = '' 26 | export NIX_GSETTINGS_OVERRIDES_DIR=${nixos-gsettings-overrides}/share/gsettings-schemas/nixos-gsettings-overrides/glib-2.0/schemas 27 | ''; 28 | }; 29 | } 30 | -------------------------------------------------------------------------------- /system/config/nixos/nix-ld.nix: -------------------------------------------------------------------------------- 1 | { pkgs, lib, ... }: 2 | { 3 | programs.nix-ld.enable = true; 4 | programs.nix-ld.libraries = with pkgs; [ 5 | acl 6 | attr 7 | bzip2 8 | curl 9 | libsodium 10 | libssh 11 | libxcrypt 12 | libxml2 13 | openssl 14 | pkg-config 15 | stdenv.cc.cc.lib 16 | stdenv.cc.libc 17 | systemd 18 | util-linux 19 | xz 20 | zlib 21 | zstd 22 | ]; 23 | } 24 | -------------------------------------------------------------------------------- /system/config/nixos/nixpkgs.nix: -------------------------------------------------------------------------------- 1 | { config, pkgs, ... }: 2 | { 3 | nix = { 4 | package = pkgs.nixUnstable; 5 | extraOptions = '' 6 | experimental-features = nix-command flakes 7 | ''; 8 | }; 9 | 10 | nixpkgs = { 11 | config.allowUnfree = true; 12 | }; 13 | } 14 | -------------------------------------------------------------------------------- /system/config/security/clamav.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | { 3 | environment.systemPackages = with pkgs; [ clamav ]; 4 | services.clamav.daemon.enable = true; 5 | services.clamav.updater.enable = true; 6 | services.clamav.updater.settings = { 7 | DatabaseMirror = [ "db.jp.clamav.net" ]; 8 | }; 9 | } 10 | -------------------------------------------------------------------------------- /system/config/security/firewall-home.nix: -------------------------------------------------------------------------------- 1 | _: { 2 | networking.firewall = { 3 | enable = true; 4 | allowPing = true; 5 | checkReversePath = "loose"; # for tailscale 6 | interfaces = { 7 | "tailscale0" = { 8 | allowedTCPPorts = [ 9 | # calibre 10 | 8085 11 | 12 | # http 13 | 80 14 | 443 15 | 1313 # for development 16 | 8191 # for flaresolverr 17 | 18 | # ssh 19 | 22 20 | ]; 21 | 22 | allowedUDPPorts = [ 23 | # http 24 | 80 25 | 443 26 | ]; 27 | }; 28 | 29 | "wlan0" = { 30 | allowedTCPPorts = [ 31 | # syncthing 32 | 22000 33 | ]; 34 | 35 | allowedUDPPorts = [ 36 | # scanner 37 | 8610 38 | 8612 39 | 40 | # syncthing 41 | 22000 42 | 21027 43 | ]; 44 | }; 45 | 46 | "virbr0" = { 47 | allowedTCPPorts = [ 48 | # NetBIOS 49 | 137 50 | 138 51 | 139 52 | 445 53 | ]; 54 | 55 | allowedUDPPorts = [ 56 | # NetBIOS 57 | 137 58 | 138 59 | 139 60 | 445 61 | 62 | # netjack 63 | 19000 64 | ]; 65 | }; 66 | }; 67 | }; 68 | } 69 | -------------------------------------------------------------------------------- /system/config/security/gnupg.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | { 3 | programs.gnupg.agent.enable = true; 4 | programs.gnupg.agent.pinentryPackage = pkgs.pinentry-gnome3; 5 | } 6 | -------------------------------------------------------------------------------- /system/config/security/ulimit.nix: -------------------------------------------------------------------------------- 1 | _: { 2 | security.pam.loginLimits = [ 3 | { 4 | domain = "*"; 5 | type = "-"; 6 | item = "nofile"; 7 | value = "655360"; 8 | } 9 | { 10 | domain = "*"; 11 | item = "memlock"; 12 | type = "-"; 13 | value = "655360"; 14 | } 15 | ]; 16 | } 17 | -------------------------------------------------------------------------------- /system/config/security/yubikey.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | { 3 | environment.systemPackages = with pkgs; [ 4 | yubioath-flutter 5 | yubikey-personalization 6 | yubikey-personalization-gui 7 | ]; 8 | 9 | services.udev.packages = [ pkgs.yubikey-personalization ]; 10 | services.pcscd.enable = true; 11 | 12 | security.pam.u2f.settings.cue = true; 13 | security.pam.services = { 14 | sudo.u2fAuth = true; 15 | polkit-1.u2fAuth = true; 16 | login.u2fAuth = true; 17 | }; 18 | } 19 | -------------------------------------------------------------------------------- /system/config/services/nyzen9.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | { 3 | security.acme = { 4 | acceptTerms = true; 5 | defaults = { 6 | enableDebugLogs = false; 7 | email = "nyarla@kalaclista.com"; 8 | dnsProvider = "cloudflare"; 9 | dnsResolver = "1.1.1.1:53"; 10 | environmentFile = "/persist/var/lib/acme/cloudflare"; 11 | }; 12 | 13 | certs."localhost.thotep.net" = { 14 | extraDomainNames = [ 15 | "*.localhost.thotep.net" 16 | "*.p.localhost.thotep.net" 17 | "*.f.localhost.thotep.net" 18 | ]; 19 | }; 20 | }; 21 | 22 | services.flaresolverr.enable = true; 23 | 24 | systemd.services.calibre-web.after = [ "automount-encrypted-usb-device.service" ]; 25 | services.calibre-web = { 26 | enable = true; 27 | user = "nyarla"; 28 | group = "users"; 29 | listen = { 30 | ip = "127.0.0.1"; 31 | port = 40001; 32 | }; 33 | options = { 34 | calibreLibrary = "/persist/data/14887bd8-3e3c-4675-9e81-9027a050cdf7/Calibre"; 35 | }; 36 | }; 37 | 38 | systemd.services.caddy.serviceConfig.ExecStartPre = toString ( 39 | pkgs.writeShellScript "wait.sh" '' 40 | while [[ -z "$(${pkgs.tailscale}/bin/tailscale ip | head -n1)" ]]; do 41 | sleep 1 42 | done 43 | '' 44 | ); 45 | services.caddy = { 46 | enable = true; 47 | virtualHosts = { 48 | # for private web services 49 | "ebooks.p.localhost.thotep.net" = { 50 | listenAddresses = [ "100.103.65.77" ]; 51 | useACMEHost = "localhost.thotep.net"; 52 | logFormat = '' 53 | output stdout 54 | ''; 55 | extraConfig = '' 56 | reverse_proxy 127.0.0.1:40001 57 | ''; 58 | }; 59 | 60 | # for development 61 | "gts.f.localhost.thotep.net" = { 62 | listenAddresses = [ "100.103.65.77" ]; 63 | useACMEHost = "localhost.thotep.net"; 64 | logFormat = '' 65 | output stdout 66 | ''; 67 | extraConfig = '' 68 | reverse_proxy 127.0.0.1:50000 69 | ''; 70 | }; 71 | 72 | "masto.f.localhost.thotep.net" = { 73 | listenAddresses = [ "100.103.65.77" ]; 74 | useACMEHost = "localhost.thotep.net"; 75 | logFormat = '' 76 | output stdout 77 | ''; 78 | extraConfig = '' 79 | handle /api/v1/streaming* { 80 | reverse_proxy 127.0.0.1:50021 81 | } 82 | 83 | handle { 84 | reverse_proxy 127.0.0.1:50020 85 | } 86 | ''; 87 | }; 88 | 89 | "misskey.f.localhost.thotep.net" = { 90 | listenAddresses = [ "100.103.65.77" ]; 91 | useACMEHost = "localhost.thotep.net"; 92 | logFormat = '' 93 | output stdout 94 | ''; 95 | extraConfig = '' 96 | reverse_proxy 127.0.0.1:50030 97 | ''; 98 | }; 99 | }; 100 | }; 101 | } 102 | -------------------------------------------------------------------------------- /system/config/tools/editors.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | { 3 | environment.systemPackages = with pkgs; [ 4 | neovim 5 | nano 6 | ]; 7 | } 8 | -------------------------------------------------------------------------------- /system/config/tools/git.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | { 3 | programs.git = { 4 | enable = true; 5 | package = pkgs.gitFull; 6 | }; 7 | } 8 | -------------------------------------------------------------------------------- /system/config/user/nixos.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | { 3 | users.users.nixos = { 4 | home = "/home/nixos"; 5 | group = "users"; 6 | extraGroups = [ 7 | # sudo 8 | "wheel" 9 | 10 | # terminal 11 | "tty" 12 | 13 | # desktop 14 | "audio" 15 | "lp" 16 | "scanner" 17 | "video" 18 | 19 | # hardware 20 | "disk" 21 | "input" 22 | "networkmanager" 23 | "storage" 24 | 25 | # graphic 26 | "render" 27 | ]; 28 | 29 | description = "NIXOS"; 30 | createHome = true; 31 | isNormalUser = true; 32 | shell = pkgs.zsh; 33 | }; 34 | } 35 | -------------------------------------------------------------------------------- /system/config/user/nyarla.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | { 3 | users.mutableUsers = false; 4 | users.users.nyarla = { 5 | home = "/home/nyarla"; 6 | group = "users"; 7 | extraGroups = [ 8 | # sudo 9 | "wheel" 10 | 11 | # terminal 12 | "tty" 13 | 14 | # desktop 15 | "audio" 16 | "lp" 17 | "scanner" 18 | "video" 19 | 20 | # hardware 21 | "disk" 22 | "i2c" 23 | "input" 24 | "networkmanager" 25 | "storage" 26 | 27 | # graphic 28 | "render" 29 | 30 | # development 31 | "docker" 32 | "plugdev" 33 | 34 | # vmm 35 | "kvm" 36 | "libvirtd" 37 | ]; 38 | 39 | description = "OKAMURA Naoki"; 40 | createHome = true; 41 | isNormalUser = true; 42 | shell = pkgs.zsh; 43 | initialHashedPassword = "$6$lABardu7BNX7a5cv$8TIACJK2U.GBjdsSnFpPHEiwkMtPSCZrxQsphf9uadpu3tBqKfgdZCSW.b2PyJXw16dzgvBysUzknPZ99kxec0"; 44 | }; 45 | 46 | programs.zsh.enable = true; 47 | } 48 | -------------------------------------------------------------------------------- /system/config/video/droidcam.nix: -------------------------------------------------------------------------------- 1 | _: { 2 | boot.kernelParams = [ "v4l2loopback.exclusive_caps=1" ]; 3 | programs.droidcam.enable = true; 4 | } 5 | -------------------------------------------------------------------------------- /system/config/video/intel-with-nvidia.nix: -------------------------------------------------------------------------------- 1 | { pkgs, config, ... }: 2 | let 3 | nvidia = config.boot.kernelPackages.nvidiaPackages.beta; 4 | in 5 | { 6 | boot = { 7 | blacklistedKernelModules = [ 8 | "i2c_nvidia_gpu" 9 | "nouveau" 10 | "nvidia" 11 | "nvidia_uvm" 12 | "nvidia_drm" 13 | "nvidia_modeset" 14 | ]; 15 | initrd.kernelModules = [ "i915" ]; 16 | kernelParams = [ 17 | "i915.enable_guc=3" 18 | ]; 19 | kernelModules = [ 20 | "nvidia_uvm" 21 | "nvidia" 22 | ]; 23 | }; 24 | 25 | hardware = { 26 | i2c.enable = true; 27 | intel-gpu-tools.enable = true; 28 | nvidia = { 29 | modesetting.enable = false; 30 | package = nvidia; 31 | open = false; 32 | nvidiaSettings = true; 33 | nvidiaPersistenced = false; 34 | powerManagement.enable = false; 35 | powerManagement.finegrained = false; 36 | }; 37 | 38 | graphics = { 39 | enable = true; 40 | enable32Bit = true; 41 | extraPackages = with pkgs; [ 42 | intel-media-driver 43 | libvdpau-va-gl 44 | ]; 45 | extraPackages32 = with pkgs.driversi686Linux; [ 46 | intel-media-driver 47 | libvdpau-va-gl 48 | ]; 49 | }; 50 | }; 51 | 52 | environment.variables = { 53 | VDPAU_DRIVER = "va_gl"; 54 | }; 55 | 56 | services.xserver.videoDrivers = [ 57 | "i915" 58 | "nvidia" 59 | ]; 60 | 61 | environment.systemPackages = with pkgs; [ 62 | igsc 63 | (nvtopPackages.full.override { 64 | intel = true; 65 | nvidia = true; 66 | }) 67 | (cuda-shell.override { 68 | nvidia_x11 = nvidia; 69 | cudaPackages = pkgs.cudaPackages_12_8; 70 | }) 71 | ddcui 72 | ddcutil 73 | ]; 74 | 75 | # hardware.nvidia-container-toolkit.enable = true; 76 | services.ollama.acceleration = "cuda"; 77 | } 78 | -------------------------------------------------------------------------------- /system/config/vmm/kvm.nix: -------------------------------------------------------------------------------- 1 | { pkgs, lib, ... }: 2 | let 3 | gpuIds = lib.concatStringsSep "," [ 4 | # RTX 5070 5 | "10de:2f04" 6 | "10de:2f80" 7 | 8 | # RTX 2060 9 | "10de:1e89" 10 | "10de:10f8" 11 | "10de:1ad8" 12 | "10de:1ad9" 13 | ]; 14 | usbId = "1022:149c"; 15 | ids = lib.concatStringsSep "," [ 16 | gpuIds 17 | usbId 18 | ]; 19 | in 20 | { 21 | # libvirt-related packages 22 | programs.virt-manager.enable = true; 23 | environment.systemPackages = with pkgs; [ 24 | looking-glass-client 25 | remmina 26 | spice 27 | spice-gtk 28 | virt-manager 29 | virt-viewer 30 | virtiofsd 31 | ]; 32 | 33 | # vfio kernel settings 34 | boot.kernelParams = [ 35 | "iommu=pt" 36 | "kvm.ignore_msrs=1" 37 | ]; 38 | 39 | boot.extraModprobeConfig = '' 40 | options vfio_pci ids=${ids} 41 | ''; 42 | 43 | # libvirtd configurations 44 | virtualisation.libvirtd = { 45 | enable = true; 46 | hooks.qemu = 47 | let 48 | PATH = lib.makeBinPath ( 49 | with pkgs; 50 | [ 51 | libvirt 52 | kmod 53 | systemd 54 | ] 55 | ); 56 | 57 | loadVFIO = pkgs.writeShellScript "start.sh" '' 58 | set -xeuo pipefail 59 | export PATH=${PATH}:$PATH 60 | 61 | systemctl stop nvidia-kernel-modules 62 | 63 | modprobe -r nvidia_uvm 64 | modprobe -r nvidia 65 | 66 | modprobe vfio_pci 67 | modprobe vfio 68 | modprobe vfio_iommu_type1 69 | 70 | virsh nodedev-detach pci_0000_0b_00_3 71 | virsh nodedev-detach pci_0000_0b_00_2 72 | virsh nodedev-detach pci_0000_0b_00_1 73 | virsh nodedev-detach pci_0000_0b_00_0 74 | 75 | virsh nodedev-detach pci_0000_0d_00_3 76 | 77 | set +x 78 | ''; 79 | 80 | unloadVFIO = pkgs.writeShellScript "stop.sh" '' 81 | set -x 82 | 83 | export PATH=${PATH}:$PATH 84 | 85 | virsh nodedev-reattach pci_0000_0b_00_3 86 | virsh nodedev-reattach pci_0000_0b_00_2 87 | virsh nodedev-reattach pci_0000_0b_00_1 88 | virsh nodedev-reattach pci_0000_0b_00_0 89 | 90 | virsh nodedev-reattach pci_0000_0d_00_3 91 | 92 | modprobe -r vfio_pci 93 | modprobe -r vfio_iommu_type1 94 | modprobe -r vfio 95 | 96 | systemctl start nvidia-kernel-modules 97 | 98 | set +x 99 | ''; 100 | 101 | allocHugePage = pkgs.writeShellScript "alloc.sh" '' 102 | set -xeuo pipefail 103 | 104 | export PATH=${pkgs.gawk}/bin:$PATH 105 | 106 | MEMORY=65536 107 | HUGEPAGES="$(($MEMORY / $(( $(grep Hugepagesize /proc/meminfo | awk '{print $2}') / 1024))))" 108 | 109 | echo $HUGEPAGES > /proc/sys/vm/nr_hugepages 110 | ALLOC_PAGES=$(cat /proc/sys/vm/nr_hugepages) 111 | 112 | TRIES=0 113 | while (( $ALLOC_PAGES != $HUGEPAGES && $TRIES < 100 )) ; do 114 | echo 1 > /proc/sys/vm/compact_memory 115 | 116 | echo $HUGEPAGES > /proc/sys/vm/nr_hugepages 117 | ALLOC_PAGES=$(cat /proc/sys/vm/nr_hugepages) 118 | 119 | let TRIES+=1 120 | done 121 | 122 | if test "$ALLOC_PAGES" -ne "$HUGEPAGES"; then 123 | echo 0 >/proc/sys/vm/nr_hugepages 124 | exit 1 125 | fi 126 | 127 | set +x 128 | exit 0 129 | ''; 130 | 131 | deallocHugePage = pkgs.writeShellScript "dealloc.sh" '' 132 | echo 0 >/proc/sys/vm/nr_hugepages 133 | ''; 134 | 135 | qemuHooks = pkgs.runCommand "qemu-hooks" { } '' 136 | mkdir -p $out/prepare/begin 137 | mkdir -p $out/release/end 138 | 139 | cp ${loadVFIO} $out/prepare/begin/00_load_vfio.sh 140 | cp ${unloadVFIO} $out/release/end/00_unload_vfio.sh 141 | 142 | cp ${allocHugePage} $out/prepare/begin/01_alloc_hugepage.sh 143 | cp ${deallocHugePage} $out/release/end/01_dealloc_hugepage.sh 144 | ''; 145 | in 146 | { 147 | DAW = toString qemuHooks; 148 | Development = toString qemuHooks; 149 | }; 150 | 151 | qemu = { 152 | package = pkgs.qemu_kvm; 153 | runAsRoot = true; 154 | swtpm.enable = true; 155 | ovmf.enable = true; 156 | ovmf.packages = [ pkgs.OVMFFull.fd ]; 157 | 158 | verbatimConfig = '' 159 | user = "root" 160 | group = "libvirtd" 161 | 162 | cgroup_device_acl = [ 163 | "/dev/null", 164 | "/dev/full", 165 | "/dev/zero", 166 | "/dev/random", 167 | "/dev/urandom", 168 | "/dev/ptmx", 169 | "/dev/kvm", 170 | "/dev/dri/card1", 171 | "/dev/dri/renderD128" 172 | ] 173 | ''; 174 | }; 175 | extraConfig = '' 176 | unix_sock_group = "libvirtd" 177 | unix_sock_ro_perms = "0770" 178 | unix_sock_rw_perms = "0770" 179 | auth_unix_ro = "none" 180 | auth_unix_rw = "none" 181 | clear_emulator_capabilities = 0 182 | ''; 183 | 184 | onBoot = "ignore"; 185 | onShutdown = "shutdown"; 186 | }; 187 | 188 | systemd.tmpfiles.rules = 189 | let 190 | qemuScript = 191 | let 192 | script = pkgs.fetchurl { 193 | url = "https://raw.githubusercontent.com/PassthroughPOST/VFIO-Tools/0410193a205c5f150b8dfb411e83f8c42c511a2e/libvirt_hooks/qemu"; 194 | sha256 = "0fphif8r5llflaq5fc7bxswb4xjmjppycnqkjnw8l76ak8yrv2hc"; 195 | }; 196 | in 197 | pkgs.writeShellScript "qemu-hook.sh" '' 198 | ${builtins.readFile (toString script)} 199 | ''; 200 | in 201 | [ 202 | "L+ /var/lib/libvirt/hooks/qemu - - - - ${qemuScript}" 203 | "f /dev/shm/looking-glass 0660 nyarla kvm -" 204 | ]; 205 | 206 | services.samba = { 207 | enable = true; 208 | nmbd.enable = true; 209 | winbindd.enable = true; 210 | settings = { 211 | global = { 212 | "security" = "user"; 213 | "workgroup" = "WORKGROUP"; 214 | "server string" = "nixos"; 215 | "netbios name" = "nixos"; 216 | "use sendfile" = "yes"; 217 | "hosts allow" = "192.168.122.0/24 localhost"; 218 | "hosts deny" = "0.0.0.0/0"; 219 | "guest account" = "nobody"; 220 | "map to guest" = "bad user"; 221 | "acl allow execute always" = "yes"; 222 | }; 223 | 224 | Downloads = { 225 | path = "/persist/home/nyarla/Downloads/KVM"; 226 | browsable = "yes"; 227 | "create mask" = "0774"; 228 | "force create mask" = "0774"; 229 | "directory mask" = "0755"; 230 | "force group" = "users"; 231 | "force user" = "nyarla"; 232 | "guest ok" = "false"; 233 | "read only" = "no"; 234 | }; 235 | 236 | Data = { 237 | path = "/persist/home/nyarla/Documents/DAW"; 238 | "create mask" = "0774"; 239 | "force create mask" = "0774"; 240 | "directory mask" = "0755"; 241 | "force group" = "users"; 242 | "force user" = "nyarla"; 243 | "guest ok" = "false"; 244 | "read only" = "no"; 245 | }; 246 | 247 | Sources = { 248 | path = "/persist/home/nyarla/Sources/DAW"; 249 | browsable = "yes"; 250 | "create mask" = "0774"; 251 | "force create mask" = "0774"; 252 | "directory mask" = "0755"; 253 | "force group" = "users"; 254 | "force user" = "nyarla"; 255 | "guest ok" = "false"; 256 | "read only" = "no"; 257 | }; 258 | }; 259 | }; 260 | } 261 | -------------------------------------------------------------------------------- /system/config/wireless/AX200.nix: -------------------------------------------------------------------------------- 1 | _: { 2 | boot.kernelParams = [ 3 | "iwlwifi.power_save=0" 4 | "iwlmvm.power_scheme=1" 5 | ]; 6 | } 7 | -------------------------------------------------------------------------------- /system/config/wireless/bluetooth.nix: -------------------------------------------------------------------------------- 1 | _: { 2 | services.blueman.enable = true; 3 | 4 | hardware.bluetooth.enable = true; 5 | hardware.bluetooth.powerOnBoot = true; 6 | hardware.bluetooth.settings = { 7 | General = { 8 | Enable = "Source,Sink,Media,Socket"; 9 | }; 10 | }; 11 | } 12 | -------------------------------------------------------------------------------- /system/config/wireless/jp.nix: -------------------------------------------------------------------------------- 1 | _: { 2 | boot.extraModprobeConfig = '' 3 | options cfg80211 ieee80211_regdom=JP 4 | ''; 5 | } 6 | --------------------------------------------------------------------------------