diff options
Diffstat (limited to '.config/nixpkgs')
58 files changed, 1976 insertions, 931 deletions
diff --git a/.config/nixpkgs/config.nix b/.config/nixpkgs/config.nix index d8f9248..a95debd 100644 --- a/.config/nixpkgs/config.nix +++ b/.config/nixpkgs/config.nix @@ -1,17 +1,28 @@ let + pkgs = import <nixpkgs> { }; + + system = builtins.currentSystem; + + previous = import (builtins.fetchTarball { + url = "https://releases.nixos.org/nixos/22.11/nixos-22.11.466.596a8e828c5/nixexprs.tar.xz"; + sha256 = "1367bad5zz0mfm4czb6p0s0ni38f0x1ffh02z76rx4nranipqbgg"; }) { inherit system; }; + stable = import (builtins.fetchTarball { - url = "https://releases.nixos.org/nixos/20.09/nixos-20.09.3346.4d0ee90c6e2/nixexprs.tar.xz"; - sha256 = "1hl3ibkqpk0fihppj85fgiin5r6l9jsqmfjbmcqfyjvykh9fy6ag"; }) {}; + url = "https://releases.nixos.org/nixos/23.11/nixos-23.11.6510.a5e4bbcb4780/nixexprs.tar.xz"; + sha256 = "0f73pbh4j89wgk7rn9xp0q8ybw15zkhw0prjz5r37aaryjs8hnbd"; }) { inherit system; }; unstable = import (builtins.fetchTarball { - url = "https://releases.nixos.org/nixos/unstable/nixos-21.03pre265961.891f607d530/nixexprs.tar.xz"; - sha256 = "1hwwb4n15bbqxnbqffq4kfb369vz65sq74p537fqdp6i4ywpqsyh"; }) {}; + url = "https://releases.nixos.org/nixos/unstable/nixos-24.05pre615148.6143fc5eeb9c/nixexprs.tar.xz"; + sha256 = "0bymwq04dxl3ljjjzw21aspdnwwfm56pqi218lg0vdwargy8yxm8"; }) { inherit system; }; in { + allowBroken = true; allowUnfree = true; + allowUnsupportedSystem = true; + allowInsecurePredicate = pkgs: true; packageOverrides = pkgs: with stable; { @@ -20,9 +31,9 @@ in Woodpecker = pkgs.buildEnv { name = "woodpecker"; paths = [ - Terminal Graphical Xorg Awesome Fonts Audio LaTeX - Android JavaScript Python PHP Lua Elixir Html Shell Haskell - Perl Nix C Golang Rust CSS SQL YAML + Terminal Graphical Xorg Wayland Awesome Fonts Audio LaTeX Dictionary Android + JavaScript Python PHP Lua Elixir HTML Shell Haskell Perl Nix C Golang Rust CSS + SQL YAML HTTP Ruby Nim Themes Emulators Clojure Lisp ]; }; @@ -36,17 +47,22 @@ in Ferret = pkgs.buildEnv { name = "ferret"; - paths = [ Terminal Graphical Fonts Xorg Awesome Audio ]; + paths = [ Terminal Graphical Fonts Xorg Awesome Audio Themes ]; }; Tiger = pkgs.buildEnv { name = "tiger"; - paths = [ Nix Terminal Graphical Fonts Xorg Awesome JavaScript Python ]; + paths = [ Nix Terminal Graphical Fonts Xorg Awesome JavaScript Python Themes ]; }; Hound = pkgs.buildEnv { name = "hound"; - paths = [ Terminal Graphical Fonts Xorg Xfce JavaScript Python ]; + paths = [ Terminal Graphical Fonts Xorg Xfce JavaScript Python Themes ]; + }; + + Ant = pkgs.buildEnv { + name = "ant"; + paths = [ Xorg-Aarch64 Xfce-Aarch64 Terminal-Aarch64 Graphical-Aarch64 Themes Fonts ]; }; # Package Sets @@ -54,21 +70,33 @@ in Terminal = pkgs.buildEnv { name = "terminal"; paths = [ - (callPackage ./packages/chromexup/default.nix {}) - (callPackage ./packages/gmni/default.nix {}) - (callPackage ./packages/literate/default.nix {}) - (callPackage ./packages/systemd2nix/default.nix {}) - (callPackage ./packages/youtube-dl/default.nix {}) - (pass.withExtensions (ext: with ext; [ (callPackage ./packages/pass-import/default.nix {}) pass-audit pass-otp ])) - unstable.amfora - unstable.emacs - unstable.fzf + (callPackage ./packages/chromexup/package.nix { }) + (callPackage ./packages/emacs-batch-indent/package.nix { }) + (callPackage ./packages/pdf2htmlex/package.nix { }) + (callPackage ./packages/systemd2nix/package.nix { }) + (pass.withExtensions (ext: with ext; [ pass-import pass-audit pass-otp ])) unstable.hugo + unstable.piper-tts + unstable.validator-nu + unstable.vimHugeX + unstable.yt-dlp + unstable.ios-webkit-debug-proxy + unstable.libimobiledevice aerc + alacritty alsaUtils + amfora + ansi2html ansible + atftp + atool bat + bind bleachbit + cava + cloc + csvkit + curlftpfs davmail desktop-file-utils diceware @@ -76,21 +104,27 @@ in docker-compose dtrx electrum + emacs encfs entr - exercism + expect + fdupes ffmpeg flashrom fortune + fzf gettext gifsicle git groff + hexedit + hexyl highlight ideviceinstaller imagemagick img2pdf jpegoptim + jq keychain kjv libqalculate @@ -98,38 +132,49 @@ in mdcat mimeo moc + monolith neofetch + netcat-openbsd + nethogs newsboat nnn + nodePackages.mermaid-cli ocrmypdf pandoc - picotts + pdsh + pipes + plantuml pngnq pngquant poppler_utils - powertop - pulsemixer + pssh + quickemu ranger rclone ripgrep rxvt-unicode - sbcl + s-tui + sfeed silver-searcher sshfs subversion surfraw tcl + tesseract tmux + toipe trash-cli units vale - vault - vimHugeX + vcal + ventoy-bin vnstat w3m wavemon weechat + woof xdg-user-dirs + xterm zbar ]; pathsToLink = [ "/etc" "/share" "/bin" ]; @@ -138,88 +183,97 @@ in Graphical = pkgs.buildEnv { name = "graphical"; paths = [ - (callPackage ./packages/beaker-browser/default.nix {}) - (callPackage ./packages/boomer/default.nix {}) - (callPackage ./packages/dmenu/default.nix {}) - (callPackage ./packages/gnaural/default.nix {}) - (callPackage ./packages/ntrviewer/default.nix {}) - unstable.nyxt - unstable.tilp2 + (callPackage ./packages/boomer/package.nix { }) + (callPackage ./packages/dmenu/package.nix { }) + (callPackage ./packages/rofi/package.nix { }) + (callPackage ./packages/sowon/package.nix { }) + (mplayer.override { v4lSupport = true; }) + previous.code-server + previous.qownnotes + previous.recoll + unstable.firefox + unstable.google-chrome unstable.ungoogled-chromium aegisub anki - audacity blender - code-server - copyq + claws-mail + corrscope dconf diffpdf escrotum evince + exiftool feh - firefox flameshot freerdp + fsearch gImageReader + gcolor2 gimp - gnome3.simple-scan - gnome3.zenity - google-chrome + gnaural gparted + gromit-mpx + gst_all_1.gst-plugins-base + gst_all_1.gst-plugins-good + gst_all_1.gstreamer i3lock-fancy + kcharselect keepassxc krop libnotify libreoffice + liferea mate.engrampa meld - mplayer - mupdf + mupdf_1_17 mypaint - palemoon pavucontrol peek - planner - qownnotes qrencode - recoll redshift - rofi scrcpy screenkey - scribus + sent sigil skippy-xd spaceFM + stalonetray sublime3 sxiv syncthing - tabula - thunderbird tigervnc transmission-gtk treesheets - treesheets - unclutter - vimb virt-manager + vlc vscodium xournalpp xsane + yad zathura - zim + zeal + ]; + }; + + Emulators = pkgs.buildEnv { + name = "emulators"; + paths = [ + (callPackage ./packages/ntrviewer/package.nix { }) + (callPackage ./packages/tiemu/package.nix { }) + desmume + mgba ]; - pathsToLink = [ "/share" "/bin" ]; }; Xorg = pkgs.buildEnv { name = "xorg"; paths = [ - (callPackage ./packages/x11vnc/default.nix {}) - (callPackage ./packages/xprintidle/default.nix {}) + autocutsel glxinfo - tdrop + unclutter-xfixes wmctrl + x11vnc xbindkeys xdotool xorg.xauth @@ -239,99 +293,151 @@ in xorg.xrdb xorg.xset xorg.xsetroot + xprintidle xsel xzoom ]; }; - Awesome = pkgs.buildEnv { - name = "awesome"; + Wayland = pkgs.buildEnv { + name = "wayland"; paths = [ - (callPackage ./packages/deepin-gtk-theme/default.nix {}) - awesome - lxappearance + (callPackage ./packages/wf-shell/package.nix { }) + wayfire + weston + wev + wofi ]; - pathsToLink = [ "/share" "/bin" ]; + }; + + Awesome = pkgs.buildEnv { + name = "awesome"; + paths = [ (callPackage ./packages/awesome/package.nix { }) ]; }; Xfce = pkgs.buildEnv { name = "xfce"; paths = [ - plank + bamf deadbeef - zuki-themes + dunst + plank polkit_gnome xfce.exo - xfce.gvfs xfce.garcon - xfce.tumbler - xfce.xfwm4 - xfce.xfwm4-themes + xfce.libxfce4ui + xfce.libxfce4util xfce.thunar xfce.thunar-archive-plugin xfce.thunar-volman - xfce.xfconf - xfce.xfdesktop - xfce.libxfce4ui - xfce.libxfce4util xfce.xfce4-session xfce.xfce4-settings + xfce.xfconf + xfce.xfdesktop + xfce.xfwm4 + xfce.xfwm4-themes + zuki-themes ]; }; Fonts = pkgs.buildEnv { name = "fonts"; paths = [ - (callPackage ./packages/nerdfonts-dejavu-sans-mono/default.nix {}) - etBook - ibm-plex - corefonts + (callPackage ./packages/nerdfonts-dejavu-sans-mono/package.nix { }) cm_unicode cooper-hewitt + corefonts + etBook + fira + fira-code + fira-code-symbols + fira-mono font-awesome_4 - yanone-kaffeesatz + ibm-plex + inter noto-fonts noto-fonts-cjk noto-fonts-emoji - fira - fira-code - fira-mono - fira-code-symbols source-code-pro + source-sans-pro source-serif-pro + yanone-kaffeesatz + ]; + }; + + Themes = pkgs.buildEnv { + name = "themes"; + paths = [ + glib + gnome.dconf-editor + gnome.gnome-themes-extra + gtk-engine-murrine + gtk3.dev + librsvg + lxappearance + papirus-icon-theme + qt5ct + unstable.nwg-look + vanilla-dmz + ]; + }; + + Dictionary = pkgs.buildEnv { + name = "dictionary"; + paths = [ + (aspellWithDicts (dictionary: [ + dictionary.en + dictionary.en-computers + dictionary.en-science + ])) + hunspell + hunspellDicts.en_US-large + hyphen + mythes ]; }; Audio = pkgs.buildEnv { name = "audio"; - paths = [ ardour cadence qjackctl jack2 ]; + paths = [ + (callPackage ./packages/qprompt/package.nix { }) + ardour + pulsemixer + qjackctl + tenacity + ]; }; - LaTeX = pkgs.buildEnv { - name = "latex"; - paths = [ gummi texworks texlive.combined.scheme-full ]; + Design = pkgs.buildEnv { + name = "design"; + paths = [ kicad freecadStable openscad librecad ]; }; Android = pkgs.buildEnv { name = "android"; paths = [ - (callPackage ./packages/edl/default.nix {}) - (callPackage ./packages/mkbootfs/default.nix {}) - (callPackage ./packages/mkbootimg/default.nix {}) + (callPackage ./packages/mkbootfs/package.nix { }) + (callPackage ./packages/mkbootimg/package.nix { }) + edl abootimg ]; }; + LaTeX = pkgs.buildEnv { + name = "latex"; + paths = [ gummi texlive.combined.scheme-full previous.texworks ]; + }; + JavaScript = pkgs.buildEnv { name = "javascript"; paths = [ - nodejs-14_x unstable.deno - nodePackages.bower2nix + unstable.swc + esbuild nodePackages.eslint nodePackages.jsonlint - nodePackages.node2nix nodePackages.prettier + nodejs ]; pathsToLink = [ "/bin" ]; }; @@ -339,64 +445,94 @@ in Python = pkgs.buildEnv { name = "python"; paths = [ - (python38.withPackages (ps: with ps; [ bandit black mypy pyflakes pylint ])) + (python3.withPackages (ps: with ps; [ + bandit + black + flake8 + mypy + pyflakes + pygments + pylint + ])) + ruff ]; }; PHP = pkgs.buildEnv { name = "php"; paths = [ - php74 - php74Packages.psysh - php74Packages.psalm - php74Packages.phpcbf - php74Packages.phpstan - php74Packages.composer + (php.buildEnv { + extensions = ({ enabled, all }: enabled ++ (with all; [ xdebug ])); + extraConfig = '' + xdebug.mode=develop,debug + xdebug.start_with_request=yes + ''; + }) + (callPackage ./packages/phar-composer/package.nix { }) + graphviz + kcachegrind + phpPackages.composer + phpPackages.phpcbf + phpPackages.phpstan + phpPackages.psalm + phpPackages.psysh ]; }; Lua = pkgs.buildEnv { name = "lua"; paths = [ - (callPackage ./packages/luaformatter/default.nix {}) - lua5_3 - lua53Packages.luacheck + (callPackage ./packages/redbean/package.nix { }) + lua + luaPackages.luacheck + luaformatter ]; }; Elixir = pkgs.buildEnv { name = "elixir"; - paths = [ elixir_1_10 ]; + paths = [ elixir ]; }; - Html = pkgs.buildEnv { + HTML = pkgs.buildEnv { name = "html"; paths = [ html-tidy html-xml-utils libxml2 + libxslt xmlstarlet ]; }; Shell = pkgs.buildEnv { name = "shell"; - paths = [ bats dash shellcheck shfmt ]; + paths = [ dash fish bats shellcheck shfmt ]; }; Haskell = pkgs.buildEnv { name = "haskell"; - paths = [ ghc ghcid haskellPackages.hlint haskellPackages.brittany ]; + paths = [ ghc ghcid haskellPackages.hlint previous.haskellPackages.brittany ]; + }; + + Clojure = pkgs.buildEnv { + name = "clojure"; + paths = [ clojure leiningen ]; }; Perl = pkgs.buildEnv { name = "perl"; - paths = [ rakudo perl530 perl530Packages.PerlCritic perl530Packages.PerlTidy ]; + paths = [ rakudo (perl.withPackages (ps: with ps; [ PerlCritic PerlTidy TextLorem LaTeXML ])) ]; }; Nix = pkgs.buildEnv { name = "nix"; - paths = [ nixos-generators nix-index nix-linter nixfmt nixpkgs-fmt nixpkgs-lint ]; + paths = [ nix-index previous.nix-linter nixfmt nixpkgs-fmt nixpkgs-lint ]; + }; + + Ruby = pkgs.buildEnv { + name = "ruby"; + paths = [ rubocop ruby ]; }; C = pkgs.buildEnv { @@ -406,7 +542,7 @@ in Golang = pkgs.buildEnv { name = "golang"; - paths = [ go unstable.gore ]; + paths = [ go gore ]; }; Rust = pkgs.buildEnv { @@ -414,32 +550,143 @@ in paths = [ evcxr rustup ]; }; + Nim = pkgs.buildEnv { + name = "nim"; + paths = [ nim ]; + }; + + Lisp = pkgs.buildEnv { + name = "lisp"; + paths = [ + (pkgs.writeScriptBin "guile" '' + export GUILE_LOAD_PATH="${pkgs.lib.concatStrings [ + "${unstable.guile-gnutls}/share/guile/site/3.0:" + "$GUILE_LOAD_PATH" + ]}" + ${unstable.guile_3_0}/bin/guile "$@" + '') + sbcl + ]; + }; + + HTTP = pkgs.buildEnv { + name = "http"; + paths = [ caddy apacheHttpd httpie ]; + }; + CSS = pkgs.buildEnv { name = "css"; paths = [ - (callPackage ./packages/csstidy/default.nix {}) + (previous.callPackage ./packages/csstidy/package.nix { }) + nodePackages.stylelint csslint + sassc ]; }; SQL = pkgs.buildEnv { name = "sql"; paths = [ - (callPackage ./packages/skeema/default.nix {}) - (callPackage ./packages/sqldef/default.nix {}) - (callPackage ./packages/sqlfluff/default.nix {}) - dbeaver pgformatter + skeema + sqlfluff sqlint sqlite + sqlitebrowser + unstable.sqldef ]; }; YAML = pkgs.buildEnv { name = "yaml"; paths = [ - (callPackage ./packages/ruamel.yaml.cmd/default.nix {}) - python38Packages.yamllint + (previous.callPackage ./packages/yaml2nix/package.nix { }) + (callPackage ./packages/ruamel.yaml.cmd/package.nix { }) + python39Packages.yamllint + yj + ]; + }; + + Xorg-Aarch64 = pkgs.buildEnv { + name = "xorg-aarch64"; + paths = [ + glxinfo + unclutter-xfixes + wmctrl + x11vnc + xbindkeys + xdotool + xorg.xauth + xorg.xev + xorg.xf86inputevdev + xorg.xf86inputlibinput + xorg.xf86videofbdev + xorg.xinit + xorg.xinput + xorg.xmodmap + xorg.xorgserver + xorg.xrandr + xorg.xrdb + xorg.xset + xorg.xsetroot + xprintidle + xsel + xzoom + ]; + }; + + Xfce-Aarch64 = pkgs.buildEnv { + name = "xfce-aarch64"; + paths = [ + bamf + dunst + polkit_gnome + xfce.exo + xfce.garcon + xfce.libxfce4ui + xfce.libxfce4util + xfce.thunar + xfce.thunar-archive-plugin + xfce.thunar-volman + xfce.xfce4-session + xfce.xfce4-settings + xfce.xfconf + xfce.xfdesktop + xfce.xfwm4 + xfce.xfwm4-themes + zuki-themes + ]; + }; + + Graphical-Aarch64 = pkgs.buildEnv { + name = "graphical-aarch64"; + paths = [ + unstable.firefox + unstable.ungoogled-chromium + audacity + freerdp + fsearch + galculator + gpicview + pavucontrol + pcmanfm + sylpheed + xsane + ]; + }; + + Terminal-Aarch64 = pkgs.buildEnv { + name = "terminal-aarch64"; + paths = [ + unstable.vimHugeX + alsaUtils + fzf + libnotify + redshift + rofi + rxvt-unicode + skippy-xd + tigervnc ]; }; }; diff --git a/.config/nixpkgs/packages/awesome/package.nix b/.config/nixpkgs/packages/awesome/package.nix new file mode 100644 index 0000000..6bf06ee --- /dev/null +++ b/.config/nixpkgs/packages/awesome/package.nix @@ -0,0 +1,98 @@ +{ lib, stdenv, fetchgit, lua, cairo, librsvg, cmake, imagemagick, pkg-config +, gdk-pixbuf, xorg, libstartup_notification, libxdg_basedir, libpthreadstubs +, xcb-util-cursor, makeWrapper, pango, gobject-introspection, which, dbus +, nettools, git, doxygen, xmlto, docbook_xml_dtd_45, docbook_xsl +, findXMLCatalogs, libxkbcommon, xcbutilxrm, hicolor-icon-theme, asciidoctor +, gtk3, makeFontsConf, ghostscript }: + +let luaEnv = lua.withPackages (ps: [ ps.lgi ps.ldoc ]); + +in stdenv.mkDerivation rec { + pname = "awesome"; + version = "d2dc428e567e378a3f534c4d748543413fc30172"; + + src = fetchgit { + rev = version; + url = "https://github.com/awesomeWM/awesome.git"; + sha256 = "sha256-gViEIuDn9ygzVof8e5e7cqDVPNeKDzlXK8V8oYzUUgA="; + }; + + nativeBuildInputs = [ + asciidoctor + cmake + docbook_xml_dtd_45 + docbook_xsl + doxygen + findXMLCatalogs + imagemagick + makeWrapper + pkg-config + xmlto + ]; + + outputs = [ "out" "doc" ]; + + FONTCONFIG_FILE = makeFontsConf { + fontDirectories = [ "${ghostscript}/share/ghostscript/fonts" ]; + }; + + propagatedUserEnvPkgs = [ hicolor-icon-theme ]; + + buildInputs = [ + cairo + dbus + gdk-pixbuf + git + gobject-introspection + gtk3 + libpthreadstubs + librsvg + libstartup_notification + libxdg_basedir + libxkbcommon + lua + luaEnv + nettools + pango + xcb-util-cursor + xcbutilxrm + xorg.libXau + xorg.libXdmcp + xorg.libxcb + xorg.libxshmfence + xorg.xcbutil + xorg.xcbutilimage + xorg.xcbutilkeysyms + xorg.xcbutilrenderutil + xorg.xcbutilwm + ]; + + cmakeFlags = [ "-DOVERRIDE_VERSION=${version}" ] + ++ lib.optional lua.pkgs.isLuaJIT + "-DLUA_LIBRARY=${lua}/lib/libluajit-5.1.so"; + + GI_TYPELIB_PATH = "${pango.out}/lib/girepository-1.0"; + LUA_CPATH = "${luaEnv}/lib/lua/${lua.luaversion}/?.so"; + LUA_PATH = "${luaEnv}/share/lua/${lua.luaversion}/?.lua;;"; + + postInstall = '' + mv "$out/bin/awesome" "$out/bin/.awesome-wrapped" + makeWrapper "$out/bin/.awesome-wrapped" "$out/bin/awesome" \ + --set GDK_PIXBUF_MODULE_FILE "$GDK_PIXBUF_MODULE_FILE" \ + --add-flags '--search ${luaEnv}/lib/lua/${lua.luaversion}' \ + --add-flags '--search ${luaEnv}/share/lua/${lua.luaversion}' \ + --prefix GI_TYPELIB_PATH : "$GI_TYPELIB_PATH" + + wrapProgram $out/bin/awesome-client \ + --prefix PATH : "${which}/bin" + ''; + + passthru = { inherit lua; }; + + meta = with lib; { + license = licenses.gpl2Plus; + platforms = platforms.linux; + homepage = "https://awesomewm.org/"; + description = "Highly configurable, dynamic window manager for X"; + }; +} diff --git a/.config/nixpkgs/packages/beaker-browser/default.nix b/.config/nixpkgs/packages/beaker-browser/default.nix deleted file mode 100644 index a827a87..0000000 --- a/.config/nixpkgs/packages/beaker-browser/default.nix +++ /dev/null @@ -1,18 +0,0 @@ -{ stdenv, fetchurl, appimageTools }: - -let version = "1.1.0"; in - -appimageTools.wrapType2 { - name = "beaker-browser"; - - src = fetchurl { - url = "https://github.com/beakerbrowser/beaker/releases/download/${version}/Beaker.Browser-${version}.AppImage"; - sha256 = "07hcyr6vyim8vrvw120v5jjfvy5jkcaqc3wgqgyf6prbqdx71dkp"; - }; - - meta = with stdenv.lib; { - homepage = "https://beakerbrowser.com"; - license = licenses.mit; - description = "An experimental peer-to-peer Web browser"; - }; -} diff --git a/.config/nixpkgs/packages/boomer/default.nix b/.config/nixpkgs/packages/boomer/package.nix index 417aa22..885de27 100644 --- a/.config/nixpkgs/packages/boomer/default.nix +++ b/.config/nixpkgs/packages/boomer/package.nix @@ -1,17 +1,15 @@ -{ stdenv, fetchFromGitHub, makeWrapper, nim, libX11, libXrandr, libGL }: +{ lib, stdenv, fetchgit, makeWrapper, nim, libX11, libXrandr, libGL }: let - x11-nim = fetchFromGitHub { - repo = "x11"; - owner = "nim-lang"; + x11-nim = fetchgit { + url = "https://github.com/nim-lang/x11"; rev = "b7bae7dffa4e3f12370d5a18209359422ae8bedd"; sha256 = "1j3kyp0vf2jl20c67gcm759jnfskdf0wc4ajrdbvfxias285c5sb"; }; - opengl-nim = fetchFromGitHub { - repo = "opengl"; - owner = "nim-lang"; + opengl-nim = fetchgit { + url = "https://github.com/nim-lang/opengl"; rev = "a6fb649e5bd94d8420d4a11287092a4dc3e922b4"; sha256 = "0w62lfrdms2vb24kd4jnypwmqvdk5x9my1dinnqdq82yl4nz6d0s"; }; @@ -19,12 +17,12 @@ let in stdenv.mkDerivation rec { pname = "boomer"; - version = "d16c65ce3eae31f4c77de1585b340d8d624c1252"; - src = fetchFromGitHub { - owner = "tsoding"; - repo = "boomer"; + version = "cc0f5311193da8361ee782a421d6bc4ad8541cf3"; + + src = fetchgit { + url = "https://github.com/tsoding/boomer"; rev = version; - sha256 = "1kqfg2i5p1zrvl9jx0ig7f0ckxnaxi9svr0bs52aavwydldnnl8d"; + sha256 = "sha256-3yg0nuJE0Rrw13VEQ/CjjjPN5G4ytssgiesdXwlHaF8="; }; buildInputs = [ nim libX11 libXrandr libGL makeWrapper ]; @@ -44,14 +42,12 @@ in stdenv.mkDerivation rec { fixupPhase = '' runHook preFixup - patchelf --set-rpath ${ - stdenv.lib.makeLibraryPath [ stdenv.cc.cc libX11 libXrandr libGL ] - } $out/bin/boomer + patchelf --set-rpath ${lib.makeLibraryPath [ stdenv.cc.cc libX11 libXrandr libGL ]} $out/bin/boomer wrapProgram "$out/bin/boomer" --set LIBGL_ALWAYS_SOFTWARE 1 runHook postFixup ''; - meta = with stdenv.lib; { + meta = with lib; { license = licenses.mit; platforms = platforms.linux; homepage = "https://github.com/tsoding/boomer"; diff --git a/.config/nixpkgs/packages/chromexup/default.nix b/.config/nixpkgs/packages/chromexup/package.nix index 78d974b..c6c4622 100644 --- a/.config/nixpkgs/packages/chromexup/default.nix +++ b/.config/nixpkgs/packages/chromexup/package.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchgit, python38 }: +{ lib, fetchgit, python38 }: with python38.pkgs; @@ -20,7 +20,7 @@ buildPythonApplication rec { cp -rT scripts/systemd $out ''; - meta = with stdenv.lib; { + meta = with lib; { license = licenses.mit; inherit (src.meta) homepage; platforms = platforms.linux; diff --git a/.config/nixpkgs/packages/csstidy/default.nix b/.config/nixpkgs/packages/csstidy/package.nix index 7e9a8d0..5ccf7ff 100644 --- a/.config/nixpkgs/packages/csstidy/default.nix +++ b/.config/nixpkgs/packages/csstidy/package.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchgit, sconsPackages, gcc }: +{ lib, stdenv, fetchgit, sconsPackages, gcc }: stdenv.mkDerivation rec { @@ -14,15 +14,17 @@ stdenv.mkDerivation rec { buildInputs = [ sconsPackages.scons_3_0_1 ]; preBuild = '' - sed -i "/env = Environment()/a env.Replace(CXX='${gcc}/bin/g++')" SConstruct + sed --in-place "/env = Environment()/a env.Replace(CXX='${gcc}/bin/g++')" SConstruct ''; installPhase = '' - mkdir -p $out/bin + runHook preInstall + mkdir --parents $out/bin cp release/csstidy/csstidy $out/bin + runHook postInstall ''; - meta = with stdenv.lib; { + meta = with lib; { license = licenses.lgpl21; inherit (src.meta) homepage; platforms = platforms.linux; diff --git a/.config/nixpkgs/packages/deepin-gtk-theme/default.nix b/.config/nixpkgs/packages/deepin-gtk-theme/default.nix deleted file mode 100644 index bdddc28..0000000 --- a/.config/nixpkgs/packages/deepin-gtk-theme/default.nix +++ /dev/null @@ -1,25 +0,0 @@ -{ stdenv, fetchFromGitHub, gtk-engine-murrine }: - -stdenv.mkDerivation rec { - name = "deepin-gtk-theme-${version}"; - version = "17.10.5"; - - src = fetchFromGitHub { - owner = "linuxdeepin"; - repo = "deepin-gtk-theme"; - rev = version; - sha256 = "0ff1yg4gz4p7nd0qg3dcbsiw8yqlvqccm55kxi998w8j1wrg6pq3"; - }; - - propagatedUserEnvPkgs = [ gtk-engine-murrine ]; - - makeFlags = [ "PREFIX=$(out)" ]; - - meta = { - description = "Deepin GTK Theme"; - homepage = https://github.com/linuxdeepin/deepin-gtk-theme; - license = stdenv.lib.licenses.lgpl3; - platforms = stdenv.lib.platforms.unix; - maintainers = [ stdenv.lib.maintainers.romildo ]; - }; -} diff --git a/.config/nixpkgs/packages/dmenu/default.nix b/.config/nixpkgs/packages/dmenu/default.nix deleted file mode 100644 index 2ac9664..0000000 --- a/.config/nixpkgs/packages/dmenu/default.nix +++ /dev/null @@ -1,44 +0,0 @@ -{ stdenv, fetchurl, libX11, libXinerama, libXft, zlib, fetchpatch }: - -stdenv.mkDerivation rec { - name = "dmenu-4.9"; - - src = fetchurl { - url = "https://dl.suckless.org/tools/${name}.tar.gz"; - sha256 = "0ia9nqr83bv6x247q30bal0v42chcj9qcjgv59xs6xj46m7iz5xk"; - }; - - buildInputs = [ libX11 libXinerama zlib libXft ]; - - patches = [ - (fetchpatch { - name = "dmenu-xresources-4.9.patch"; - url = "https://tools.suckless.org/dmenu/patches/xresources/dmenu-xresources-4.9.diff"; - sha256 = "0clczp17zwkxy1qhy0inqjplxpq4mgaf4vvfvn063hk733r4i7rn"; - }) - (fetchpatch { - name = "xim.patch"; - url = "https://raw.githubusercontent.com/NixOS/nixpkgs/1f16d0496ce86d4c903e2e4ed6cbe4e952a7196f/pkgs/applications/misc/dmenu/xim.patch"; - sha256 = "006np7hlhr11wmj9652fcvacrw1fnv4w8hdlm80pyn0vn1wjdkw6"; - }) - ]; - - postPatch = '' - sed -ri -e 's!\<(dmenu|dmenu_path|stest)\>!'"$out/bin"'/&!g' dmenu_run - sed -ri -e 's!\<stest\>!'"$out/bin"'/&!g' dmenu_path - ''; - - preConfigure = '' - sed -i "s@PREFIX = /usr/local@PREFIX = $out@g" config.mk - ''; - - makeFlags = [ "CC:=$(CC)" ]; - - meta = with stdenv.lib; { - license = licenses.mit; - platforms = platforms.all; - homepage = "https://tools.suckless.org/dmenu"; - maintainers = with maintainers; [ pSub globin ]; - description = "A generic, highly customizable, and efficient menu for the X Window System"; - }; -} diff --git a/.config/nixpkgs/packages/dmenu/package.nix b/.config/nixpkgs/packages/dmenu/package.nix new file mode 100644 index 0000000..f0f933c --- /dev/null +++ b/.config/nixpkgs/packages/dmenu/package.nix @@ -0,0 +1,32 @@ +{ lib, stdenv, fetchgit, libX11, libXinerama, libXft, zlib }: + +stdenv.mkDerivation rec { + name = "dmenu"; + version = "9b0be7712e2aae65b459f758a080c56983056021"; + + src = fetchgit { + rev = version; + url = "https://www.thedroneely.com/git/thedroneely/dmenu/"; + sha256 = "0sbwwxbm5bcn0m4s1y2gl90wc224kf6755d1xdr23bz5ihy3jzg2"; + }; + + buildInputs = [ libX11 libXinerama zlib libXft ]; + + postPatch = '' + sed -ri -e 's!\<(dmenu|dmenu_path|stest)\>!'"$out/bin"'/&!g' dmenu_run + sed -ri -e 's!\<stest\>!'"$out/bin"'/&!g' dmenu_path + ''; + + preConfigure = '' + sed -i "s@PREFIX = /usr/local@PREFIX = $out@g" config.mk + ''; + + makeFlags = [ "CC:=$(CC)" ]; + + meta = { + license = lib.licenses.mit; + platforms = lib.platforms.all; + homepage = "https://tools.suckless.org/dmenu"; + description = "A generic, highly customizable, and efficient menu for the X Window System"; + }; +} diff --git a/.config/nixpkgs/packages/edl/default.nix b/.config/nixpkgs/packages/edl/default.nix deleted file mode 100644 index 1830afa..0000000 --- a/.config/nixpkgs/packages/edl/default.nix +++ /dev/null @@ -1,43 +0,0 @@ -{ stdenv, fetchgit, python38 }: - -python38.pkgs.buildPythonApplication rec { - - pname = "edl"; - url = "https://github.com/bkerler/edl.git"; - version = "6ca9feb8ac7b260a0395d4f51e9e91fc0feda058"; - - src = fetchgit { - inherit url; - rev = version; - sha256 = "1lpgamg6wkwpj3mxcn8nrxxw90svx5xy3kahk8rdf09ph6wlii4x"; - }; - - doCheck = false; - dontBuild = true; - - propagatedBuildInputs = with python38.pkgs; [ - pyusb - pyserial - docopt - pycryptodome - qrcode - ]; - - pythonEnv = python38.withPackages (ps: with ps; propagatedBuildInputs); - - installPhase = '' - mkdir -p $out/share/edl - cp -rT ${src} $out/share/edl - makeWrapper ${pythonEnv}/bin/python $out/bin/edl --add-flags $out/share/edl/edl.py - makeWrapper ${pythonEnv}/bin/python $out/bin/edl-diag --add-flags $out/share/edl/diag.py - makeWrapper ${pythonEnv}/bin/python $out/bin/edl-tcpclient --add-flags $out/share/edl/tcpclient.py - makeWrapper ${pythonEnv}/bin/python $out/bin/edl-fhloaderparse --add-flags $out/share/edl/fhloaderparse.py - ''; - - meta = with stdenv.lib; { - homepage = url; - license = licenses.mit; - platforms = platforms.linux; - description = "QC Firehose / Sahara Client / QC Diag Tools :)"; - }; -} diff --git a/.config/nixpkgs/packages/emacs-batch-indent/package.nix b/.config/nixpkgs/packages/emacs-batch-indent/package.nix new file mode 100644 index 0000000..92042af --- /dev/null +++ b/.config/nixpkgs/packages/emacs-batch-indent/package.nix @@ -0,0 +1,30 @@ +{ lib, stdenv, fetchgit }: + +stdenv.mkDerivation rec { + + name = "emacs-batch-indent"; + version = "145e8771b9709a82e3df82cdc06c6d9505de905d"; + url = "https://github.com/cwfoo/emacs-batch-indent"; + + src = fetchgit { + inherit url; + rev = version; + sha256 = "sha256-Qqg/ZLbfTZnH2aO7ZW2XiiVBqEvK2+LMo2Kz6HSnOCE="; + }; + + phases = [ "unpackPhase" "installPhase" ]; + + installPhase = '' + runHook preInstall + mkdir --parents $out/bin + cp emacs-batch-indent $out/bin + runHook postInstall + ''; + + meta = with lib; { + homepage = url; + license = licenses.gpl3; + platforms = platforms.linux; + description = "Indent Common Lisp, Emacs Lisp, and Scheme from the command line using Emacs."; + }; +} diff --git a/.config/nixpkgs/packages/gmni/default.nix b/.config/nixpkgs/packages/gmni/default.nix deleted file mode 100644 index 573c9df..0000000 --- a/.config/nixpkgs/packages/gmni/default.nix +++ /dev/null @@ -1,21 +0,0 @@ -{ stdenv, fetchgit, pkg-config, openssl }: - -stdenv.mkDerivation rec { - pname = "gmni"; - version = "f5d540bc5d0112895376aebe6bf54adb32545d6e"; - url = "https://git.sr.ht/~sircmpwn/gmni"; - - src = fetchgit { - inherit url; - rev = version; - sha256 = "0x4bg7mffq7vj9f3dj3s0m7q6f18nrysl68x6dlzk74hj6wsslbc"; - }; - - buildInputs = [ pkg-config openssl ]; - - meta = with stdenv.lib; { - homepage = url; - license = licenses.gpl3; - description = "A Gemini client"; - }; -} diff --git a/.config/nixpkgs/packages/gnaural/default.nix b/.config/nixpkgs/packages/gnaural/default.nix deleted file mode 100644 index 4324736..0000000 --- a/.config/nixpkgs/packages/gnaural/default.nix +++ /dev/null @@ -1,29 +0,0 @@ -{ stdenv, fetchurl, portaudio, libsndfile, pkg-config, gtk2, gcc48 }: - -stdenv.mkDerivation rec { - - pname = "gnaural"; - version = "20110606"; - - src = fetchurl { - url = "https://iweb.dl.sourceforge.net/project/gnaural/Gnaural/gnaural_${version}.tar.xz"; - sha256 = "1gq519c0imsh57zklyi0f8h64l3ai48lh672c834470z8c6kvbfi"; - }; - - patches = [ - (fetchurl { - name = "gnaural.patch"; - url = "https://aur.archlinux.org/cgit/aur.git/plain/gnaural.patch?h=gnaural"; - sha256 = "15bplxcvjml8cz7pi2fwb444fpp7ypsh279642v8s9hgl3i3jvsz"; - }) - ]; - - buildInputs = [ gcc48 portaudio pkg-config gtk2 libsndfile ]; - - meta = with stdenv.lib; { - license = licenses.gpl2; - platforms = platforms.linux; - homepage = "http://gnaural.sourceforge.net/"; - description = "Auditory binaural-beat generator"; - }; -} diff --git a/.config/nixpkgs/packages/literate/default.nix b/.config/nixpkgs/packages/literate/default.nix deleted file mode 100644 index f5be32e..0000000 --- a/.config/nixpkgs/packages/literate/default.nix +++ /dev/null @@ -1,23 +0,0 @@ -{ stdenv, fetchgit, dmd, dub }: - -stdenv.mkDerivation rec { - name = "Literate"; - version = "7004dffec0cff3068828514eca72172274fd3f7d"; - - src = fetchgit { - rev = version; - url = "https://github.com/zyedidia/Literate.git"; - sha256 = "0x4xgrdskybaa7ssv81grmwyc1k167v3nwj320jvp5l59xxlbcvs"; - }; - - buildInputs = [ dmd dub ]; - - installPhase = "install -D bin/lit $out/bin/lit"; - - meta = with stdenv.lib; { - description = "A literate programming tool for any language"; - homepage = "http://literate.zbyedidia.webfactional.com/"; - license = licenses.mit; - platforms = platforms.unix; - }; -} diff --git a/.config/nixpkgs/packages/luaformatter/default.nix b/.config/nixpkgs/packages/luaformatter/default.nix deleted file mode 100644 index 88bbc9f..0000000 --- a/.config/nixpkgs/packages/luaformatter/default.nix +++ /dev/null @@ -1,23 +0,0 @@ -{ stdenv, fetchFromGitHub, cmake }: - -stdenv.mkDerivation rec { - pname = "LuaFormatter"; - version = "1.3.3"; - - src = fetchFromGitHub { - sha256 = "1dfqsh6v8brnwzg3lgi7228lw08qqfy4ghbjyvwn7mr82fy1xcnd"; - rev = version; - repo = pname; - owner = "Koihik"; - fetchSubmodules = true; - }; - - buildInputs = [ cmake ]; - - meta = with stdenv.lib; { - inherit (src.meta) homepage; - description = "Code formatter for Lua"; - license = licenses.asl20; - platforms = platforms.linux; - }; -} diff --git a/.config/nixpkgs/packages/mkbootfs/default.nix b/.config/nixpkgs/packages/mkbootfs/package.nix index 379bb8c..b8c6050 100644 --- a/.config/nixpkgs/packages/mkbootfs/default.nix +++ b/.config/nixpkgs/packages/mkbootfs/package.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchgit }: +{ lib, stdenv, fetchgit }: stdenv.mkDerivation rec { @@ -17,7 +17,7 @@ stdenv.mkDerivation rec { cp mkbootfs $out/bin ''; - meta = with stdenv.lib; { + meta = with lib; { homepage = url; platforms = platforms.linux; license = licenses.unlicense; diff --git a/.config/nixpkgs/packages/mkbootimg/default.nix b/.config/nixpkgs/packages/mkbootimg/package.nix index 40be21d..738fd33 100644 --- a/.config/nixpkgs/packages/mkbootimg/default.nix +++ b/.config/nixpkgs/packages/mkbootimg/package.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchgit }: +{ lib, stdenv, fetchgit }: stdenv.mkDerivation rec { @@ -18,7 +18,7 @@ stdenv.mkDerivation rec { cp unpackbootimg $out/bin ''; - meta = with stdenv.lib; { + meta = with lib; { homepage = url; platforms = platforms.linux; license = licenses.unlicense; diff --git a/.config/nixpkgs/packages/nerdfonts-dejavu-sans-mono/default.nix b/.config/nixpkgs/packages/nerdfonts-dejavu-sans-mono/package.nix index 18d3b15..866a6af 100644 --- a/.config/nixpkgs/packages/nerdfonts-dejavu-sans-mono/default.nix +++ b/.config/nixpkgs/packages/nerdfonts-dejavu-sans-mono/package.nix @@ -1,10 +1,9 @@ -{ stdenv, fetchurl, unzip }: +{ lib, stdenv, fetchurl, unzip }: stdenv.mkDerivation rec { pname = "nerdfonts-dejavu-sans-mono"; version = "2.1.0"; - buildInputs = [ unzip ]; src = fetchurl { @@ -13,23 +12,18 @@ stdenv.mkDerivation rec { }; phases = [ "unpackPhase" "installPhase" ]; - unpackPhase = '' unzip ${src} ''; installPhase = '' - mkdir -p $out/share/fonts/nerdfonts-dejavu-sans-mono - cp -r * $out/share/fonts/nerdfonts-dejavu-sans-mono + runHook preInstall + mkdir --parents $out/share/fonts/nerdfonts-dejavu-sans-mono + cp --recursive * $out/share/fonts/nerdfonts-dejavu-sans-mono + runHook postInstall ''; - meta = with stdenv.lib; { - description = '' - Nerd Fonts is a project that attempts to patch as many developer targeted - and/or used fonts as possible. The patch is to specifically add a high - number of additional glyphs from popular 'iconic fonts' such as Font - Awesome, Devicons, Octicons, and others. - ''; - homepage = "https://github.com/ryanoasis/nerd-fonts"; + meta = with lib; { license = licenses.mit; platforms = platforms.all; + homepage = "https://github.com/ryanoasis/nerd-fonts"; }; } diff --git a/.config/nixpkgs/packages/nixpkgs.lib/package.nix b/.config/nixpkgs/packages/nixpkgs.lib/package.nix new file mode 100644 index 0000000..6f5c4e8 --- /dev/null +++ b/.config/nixpkgs/packages/nixpkgs.lib/package.nix @@ -0,0 +1,59 @@ +{ lib, stdenv, fetchgit, writeTextFile }: + +stdenv.mkDerivation rec { + + pname = "nixpkgs.lib"; + version = "f9d58ee370835f4c658cd0a62e8def4bda8b1f32"; + + src = fetchgit { + url = "https://github.com/nix-community/nixpkgs.lib.git"; + sha256 = "sha256-KnumcE6UuNQPapsr32KjcRVDVuRGWB5PnAczHoo9nJc="; + rev = version; + }; + + installPhase = '' + runHook preInstall + mkdir --parents $out + cp --recursive --no-target-directory $src $out + runHook postInstall + ''; + + patches = [ + (writeTextFile { + name = "remove-nonexistent-external-calls.patch"; + text = '' + --- a/lib/default.nix + +++ b/lib/default.nix + @@ -24,8 +24,8 @@ let + # packaging + customisation = callLibs ./customisation.nix; + derivations = callLibs ./derivations.nix; + - maintainers = import ../maintainers/maintainer-list.nix; + - teams = callLibs ../maintainers/team-list.nix; + + maintainers = { }; + + teams = { }; + meta = callLibs ./meta.nix; + sources = callLibs ./sources.nix; + versions = callLibs ./versions.nix; + diff --git a/lib/trivial.nix b/lib/trivial.nix + index 5d4fad8..d679563 100644 + --- a/lib/trivial.nix + +++ b/lib/trivial.nix + @@ -164,7 +164,7 @@ rec { + version = release + versionSuffix; + + /* Returns the current nixpkgs release number as string. */ + - release = lib.strings.fileContents ../.version; + + release = ""; + + /* The latest release that is supported, at the time of release branch-off, + if applicable. + ''; + }) + ]; + + meta = with lib; { + description = "nixpkgs lib for cheap instantiation "; + homepage = "https://github.com/nix-community/nixpkgs.lib"; + }; +} diff --git a/.config/nixpkgs/packages/ntrviewer/default.nix b/.config/nixpkgs/packages/ntrviewer/package.nix index 6a754bf..af155bf 100644 --- a/.config/nixpkgs/packages/ntrviewer/default.nix +++ b/.config/nixpkgs/packages/ntrviewer/package.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchFromGitHub, fetchpatch, libjpeg, ffmpeg, SDL }: +{ lib, stdenv, fetchFromGitHub, fetchpatch, libjpeg, ffmpeg, SDL }: stdenv.mkDerivation rec { pname = "ntrviewer"; @@ -16,7 +16,7 @@ stdenv.mkDerivation rec { patches = [ (fetchpatch { name = "ntrviewer.patch"; - url = "https://aur.archlinux.org/cgit/aur.git/plain/ntrviewer.patch?h=ntrviewer-git"; + url = "https://aur.archlinux.org/cgit/aur.git/plain/ntrviewer.patch?h=ntrviewer-git&id=7ae6776d6db1476ee9df8cac7a933167a1bc3d25"; sha256 = "0lw1zmm4fdjb09iqsw593pdv4p36q77zq5lb2qh0xqcaf2ll84z5"; }) ]; @@ -30,7 +30,7 @@ stdenv.mkDerivation rec { runHook postInstall ''; - meta = with stdenv.lib; { + meta = with lib; { license = licenses.gpl3; inherit (src.meta) homepage; platforms = platforms.linux; diff --git a/.config/nixpkgs/packages/pass-import/default.nix b/.config/nixpkgs/packages/pass-import/default.nix deleted file mode 100644 index 78dded4..0000000 --- a/.config/nixpkgs/packages/pass-import/default.nix +++ /dev/null @@ -1,61 +0,0 @@ -{ stdenv, pass, fetchFromGitHub, python38, makeWrapper, fetchpatch }: - -with python38.pkgs; - -let - - pythonEnv = pythonPackages.python.withPackages (_: [ - defusedxml - setuptools - pyaml - pykeepass - filemagic - cryptography - secretstorage - ]); - -in stdenv.mkDerivation rec { - pname = "pass-import"; - version = "a8f56cc6a85362ed20f46c1360c87fdd213b890c"; - - src = fetchFromGitHub { - owner = "roddhjav"; - repo = "pass-import"; - rev = version; - sha256 = "0hg40fqnss9n31ns8lc8v1h9hjdw4qjg68xs0hm6c9njabahl1pq"; - }; - - dontBuild = true; - buildInputs = [ pythonEnv ]; - nativeBuildInputs = [ makeWrapper ]; - - patches = [ - # https://github.com/roddhjav/pass-import/pull/91 - (fetchpatch { - url = "https://github.com/roddhjav/pass-import/commit/6ccaf639e92df45bd400503757ae4aa2c5c030d7.patch"; - sha256 = "0lw9vqvbqcy96s7v7nz0i1bdx93x7qr13azymqypcdhjwmq9i63h"; - }) - ]; - - postPatch = '' - sed -i -e 's|$0|${pass}/bin/pass|' import.bash - ''; - - installFlags = [ "PREFIX=$(out)" "BASHCOMPDIR=$(out)/etc/bash_completion.d" ]; - - postFixup = '' - install -D pass_import.py $out/${pythonPackages.python.sitePackages}/pass_import.py - wrapProgram $out/lib/password-store/extensions/import.bash \ - --prefix PATH : "${pythonEnv}/bin" \ - --prefix PYTHONPATH : "$out/${pythonPackages.python.sitePackages}" \ - --run "export PREFIX" - ''; - - meta = with stdenv.lib; { - description = "Pass extension for importing data from existing password managers"; - homepage = "https://github.com/roddhjav/pass-import"; - license = licenses.gpl3Plus; - maintainers = with maintainers; [ lovek323 the-kenny fpletz tadfisher ]; - platforms = platforms.unix; - }; -} diff --git a/.config/nixpkgs/packages/pdf2htmlex/package.nix b/.config/nixpkgs/packages/pdf2htmlex/package.nix new file mode 100644 index 0000000..82021ef --- /dev/null +++ b/.config/nixpkgs/packages/pdf2htmlex/package.nix @@ -0,0 +1,17 @@ +{ lib, fetchurl, appimageTools }: + +appimageTools.wrapType2 rec { + name = "pdf2htmlex"; + version = "0.18.8.rc1"; + + src = fetchurl { + url = "https://github.com/pdf2htmlEX/pdf2htmlEX/releases/download/v${version}/pdf2htmlEX-${version}-master-20200630-Ubuntu-focal-x86_64.AppImage"; + sha256 = "sha256-Ed4lg6Orzl8UH9f6+x/qLGexWIblRta3Z1xgABLmq4w="; + }; + + meta = with lib; { + license = licenses.gpl3; + platforms = platforms.linux; + description = "Convert PDF to HTML without losing text or format. "; + }; +} diff --git a/.config/nixpkgs/packages/phar-composer/package.nix b/.config/nixpkgs/packages/phar-composer/package.nix new file mode 100644 index 0000000..79ee71b --- /dev/null +++ b/.config/nixpkgs/packages/phar-composer/package.nix @@ -0,0 +1,29 @@ +{ stdenv, fetchurl, makeWrapper, lib, php }: + +stdenv.mkDerivation rec { + + pname = "phar-composer"; + version = "1.4.0"; + + src = fetchurl { + url = "https://github.com/clue/${pname}/releases/download/v${version}/${pname}-${version}.phar"; + sha256 = "sha256-GUKo/l8b0UkQpGHsyagjgtAkZbfmjdhWOXkZT5vLB8A="; + }; + + dontUnpack = true; + nativeBuildInputs = [ makeWrapper ]; + + installPhase = '' + runHook preInstall + mkdir --parents $out/bin + install -D $src $out/libexec/${pname}/${pname}.phar + makeWrapper ${php}/bin/php $out/bin/${pname} --add-flags "$out/libexec/${pname}/${pname}.phar" + runHook postInstall + ''; + + meta = { + license = lib.licenses.mit; + homepage = "https://github.com/clue/phar-composer#readme"; + description = "Simple phar creation for every PHP project managed via Composer."; + }; +} diff --git a/.config/nixpkgs/packages/qprompt/package.nix b/.config/nixpkgs/packages/qprompt/package.nix new file mode 100644 index 0000000..67a4c83 --- /dev/null +++ b/.config/nixpkgs/packages/qprompt/package.nix @@ -0,0 +1,30 @@ +{ lib, stdenv, fetchgit, cmake, extra-cmake-modules, qt5, libsForQt5 }: + +stdenv.mkDerivation rec { + name = "qprompt"; + version = "v1.1.2"; + + src = fetchgit { + rev = version; + url = "https://github.com/Cuperino/QPrompt.git"; + sha256 = "sha256-EeLJC77X9lcjvbr+TkIpMHO0YFdI91tiVUplde3wEzA="; + }; + + buildInputs = [ + cmake + extra-cmake-modules + qt5.wrapQtAppsHook + qt5.qtquickcontrols2.dev + qt5.qtx11extras.dev + libsForQt5.ki18n.dev + libsForQt5.kcoreaddons.dev + libsForQt5.kiconthemes.dev + libsForQt5.kirigami2.dev + ]; + + meta = { + license = with lib.licenses; [ gpl3 cc-by-sa-40 ]; + homepage = "https://github.com/Cuperino/QPrompt#qprompt"; + description = "Personal teleprompter software for all video creators."; + }; +} diff --git a/.config/nixpkgs/packages/redbean/package.nix b/.config/nixpkgs/packages/redbean/package.nix new file mode 100644 index 0000000..7ede4c6 --- /dev/null +++ b/.config/nixpkgs/packages/redbean/package.nix @@ -0,0 +1,29 @@ +{ lib, stdenv, fetchurl }: + +stdenv.mkDerivation rec { + + pname = "redbean"; + version = "2.0.1"; + + src = fetchurl { + url = "https://redbean.dev/redbean-${version}.com"; + sha256 = "sha256-W5GpecQdDwawkrkmENxSqCz40PkyrLh34FtiUwD7Kzk="; + }; + + dontFixup = true; + dontUnpack = true; + + installPhase = '' + runHook preInstall + mkdir --parents $out/bin + cp ${src} $out/bin/${pname}.com + chmod +x $out/bin/${pname}.com + runHook postInstall + ''; + + meta = with lib; { + license = licenses.isc; + platforms = platforms.all; + homepage = "https://github.com/jart/cosmopolitan"; + }; +} diff --git a/.config/nixpkgs/packages/rofi/package.nix b/.config/nixpkgs/packages/rofi/package.nix new file mode 100644 index 0000000..420d2d2 --- /dev/null +++ b/.config/nixpkgs/packages/rofi/package.nix @@ -0,0 +1,49 @@ +{ stdenv, lib, fetchgit, autoreconfHook, pkg-config, libxkbcommon, pango +, which, git, cairo, libxcb, xcbutil, xcbutilwm, xcbutilxrm, xcb-util-cursor +, libstartup_notification, bison, flex, librsvg, check }: + +stdenv.mkDerivation rec { + pname = "rofi-unwrapped"; + version = "1.7.0"; + + src = fetchgit { + rev = version; + fetchSubmodules = true; + url = "https://github.com/davatorium/rofi.git"; + sha256 = "03wdy56b3g8p2czb0qydrddyyhj3x037pirnhyqr5qbfczb9a63v"; + }; + + preConfigure = '' + patchShebangs "script" + # root not present in build /etc/passwd + sed -i 's/~root/~nobody/g' test/helper-expand.c + ''; + + nativeBuildInputs = [ autoreconfHook pkg-config ]; + buildInputs = [ + libxkbcommon + pango + cairo + git + bison + flex + librsvg + check + libstartup_notification + libxcb + xcbutil + xcbutilwm + xcbutilxrm + xcb-util-cursor + which + ]; + + doCheck = false; + + meta = with lib; { + license = licenses.mit; + platforms = with platforms; linux; + homepage = "https://github.com/davatorium/rofi"; + description = "Window switcher, run dialog and dmenu replacement"; + }; +} diff --git a/.config/nixpkgs/packages/ruamel.yaml.cmd/default.nix b/.config/nixpkgs/packages/ruamel.yaml.cmd/default.nix deleted file mode 100644 index f2dc6f9..0000000 --- a/.config/nixpkgs/packages/ruamel.yaml.cmd/default.nix +++ /dev/null @@ -1,69 +0,0 @@ -{ stdenv, python38 }: - -with python38.pkgs; - -let - - meta = with stdenv.lib; { - license = licenses.mit; - description = "Command line utility to manipulate YAML files"; - homepage = "https://sourceforge.net/p/ruamel-yaml-cmd/code/ci/default/tree"; - }; - - ruamel.std.argparse = buildPythonPackage rec { - pname = "ruamel.std.argparse"; - version = "0.8.3"; - src = fetchPypi { - inherit pname version; - sha256 = "0srv4g6jryyaz26csx315pbmfhm4rw8jhfsl7rq7krrglgqwjryi"; - }; - doCheck = false; - inherit meta; - }; - - ruamel.std.convert = buildPythonPackage rec { - pname = "ruamel.yaml.convert"; - version = "0.3.2"; - src = fetchPypi { - inherit pname version; - sha256 = "1i6919b5f5ygj7y7c4x0wi91n8y0mw4nf9f0bcfjk29i594xjph6"; - }; - propagatedBuildInputs = [ python-dateutil ruamel_yaml ]; - doCheck = false; - inherit meta; - }; - - ruamel.yaml.cmd = buildPythonPackage rec { - pname = "ruamel.yaml.cmd"; - version = "0.5.6"; - src = fetchPypi { - inherit pname version; - sha256 = "0zc2h6b721r8c05dm7y8zgrgbvifbgcm8jmqvns7ar4ajll3cvwv"; - }; - propagatedBuildInputs = [ configobj ruamel.std.argparse ruamel.std.convert ]; - patches = [ ./disable-backup-files.patch ]; - doCheck = false; - dontWrapPythonPrograms = true; - inherit meta; - }; - -in buildPythonApplication rec { - - pname = ruamel.yaml.cmd.pname; - version = ruamel.yaml.cmd.version; - propagatedBuildInputs = [ ruamel.yaml.cmd ]; - pythonEnvironment = python38.withPackages (_: propagatedBuildInputs); - - installPhase = '' - runHook preInstall - mkdir -p $out/bin - cp ${ruamel.yaml.cmd}/bin/yaml $out/bin - sed -i 's|^#!.*$|#!${pythonEnvironment}/bin/python3.8|' $out/bin/yaml - runHook postInstall - ''; - - dontUnpack = true; - dontBuild = true; - doCheck = false; - inherit meta; -} diff --git a/.config/nixpkgs/packages/ruamel.yaml.cmd/disable-backup-files.patch b/.config/nixpkgs/packages/ruamel.yaml.cmd/disable-backup-files.patch deleted file mode 100644 index b56e616..0000000 --- a/.config/nixpkgs/packages/ruamel.yaml.cmd/disable-backup-files.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/yaml_cmd.py 2020-12-14 22:13:19.000000000 -0500 -+++ b/yaml_cmd.py 2020-12-14 22:13:34.067115865 -0500 -@@ -513,8 +513,6 @@ - def round_trip_save(self, file_name): - inp = open(file_name).read() - backup_file_name = file_name + '.orig' -- if not os.path.exists(backup_file_name): -- os.rename(file_name, backup_file_name) - return self.round_trip_single(inp, out_file=file_name) - - def round_trip_input(self, inp): diff --git a/.config/nixpkgs/packages/ruamel.yaml.cmd/package.nix b/.config/nixpkgs/packages/ruamel.yaml.cmd/package.nix new file mode 100644 index 0000000..362b4bd --- /dev/null +++ b/.config/nixpkgs/packages/ruamel.yaml.cmd/package.nix @@ -0,0 +1,85 @@ +{ lib, pkgs, python39 }: + +let + + meta = with lib; { + license = licenses.mit; + description = "Command line utility to manipulate YAML files"; + homepage = "https://sourceforge.net/p/ruamel-yaml-cmd/code/ci/default/tree"; + }; + + ruamel.std.argparse = python39.pkgs.buildPythonPackage rec { + pname = "ruamel.std.argparse"; + version = "0.8.3"; + src = python39.pkgs.fetchPypi { + inherit pname version; + sha256 = "0srv4g6jryyaz26csx315pbmfhm4rw8jhfsl7rq7krrglgqwjryi"; + }; + doCheck = false; + inherit meta; + }; + + ruamel.std.convert = python39.pkgs.buildPythonPackage rec { + pname = "ruamel.yaml.convert"; + version = "0.3.2"; + src = python39.pkgs.fetchPypi { + inherit pname version; + sha256 = "1i6919b5f5ygj7y7c4x0wi91n8y0mw4nf9f0bcfjk29i594xjph6"; + }; + propagatedBuildInputs = [ python39.pkgs.python-dateutil python39.pkgs.ruamel_yaml ]; + doCheck = false; + inherit meta; + }; + + ruamel.yaml.cmd = python39.pkgs.buildPythonPackage rec { + pname = "ruamel.yaml.cmd"; + version = "0.5.7"; + src = python39.pkgs.fetchPypi { + inherit pname version; + sha256 = "0w6ralskvjhswqsgxyqm5wpn0an7kj3v2mzf46ipp7b8xirjrc6r"; + }; + propagatedBuildInputs = [ python39.pkgs.configobj ruamel.std.argparse ruamel.std.convert ]; + patches = [ + (pkgs.writeTextFile { + name = "disable-backup-files.patch"; + text = '' + --- a/yaml_cmd.py 2020-12-14 22:13:19.000000000 -0500 + +++ b/yaml_cmd.py 2020-12-14 22:13:34.067115865 -0500 + @@ -513,8 +513,6 @@ + def round_trip_save(self, file_name): + inp = open(file_name).read() + backup_file_name = file_name + '.orig' + - if not os.path.exists(backup_file_name): + - os.rename(file_name, backup_file_name) + return self.round_trip_single(inp, out_file=file_name) + + def round_trip_input(self, inp): + ''; + }) + ]; + doCheck = false; + dontWrapPythonPrograms = true; + inherit meta; + }; + +in python39.pkgs.buildPythonApplication rec { + + pname = ruamel.yaml.cmd.pname; + version = ruamel.yaml.cmd.version; + propagatedBuildInputs = [ ruamel.yaml.cmd ]; + pythonEnvironment = python39.withPackages (_: propagatedBuildInputs); + + installPhase = '' + runHook preInstall + mkdir --parents $out/bin + cp ${ruamel.yaml.cmd}/bin/yaml $out/bin + sed --in-place 's|^#!.*$|#!${pythonEnvironment}/bin/python|' $out/bin/yaml + runHook postInstall + ''; + + dontUnpack = true; + dontBuild = true; + doCheck = false; + format = "other"; + inherit meta; +} diff --git a/.config/nixpkgs/packages/skeema/default.nix b/.config/nixpkgs/packages/skeema/default.nix deleted file mode 100644 index 4017f75..0000000 --- a/.config/nixpkgs/packages/skeema/default.nix +++ /dev/null @@ -1,23 +0,0 @@ -{ stdenv, fetchgit, buildGoModule }: - -buildGoModule rec { - pname = "skeema"; - version = "v1.5.0"; - url = "https://github.com/skeema/skeema"; - - src = fetchgit { - inherit url; - rev = version; - sha256 = "0mrspmgiww0jlpml24r5f4ail8153f2liva88w9760fd5aky3ix3"; - }; - - vendorSha256 = null; - - doCheck = false; - - meta = with stdenv.lib; { - homepage = url; - license = licenses.asl20; - description = "Schema management CLI for MySQL"; - }; -} diff --git a/.config/nixpkgs/packages/sowon/package.nix b/.config/nixpkgs/packages/sowon/package.nix new file mode 100644 index 0000000..38d06b0 --- /dev/null +++ b/.config/nixpkgs/packages/sowon/package.nix @@ -0,0 +1,30 @@ +{ lib, stdenv, fetchgit, SDL2, pkg-config }: + +stdenv.mkDerivation rec { + pname = "sowon"; + version = "85dbbd06e7f20fe0a727fcb34e5206c23894ff83"; + url = "https://github.com/tsoding/sowon.git"; + + src = fetchgit { + inherit url; + rev = version; + sha256 = "06gc1qsn5j902861qfbrixpjdmxyngrhvp312zz82k9gqjsacwyi"; + }; + + buildInputs = [ SDL2 ]; + nativeBuildInputs = [ pkg-config ]; + + installPhase = '' + runHook preInstall + mkdir --parents $out/bin + cp ${pname} $out/bin + runHook postInstall + ''; + + meta = with lib; { + homepage = url; + inherit version; + license = licenses.mit; + description = "Starting Soon Timer for Tsoding Streams"; + }; +} diff --git a/.config/nixpkgs/packages/sqldef/default.nix b/.config/nixpkgs/packages/sqldef/default.nix deleted file mode 100644 index 6829f00..0000000 --- a/.config/nixpkgs/packages/sqldef/default.nix +++ /dev/null @@ -1,23 +0,0 @@ -{ stdenv, fetchgit, buildGoModule }: - -buildGoModule rec { - pname = "sqldef"; - version = "v0.8.9"; - url = "https://github.com/k0kubun/sqldef"; - - src = fetchgit { - inherit url; - rev = version; - sha256 = "1hvx05qwy2g4r1zc1k2f9xv4z815p5jh1a6g41fdlxskjl3kyyf5"; - }; - - vendorSha256 = "066184zmwdhd8dbkbmwds8aimiawfcvb8px8z1q48c949gvywlx7"; - - doCheck = false; - - meta = with stdenv.lib; { - homepage = url; - license = licenses.mit; - description = "Idempotent MySQL/PostgreSQL schema management by SQL"; - }; -} diff --git a/.config/nixpkgs/packages/sqlfluff/default.nix b/.config/nixpkgs/packages/sqlfluff/default.nix deleted file mode 100644 index 0030d31..0000000 --- a/.config/nixpkgs/packages/sqlfluff/default.nix +++ /dev/null @@ -1,58 +0,0 @@ -{ stdenv, fetchgit, python36 }: - -with python36.pkgs; - -let - - bench-it = buildPythonPackage rec { - pname = "bench-it"; - version = "1.0.1"; - src = fetchPypi { - inherit pname version; - sha256 = "0v6kfvgdnjlfmwlafmyjadgllfr8qc1hq83kz9q287gh5nvw851f"; - }; - postPatch = '' - # Avoid building pypandoc - sed -i 's|^import pypandoc.*||' setup.py - sed -i 's|^description = pypandoc.*|description = ""|' setup.py - ''; - doCheck = false; - }; - -in buildPythonApplication rec { - - pname = "sqlfluff"; - url = "https://github.com/sqlfluff/sqlfluff"; - version = "0.4.1"; - - src = fetchgit { - inherit url; - rev = version; - sha256 = "0g53rhdg8b2p3xx9rmkc2fkqnz4fsrmkg98n5fi10s16wscn90kz"; - }; - - propagatedBuildInputs = [ - appdirs - bench-it - cached-property - click - colorama - configparser - dataclasses - diff_cover - jinja2 - oyaml - pathspec - pluggy - typing-extensions - ]; - - doCheck = false; - - meta = with stdenv.lib; { - homepage = url; - license = licenses.mit; - platforms = platforms.linux; - description = "A SQL linter and auto-formatter for Humans"; - }; -} diff --git a/.config/nixpkgs/packages/systemd2nix/default.nix b/.config/nixpkgs/packages/systemd2nix/package.nix index 9d78393..b4c6103 100644 --- a/.config/nixpkgs/packages/systemd2nix/default.nix +++ b/.config/nixpkgs/packages/systemd2nix/package.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchgit, python38 }: +{ lib, fetchgit, python38 }: python38.pkgs.buildPythonApplication rec { @@ -14,14 +14,17 @@ python38.pkgs.buildPythonApplication rec { doCheck = false; dontBuild = true; + format = "other"; installPhase = '' - mkdir -p $out/bin $out/share/${pname} + runHook preInstall + mkdir --parents $out/bin $out/share/${pname} cp ${src}/${pname}.py $out/share/${pname} makeWrapper ${python38}/bin/python $out/bin/${pname} --add-flags $out/share/${pname}/${pname}.py + runHook postInstall ''; - meta = with stdenv.lib; { + meta = with lib; { homepage = url; license = licenses.mit; platforms = platforms.linux; diff --git a/.config/nixpkgs/packages/tiemu/package.nix b/.config/nixpkgs/packages/tiemu/package.nix new file mode 100644 index 0000000..f703981 --- /dev/null +++ b/.config/nixpkgs/packages/tiemu/package.nix @@ -0,0 +1,45 @@ +{ lib, stdenv, fetchurl, fetchpatch, pkg-config, libticalcs2, libticables2 +, libtifiles2, libticonv, gnome2, gtk2, SDL, glib }: + +stdenv.mkDerivation rec { + name = "tiemu"; + version = "3.03"; + src = fetchurl { + url = "http://download.sourceforge.net/project/gtktiemu/tiemu-linux/TIEmu%20${version}/tiemu-${version}-nogdb.tar.gz"; + sha256 = "14m5p1ani7pz23z77h2hibl38sz0i5dpywdhkbr8v2i788487llj"; + }; + + hardeningDisable = [ "format" ]; + preConfigure = ''configureFlags="--without-kde --disable-gdb"''; + + buildInputs = [ + pkg-config + libticables2 + libticalcs2 + libtifiles2 + glib + libticonv + gtk2 + gnome2.libglade + SDL + ]; + + patches = [ + (fetchpatch { + name = "01-build-fix.patch"; + sha256 = "0p4qns6w1hfs3ci6pqpidd2ikjgvpvyd7bnsfj9cx06chwc9sysl"; + url = "https://aur.archlinux.org/cgit/aur.git/plain/01-build-fix.patch?h=tiemu"; + }) + (fetchpatch { + name = "sysdeps.patch"; + sha256 = "1j6gns3vhykizxyb09670a65lafa1xd8wjyl45kvmysv250089z5"; + url = "https://aur.archlinux.org/cgit/aur.git/plain/sysdeps.patch?h=tiemu"; + }) + ]; + + meta = with lib; { + license = licenses.gpl2; + platforms = platforms.linux; + homepage = "http://lpg.ticalc.org/prj_tiemu/"; + }; +} diff --git a/.config/nixpkgs/packages/wf-shell/package.nix b/.config/nixpkgs/packages/wf-shell/package.nix new file mode 100644 index 0000000..42e4121 --- /dev/null +++ b/.config/nixpkgs/packages/wf-shell/package.nix @@ -0,0 +1,32 @@ +{ stdenv, lib, fetchgit, meson, ninja, pkg-config, wayland, alsa-lib, gtkmm3 +, gtk-layer-shell, pulseaudio, wayfire, wf-config, libdbusmenu-gtk3 }: + +stdenv.mkDerivation rec { + pname = "wf-shell"; + version = "9a9af00dc02780357466e27c5e77e316469e7a37"; + + src = fetchgit { + url = "https://github.com/WayfireWM/wf-shell"; + sha256 = "sha256-qkfN6JfAp5UaHXNuU6Jwu87YNCyjEJzVLLy8EUG5UNE"; + }; + + mesonFlags = [ "--sysconfdir" "/etc" ]; + nativeBuildInputs = [ meson ninja pkg-config wayland ]; + + buildInputs = [ + alsa-lib + gtk-layer-shell + gtkmm3 + libdbusmenu-gtk3 + pulseaudio + wayfire + wf-config + ]; + + meta = with lib; { + homepage = "https://github.com/WayfireWM/wf-shell"; + description = "GTK3-based panel for Wayfire"; + license = licenses.mit; + platforms = platforms.unix; + }; +} diff --git a/.config/nixpkgs/packages/x11vnc/default.nix b/.config/nixpkgs/packages/x11vnc/default.nix deleted file mode 100644 index 0507e45..0000000 --- a/.config/nixpkgs/packages/x11vnc/default.nix +++ /dev/null @@ -1,44 +0,0 @@ -{ lib, stdenv, fetchgit, openssl, zlib, libjpeg, xorg -, libvncserver, autoreconfHook, pkg-config }: - -stdenv.mkDerivation rec { - pname = "x11vnc"; - version = "f07df92816ef10b7382a542125955df7f4156a5c"; - - src = fetchgit { - url = "https://github.com/LibVNC/x11vnc"; - rev = version; - sha256 = "1vgkgcqz6fxjgdzqpnw05lg30hdczrfgyzj39z1ips9vcjpb6v8s"; - }; - - nativeBuildInputs = [ autoreconfHook pkg-config ]; - - buildInputs = [ - xorg.libXfixes - xorg.xorgproto - openssl - xorg.libXdamage - zlib - xorg.libX11 - libjpeg - xorg.libXtst - xorg.libXinerama - xorg.libXrandr - xorg.libXext - xorg.libXi - xorg.libXrender - libvncserver - ]; - - preConfigure = '' - configureFlags="--mandir=$out/share/man" - ''; - - meta = with lib; { - description = "A VNC server connected to a real X11 screen"; - homepage = "https://github.com/LibVNC/x11vnc/"; - platforms = platforms.linux; - license = licenses.gpl2; - maintainers = with maintainers; [ OPNA2608 ]; - }; -} diff --git a/.config/nixpkgs/packages/xprintidle/default.nix b/.config/nixpkgs/packages/xprintidle/default.nix deleted file mode 100644 index 975b464..0000000 --- a/.config/nixpkgs/packages/xprintidle/default.nix +++ /dev/null @@ -1,27 +0,0 @@ -{ stdenv, fetchFromGitHub, libX11, libXScrnSaver, libXext, meson, pkg-config -, ninja }: - -stdenv.mkDerivation rec { - pname = "xprintidle"; - version = "0.2.4"; - - src = fetchFromGitHub { - owner = "g0hl1n"; - repo = pname; - rev = version; - sha256 = "10na3ymzfhpq800wsyd23m57ngz69nn5i10c7p9iya8hzi7cf20a"; - }; - - nativeBuildInputs = [ meson pkg-config ninja ]; - - buildInputs = [ libX11 libXScrnSaver libXext ]; - - meta = { - inherit version; - description = "A command-line tool to print idle time from libXss"; - homepage = "https://github.com/g0hl1n/xprintidle"; - license = stdenv.lib.licenses.gpl2; - maintainers = [ stdenv.lib.maintainers.raskin ]; - platforms = stdenv.lib.platforms.linux; - }; -} diff --git a/.config/nixpkgs/packages/yaml2nix/package.nix b/.config/nixpkgs/packages/yaml2nix/package.nix new file mode 100644 index 0000000..af4ae38 --- /dev/null +++ b/.config/nixpkgs/packages/yaml2nix/package.nix @@ -0,0 +1,20 @@ +{ lib, rustPlatform, fetchgit }: + +rustPlatform.buildRustPackage rec { + pname = "yaml2nix"; + version = "b220acf4299376ee1b4131ca4c4248ebf0337d79"; + + src = fetchgit { + rev = version; + url = "https://github.com/euank/yaml2nix.git"; + sha256 = "1i7s18chpqckq16ljy9sh81zvambqkh4hvcyap6xi4yzp2h82198"; + }; + + cargoSha256 = "0bnkznzmyi7iyv4rlkfj8ikkx1ajfhvwd3rrmhrlbx6hbv554fkh"; + + meta = with lib; { + homepage = url; + license = licenses.gpl3; + description = "A command line tool to convert yaml into a nix expression."; + }; +} diff --git a/.config/nixpkgs/packages/youtube-dl/default.nix b/.config/nixpkgs/packages/youtube-dl/default.nix deleted file mode 100644 index 3dc4a27..0000000 --- a/.config/nixpkgs/packages/youtube-dl/default.nix +++ /dev/null @@ -1,56 +0,0 @@ -{ python38Packages, lib, fetchurl, zip, ffmpeg, rtmpdump, phantomjs2 -, atomicparsley, pandoc, generateManPage ? true, ffmpegSupport ? true -, rtmpSupport ? true, phantomjsSupport ? false, hlsEncryptedSupport ? true -, installShellFiles, makeWrapper }: - -python38Packages.buildPythonPackage rec { - - pname = "youtube-dl"; - version = "2020.12.05"; - - src = fetchurl { - url = "https://yt-dl.org/downloads/${version}/${pname}-${version}.tar.gz"; - sha256 = "065s45l8qz7wlkaxw9bj20gq9647zpwdj9vc6chhqjscl63z1aqm"; - }; - - nativeBuildInputs = [ installShellFiles makeWrapper ]; - buildInputs = [ zip ] ++ lib.optional generateManPage pandoc; - propagatedBuildInputs = - lib.optional hlsEncryptedSupport python38Packages.pycryptodome; - - makeWrapperArgs = let - packagesToBinPath = [ atomicparsley ] ++ lib.optional ffmpegSupport ffmpeg - ++ lib.optional rtmpSupport rtmpdump - ++ lib.optional phantomjsSupport phantomjs2; - in [ ''--prefix PATH : "${lib.makeBinPath packagesToBinPath}"'' ]; - - setupPyBuildFlags = [ "build_lazy_extractors" ]; - - postInstall = '' - installShellCompletion youtube-dl.zsh - ''; - - doCheck = false; - - meta = with lib; { - homepage = "https://ytdl-org.github.io/youtube-dl/"; - description = - "Command-line tool to download videos from YouTube.com and other sites"; - longDescription = '' - youtube-dl is a small, Python-based command-line program - to download videos from YouTube.com and a few more sites. - youtube-dl is released to the public domain, which means - you can modify it, redistribute it or use it however you like. - ''; - license = licenses.publicDomain; - platforms = with platforms; linux ++ darwin; - maintainers = with maintainers; [ - bluescreen303 - phreedom - AndersonTorres - fpletz - enzime - ma27 - ]; - }; -} diff --git a/.config/nixpkgs/shells/ansible.nix b/.config/nixpkgs/shells/ansible.nix deleted file mode 100644 index 5da5e38..0000000 --- a/.config/nixpkgs/shells/ansible.nix +++ /dev/null @@ -1,20 +0,0 @@ -with import <nixpkgs> { }; - -let project = "${builtins.getEnv "HOME"}/Shares/Projects/infrastructure/ansible"; - -in mkShell rec { - name = "ansible-mitogen"; - buildInputs = [ python38.pkgs.pip ansible_2_9 ]; - shellHook = '' - export virtualenvs=$HOME/.local/share/virtualenvs - mkdir -p $virtualenvs - python -m venv $virtualenvs/ansible-mitogen - . $virtualenvs/ansible-mitogen/bin/activate - python -m pip install mitogen==0.2.9 - export ANSIBLE_STRATEGY_PLUGINS=$virtualenvs/ansible-mitogen/lib/python3.8/site-packages/ansible_mitogen/plugins - export ANSIBLE_STRATEGY=mitogen_linear - export PS1='\h (${name}) \W \$ ' - cd '${project}' || exit 1 - ssh -T git@github.com - ''; -} diff --git a/.config/nixpkgs/shells/ansible/shell.nix b/.config/nixpkgs/shells/ansible/shell.nix new file mode 100644 index 0000000..96eb244 --- /dev/null +++ b/.config/nixpkgs/shells/ansible/shell.nix @@ -0,0 +1,29 @@ +let + + # nix-shell -E 'import (builtins.fetchurl "$url")' + + name = "nix-shell.ansible"; + + pkgs = import (builtins.fetchTarball { + url = "https://releases.nixos.org/nixos/21.11/nixos-21.11.336020.2128d0aa28e/nixexprs.tar.xz"; + sha256 = "0w8plbxms0di6gnh0k2yhj0pgxzxas7g5x0m01zjzixf16i2bapj"; + }) { }; + + project = "${builtins.getEnv "HOME"}/Shares/Projects/infrastructure/ansible"; + + python = pkgs.python39.withPackages (ps: with ps; [ mitogen ]); + +in pkgs.mkShell { + + inherit name; + + buildInputs = [ python pkgs.ansible_2_10 ]; + + shellHook = '' + export ANSIBLE_STRATEGY_PLUGINS=${python}/lib/*/site-packages/ansible_mitogen/plugins + export ANSIBLE_STRATEGY=mitogen_linear + export PS1='\h (${name}) \W \$ ' + cd '${project}' || exit 1 + ssh -T git@github.com + ''; +} diff --git a/.config/nixpkgs/shells/bubblewrap/shell.nix b/.config/nixpkgs/shells/bubblewrap/shell.nix new file mode 100644 index 0000000..aee8a8b --- /dev/null +++ b/.config/nixpkgs/shells/bubblewrap/shell.nix @@ -0,0 +1,36 @@ +let + + # nix-shell -E 'import (builtins.fetchurl "$url")' + # https://github.com/containers/bubblewrap/blob/main/demos/bubblewrap-shell.sh + # https://manpages.debian.org/testing/bubblewrap/bwrap.1.en.html + + name = "nix-shell.bubblewrap"; + + pkgs = import (builtins.fetchTarball { + url = "https://releases.nixos.org/nixos/22.11/nixos-22.11.466.596a8e828c5/nixexprs.tar.xz"; + sha256 = "1367bad5zz0mfm4czb6p0s0ni38f0x1ffh02z76rx4nranipqbgg"; + }) { }; + + bubblewrap = arguments@{ ... }: pkgs.writeShellApplication { + inherit name; + text = '' + PATH=${pkgs.lib.strings.makeBinPath [ pkgs.bubblewrap ]} + bwrap \ + '' + pkgs.lib.strings.concatStringsSep " \\\n" + (pkgs.lib.attrsets.mapAttrsToList (argument: value: "--${argument} ${value} ") + arguments) + "/bin/sh\n"; + }; + + jail = bubblewrap { + clearenv = ""; + setenv = "PATH ${pkgs.lib.strings.makeBinPath [ pkgs.busybox ]}"; + ro-bind = "/nix /nix" + " --ro-bind /bin /bin"; + }; + +in pkgs.mkShell { + inherit name; + shellHook = '' + printf '%s\n' "${jail}/bin/${jail.name}" + exec "${jail}/bin/${jail.name}" + ''; +} diff --git a/.config/nixpkgs/shells/cake/shell.nix b/.config/nixpkgs/shells/cake/shell.nix new file mode 100644 index 0000000..2991136 --- /dev/null +++ b/.config/nixpkgs/shells/cake/shell.nix @@ -0,0 +1,212 @@ +let + + # nix-shell -E 'import (builtins.fetchurl "$url")' + # NIX_CONFIG="sandbox = relaxed" nix-shell --option builders '' shell.nix + + name = "nix-shell.cake"; + + pkgs = import (builtins.fetchTarball { + url = "https://releases.nixos.org/nixos/23.11/nixos-23.11.6510.a5e4bbcb4780/nixexprs.tar.xz"; + sha256 = "0f73pbh4j89wgk7rn9xp0q8ybw15zkhw0prjz5r37aaryjs8hnbd"; + }) { }; + + alpine = pkgs.fetchurl { + url = "https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/x86_64/alpine-minirootfs-3.19.1-x86_64.tar.gz"; + sha256 = "sha256-GFEjzrbn0I8kSf/1VD2yBv+3nezYFGCNOZrUR+CPop4="; + }; + + cook = { name, src, contents ? [ ], path ? [ ], script ? "", prepare ? "", cleanup ? "" }: pkgs.stdenvNoCC.mkDerivation { + __noChroot = true; + inherit name src contents; + phases = [ "installPhase" ]; + buildInputs = [ pkgs.proot pkgs.rsync pkgs.tree pkgs.kmod ]; + bootstrap = pkgs.writeScript "bootstrap-${name}" '' + ${script} + rm "$0" + ''; + PROOT_NO_SECCOMP = "1"; + installPhase = '' + set -euo pipefail + mkdir --parents rootfs $out/rootfs + tar --extract --file=${src} -C rootfs + + ${prepare} + + cp $bootstrap rootfs/bootstrap + proot --cwd=/ --root-id --rootfs=rootfs /usr/bin/env - /bin/sh -euc 'BASH_VERSION= . /etc/profile && /bootstrap' + printf 'PATH=${pkgs.lib.strings.makeBinPath path}:$PATH' >> rootfs/etc/profile + + [ -n "$contents" ] && { + printf "\n" + for paths in $contents; do + printf "Cooking... Adding %s \n" "$paths" + rsync --copy-dirlinks --relative --archive --chown=0:0 "$paths/" "rootfs" || exit 1 + done + printf "\n" + } || printf '\n%s\n' 'No contents to cook.'; + + ${cleanup} + + printf '\n%s\n\n' "$(du --all --max-depth 1 --human-readable rootfs | sort --human-numeric-sort)" + cp --recursive --no-target-directory rootfs $out/rootfs + ''; + }; + + bake = { name, image, size ? "1G", debug ? false, kernel ? pkgs.linux, options ? [ ], modules ? [ ], uuid ? "99999999-9999-9999-9999-999999999999" }: let + initrd = cook { + name = "initrd-${name}"; + src = alpine; + script = '' + rm -rf home opt media root run srv tmp var + printf '#!/bin/sh -eu + mount -t devtmpfs none /dev + mount -t proc none /proc + mount -t sysfs none /sys + sh /lib/modules/initrd/init + ${pkgs.lib.optionalString (debug) "sh +m"} + mount -r "$(findfs UUID=${uuid})" /mnt + mount -o move /dev /mnt/dev + umount /proc /sys + exec switch_root /mnt /sbin/init + ' > init + chmod +x init + find . ! -name bootstrap ! -name initramfs.cpio | cpio -H newc -ov > initramfs.cpio + gzip -9 initramfs.cpio + ''; + prepare = '' + modules='${pkgs.lib.strings.concatMapStringsSep " " (module: module) modules}' + initrd_directory=rootfs/lib/modules/initrd + [ -n "$modules" ] && { + mkdir --parents "$initrd_directory" + printf "\n" + for module in $modules; do + module_file=$(find ${kernel} -name "$module.ko*" -type f) + module_basename=$(basename "$module_file") + printf "Cooking initrd... Adding module %s \n" "$module" + cp "$module_file" "$initrd_directory" || exit 1 + printf 'insmod /lib/modules/initrd/%s\n' "$module_basename" >> "$initrd_directory/init" + done + } || printf '\n%s\n' 'No modules to cook.' + ''; + }; in pkgs.writeScript name '' + set -euo pipefail + PATH=${pkgs.lib.strings.makeBinPath [ + pkgs.coreutils + pkgs.e2fsprogs + pkgs.gawk + pkgs.rsync + pkgs.syslinux + pkgs.tree + pkgs.utillinux + ]} + IMAGE=${name}.img + LOOP=/dev/loop0 + ROOTFS=rootfs + rm "$IMAGE" || true + fallocate --length ${size} $IMAGE && chmod o+rw "$IMAGE" + printf 'o\nn\np\n1\n2048\n\na\nw\n' | fdisk "$IMAGE" + dd bs=440 count=1 conv=notrunc if=${pkgs.syslinux}/share/syslinux/mbr.bin of="$IMAGE" + mkdir --parents "$ROOTFS" + umount --verbose "$ROOTFS" || true + losetup --detach "$LOOP" || true + losetup --offset "$((2048 * 512))" "$LOOP" "$IMAGE" + mkfs.ext4 -U ${uuid} "$LOOP" + mount --verbose "$LOOP" "$ROOTFS" + rsync --archive --chown=0:0 "${image}/rootfs/" "$ROOTFS"; + mkdir --parents "$ROOTFS/boot" + cp ${kernel}/bzImage "$ROOTFS/boot/vmlinux" + cp ${initrd}/rootfs/initramfs.cpio.gz "$ROOTFS/boot/initrd" + printf ' + DEFAULT linux + LABEL linux + LINUX /boot/vmlinux + INITRD /boot/initrd + APPEND ${pkgs.lib.strings.concatMapStringsSep " " (option: option) options} + ' > "$ROOTFS/boot/syslinux.cfg" + extlinux --heads 64 --sectors 32 --install $ROOTFS/boot + printf '\n%s\n\n' "$(du --max-depth 1 --human-readable $ROOTFS | sort --human-numeric-sort)" + umount --verbose "$ROOTFS" + rm -r "$ROOTFS" + losetup --detach "$LOOP" + ''; + + system = cook { + name = "alpine"; + src = alpine; + contents = [ pkgs.glibc pkgs.gawk ]; + path = [ pkgs.gawk ]; + script = '' + cat /etc/alpine-release + sed -i 's/#ttyS0/ttyS0/' /etc/inittab + printf 'migh7Lib\nmigh7Lib\n' | adduser alpine + ''; + }; + + machine = cook { + name = "alpine"; + src = alpine; + contents = [ pkgs.glibc pkgs.gawk ]; + path = [ pkgs.gawk ]; + script = '' + apk update + apk upgrade + apk add openrc + cat /etc/alpine-release + sed -i 's/#ttyS0/ttyS0/' /etc/inittab + printf 'migh7Lib\nmigh7Lib\n' | adduser alpine + ''; + }; + + virtual-machine = bake { + name = "alpine-machine"; + image = machine; + kernel = pkgs.linuxPackages_5_10.kernel; + options = [ "console=tty1" "console=ttyS0" ]; + size = "128M"; + modules = [ + "virtio" + "virtio_ring" + "virtio_blk" + "virtio_pci" + "jbd2" + "mbcache" + "crc16" + "crc32c_generic" + "ext4" + ]; + }; + + container = { rootfs, binds ? [ ], options ? [] }: + pkgs.writeScript name '' + set -euxo pipefail + PATH=${pkgs.lib.strings.makeBinPath [ pkgs.proot ]} + proot \ + --cwd=/ \ + --rootfs='${rootfs}' \ + ${pkgs.lib.strings.concatMapStringsSep " " (option: "--bind=${option}") binds} \ + ${pkgs.lib.strings.concatMapStringsSep " " (value: value) options} \ + /usr/bin/env - /bin/sh -c '. /etc/profile && sh' + ''; + +in pkgs.mkShell { + + inherit name; + + buildInputs = [ pkgs.proot pkgs.qemu ]; + + shellHook = '' + export PS1='\h (${name}) \W \$ ' + + # sudo ${virtual-machine} + # doas ${virtual-machine} + # qemu-system-x86_64 -nographic -drive if=virtio,file=./${virtual-machine.name}.img,format=raw + # qemu-system-x86_64 -curses -drive if=virtio,file=./${virtual-machine.name}.img,format=raw + + ${container { + rootfs = "${system}/rootfs"; + binds = [ "/proc" "/dev" ]; + options = [ "--verbose=0" ]; + }} + exit + ''; +} diff --git a/.config/nixpkgs/shells/coreboot.nix b/.config/nixpkgs/shells/coreboot.nix deleted file mode 100644 index 57ca4e5..0000000 --- a/.config/nixpkgs/shells/coreboot.nix +++ /dev/null @@ -1,119 +0,0 @@ -# Shell derivation condensed from https://git.petabyte.dev/petabyteboy/corenix - -with import (builtins.fetchTarball { - url = "https://releases.nixos.org/nixos/20.09/nixos-20.09.3824.dec334fa196/nixexprs.tar.xz"; - sha256 = "1i38d1z672gzn73k6gsas2zjbbradg06w7dw3zs9f64l0hr3qd94"; }) { }; - -let - - architecture = "i386"; - url = "https://review.coreboot.org/coreboot"; - project = "${builtins.getEnv "HOME"}/Shares/Projects/coreboot"; - - dependencies = { fetchurl }: [ - rec { name = "Python-3.8.5.tar.xz"; archive = fetchurl { sha256 = "1c43dbv9lvlp3ynqmgdi4rh8q94swanhqarqrdx62zmigpakw073"; url = "https://www.python.org/ftp/python/3.8.5/${name}"; }; } - rec { name = "acpica-unix2-20200717.tar.gz"; archive = fetchurl { sha256 = "0jyy71szjr40c8v40qqw6yh3gfk8d6sl3nay69zrn5d88i3r0jca"; url = "https://acpica.org/sites/acpica/files/${name}"; }; } - rec { name = "binutils-2.35.tar.xz"; archive = fetchurl { sha256 = "119g6340ksv1jkg6bwaxdp2whhlly22l9m30nj6y284ynjgna48v"; url = "https://ftpmirror.gnu.org/binutils/${name}"; }; } - rec { name = "clang-10.0.1.src.tar.xz"; archive = fetchurl { sha256 = "091bvcny2lh32zy8f3m9viayyhb2zannrndni7325rl85cwgr6pr"; url = "https://github.com/llvm/llvm-project/releases/download/llvmorg-10.0.1/${name}"; }; } - rec { name = "clang-tools-extra-10.0.1.src.tar.xz"; archive = fetchurl { sha256 = "06n1yp638rh24xdxv9v2df0qajxbjz4w59b7dd4ky36drwmpi4yh"; url = "https://github.com/llvm/llvm-project/releases/download/llvmorg-10.0.1/${name}"; }; } - rec { name = "cmake-3.18.1.tar.gz"; archive = fetchurl { sha256 = "0215srmc9l7ygwdpfms8yx0wbd96qgz2d58ykmdiarvysf5k7qy0"; url = "https://cmake.org/files/v3.18/${name}"; }; } - rec { name = "compiler-rt-10.0.1.src.tar.xz"; archive = fetchurl { sha256 = "1yjqjri753w0fzmxcyz687nvd97sbc9rsqrxzpq720na47hwh3fr"; url = "https://github.com/llvm/llvm-project/releases/download/llvmorg-10.0.1/${name}"; }; } - rec { name = "expat-2.2.9.tar.bz2"; archive = fetchurl { sha256 = "0dx2m58gkj7cadk51lmp54ma7cqjhff4kjmwv8ks80j3vj2301pi"; url = "https://downloads.sourceforge.net/sourceforge/expat/${name}"; }; } - rec { name = "gcc-8.3.0.tar.xz"; archive = fetchurl { sha256 = "0b3xv411xhlnjmin2979nxcbnidgvzqdf4nbhix99x60dkzavfk4"; url = "https://ftpmirror.gnu.org/gcc/gcc-8.3.0/${name}"; }; } - rec { name = "gdb-9.2.tar.xz"; archive = fetchurl { sha256 = "0mf5fn8v937qwnal4ykn3ji1y2sxk0fa1yfqi679hxmpg6pdf31n"; url = "https://ftpmirror.gnu.org/gdb/${name}"; }; } - rec { name = "gmp-6.2.0.tar.xz"; archive = fetchurl { sha256 = "09hmg8k63mbfrx1x3yy6y1yzbbq85kw5avbibhcgrg9z3ganr3i5"; url = "https://ftpmirror.gnu.org/gmp/${name}"; }; } - rec { name = "llvm-10.0.1.src.tar.xz"; archive = fetchurl { sha256 = "1wydhbp9kyjp5y0rc627imxgkgqiv3dfirbqil9dgpnbaw5y7n65"; url = "https://github.com/llvm/llvm-project/releases/download/llvmorg-10.0.1/${name}"; }; } - rec { name = "mpc-1.2.0.tar.gz"; archive = fetchurl { sha256 = "19pxx3gwhwl588v496g3aylhcw91z1dk1d5x3a8ik71sancjs3z9"; url = "https://ftpmirror.gnu.org/mpc/${name}"; }; } - rec { name = "mpfr-4.1.0.tar.xz"; archive = fetchurl { sha256 = "0zwaanakrqjf84lfr5hfsdr7hncwv9wj0mchlr7cmxigfgqs760c"; url = "https://ftpmirror.gnu.org/mpfr/${name}"; }; } - rec { name = "nasm-2.15.03.tar.bz2"; archive = fetchurl { sha256 = "0y6p3d5lhmwzvgi85f00sz6c485ir33zd1nskzxby4pikcyk9rq4"; url = "https://www.nasm.us/pub/nasm/releasebuilds/2.15.03/${name}"; }; } - ]; - - toolchain = stdenv.mkDerivation rec { - pname = "crossgcc-${architecture}"; - version = "4.13"; - src = fetchgit { - inherit url; - rev = version; - sha256 = "0xwzwplyf2zc267ddprh7963p582q3jrdvxc7r4cwzj0lhgrv6rv"; - fetchSubmodules = true; - }; - - nativeBuildInputs = [ curl m4 flex bison zlib gnat ]; - - buildPhase = '' - mkdir -p util/crossgcc/tarballs - ${lib.concatMapStringsSep "\n" - (file: "ln -s ${file.archive} util/crossgcc/tarballs/${file.name}") - (callPackage dependencies { })} - NIX_HARDENING_ENABLE="$\{NIX_HARDENING_ENABLE/ format/\}" make crossgcc-i386 CPUS=$(nproc) - ''; - - installPhase = '' - runHook preInstall - cp -r util/crossgcc $out - runHook postInstall - ''; - }; - -in mkShell { - - name = "coreboot"; - - buildInputs = [ git coreboot-utils flashrom me_cleaner ncurses qemu m4 flex bison zlib gnat ]; - - shellHook = '' - export PS1='\h (coreboot) \W \$ ' - - mkdir -p '${project}' - git clone '${url}' '${project}' || true - cd '${project}' || exit 1 - - [ ! -L util/crossgcc ] && rm -rf util/crossgcc - ln -sf ${toolchain} util/crossgcc - - printf " - **** COMMANDS **** - - # view toolchain help - make help_toolchain - - # clear old configuration - make distclean - - # build i386, Aarch64, and RISC-V toolchain - make crossgcc-i386 CPUS=$(nproc) - make crossgcc-aarch64 CPUS=$(nproc) - make crossgcc-riscv CPUS=$(nproc) - - # build coreinfo payload - make -C payloads/coreinfo olddefconfig - make -C payloads/coreinfo - - # setup configurtion - make nconfig - select 'Mainboard' menu - Beside 'Mainboard vendor' should be '(Emulation)' - Beside 'Mainboard model' should be 'QEMU x86 i440fx/piix4' - select < Exit > - - select 'Payload' menu - select 'Add a Payload' - choose 'An Elf executable payload' - select 'Payload path and filename' - enter 'payloads/coreinfo/build/coreinfo.elf' - select < Exit > - select < Exit > - select < Yes > - - # check configuration - make savedefconfig - cat defconfig - - # build coreboot - make - - # test image in qemu - qemu-system-x86_64 -bios build/coreboot.rom -serial stdio - " - ''; -} diff --git a/.config/nixpkgs/shells/coreboot/shell.nix b/.config/nixpkgs/shells/coreboot/shell.nix new file mode 100644 index 0000000..242c621 --- /dev/null +++ b/.config/nixpkgs/shells/coreboot/shell.nix @@ -0,0 +1,108 @@ +let + + # Shell derivation condensed from https://git.petabyte.dev/petabyteboy/corenix + + # nix-shell -E 'import (builtins.fetchurl "$url")' + + name = "nix-shell.coreboot"; + architecture = "i386"; + url = "https://review.coreboot.org/coreboot"; + project = "${builtins.getEnv "HOME"}/Shares/Projects/coreboot"; + + pkgs = import (builtins.fetchTarball { + url = "https://releases.nixos.org/nixos/20.09/nixos-20.09.3824.dec334fa196/nixexprs.tar.xz"; + sha256 = "1i38d1z672gzn73k6gsas2zjbbradg06w7dw3zs9f64l0hr3qd94"; }) {}; + + dependencies = { fetchurl }: [ + rec { name = "llvm-${version}.src.tar.xz"; version = "11.0.0"; archive = fetchurl { sha256 = "0s94lwil98w7zb7cjrbnxli0z7gklb312pkw74xs1d6zk346hgwi"; url = "https://github.com/llvm/llvm-project/releases/download/llvmorg-${version}/${name}"; }; } + rec { name = "clang-${version}.src.tar.xz"; version = "11.0.0"; archive = fetchurl { sha256 = "091bvcny2lh32zy8f3m9viayyhb2zannrndni7325rl85cwgr6pr"; url = "https://github.com/llvm/llvm-project/releases/download/llvmorg-${version}/${name}"; }; } + rec { name = "clang-tools-extra-${version}.src.tar.xz"; version = "11.0.0"; archive = fetchurl { sha256 = "02bcwwn54661madhq4nxc069s7p7pj5gpqi8ww50w3anbpviilzy"; url = "https://github.com/llvm/llvm-project/releases/download/llvmorg-${version}/${name}"; }; } + rec { name = "compiler-rt-${version}.src.tar.xz"; version = "11.0.0"; archive = fetchurl { sha256 = "1yjqjri753w0fzmxcyz687nvd97sbc9rsqrxzpq720na47hwh3fr"; url = "https://github.com/llvm/llvm-project/releases/download/llvmorg-${version}/${name}"; }; } + rec { name = "Python-${version}.tar.xz"; version = "3.8.5"; archive = fetchurl { sha256 = "1c43dbv9lvlp3ynqmgdi4rh8q94swanhqarqrdx62zmigpakw073"; url = "https://www.python.org/ftp/python/${version}/${name}"; }; } + rec { name = "acpica-unix2-${version}.tar.gz"; version = "20200925"; archive = fetchurl { sha256 = "18n6129fkgj85piid7v4zxxksv3h0amqp4p977vcl9xg3bq0zd2w"; url = "https://acpica.org/sites/acpica/files/${name}"; }; } + rec { name = "binutils-${version}.tar.xz"; version = "2.35.1"; archive = fetchurl { sha256 = "01w6xvfy7sjpw8j08k111bnkl27j760bdsi0wjvq44ghkgdr3v9w"; url = "https://ftpmirror.gnu.org/binutils/${name}"; }; } + rec { name = "cmake-${version}.1.tar.gz"; version = "3.18"; archive = fetchurl { sha256 = "0215srmc9l7ygwdpfms8yx0wbd96qgz2d58ykmdiarvysf5k7qy0"; url = "https://cmake.org/files/v${version}/${name}"; }; } + rec { name = "expat-${version}.tar.bz2"; version = "2.2.9"; archive = fetchurl { sha256 = "0dx2m58gkj7cadk51lmp54ma7cqjhff4kjmwv8ks80j3vj2301pi"; url = "https://distfiles.macports.org/expat/${name}"; }; } + rec { name = "gcc-${version}.tar.xz"; version = "8.3.0"; archive = fetchurl { sha256 = "0b3xv411xhlnjmin2979nxcbnidgvzqdf4nbhix99x60dkzavfk4"; url = "https://ftpmirror.gnu.org/gcc/gcc-${version}/${name}"; }; } + rec { name = "gdb-${version}.tar.xz"; version = "9.2"; archive = fetchurl { sha256 = "0mf5fn8v937qwnal4ykn3ji1y2sxk0fa1yfqi679hxmpg6pdf31n"; url = "https://ftpmirror.gnu.org/gdb/${name}"; }; } + rec { name = "gmp-${version}.tar.xz"; version = "6.2.0"; archive = fetchurl { sha256 = "09hmg8k63mbfrx1x3yy6y1yzbbq85kw5avbibhcgrg9z3ganr3i5"; url = "https://ftpmirror.gnu.org/gmp/${name}"; }; } + rec { name = "mpc-${version}.tar.gz"; version = "1.2.0"; archive = fetchurl { sha256 = "19pxx3gwhwl588v496g3aylhcw91z1dk1d5x3a8ik71sancjs3z9"; url = "https://ftpmirror.gnu.org/mpc/${name}"; }; } + rec { name = "mpfr-${version}.tar.xz"; version = "4.1.0"; archive = fetchurl { sha256 = "0zwaanakrqjf84lfr5hfsdr7hncwv9wj0mchlr7cmxigfgqs760c"; url = "https://ftpmirror.gnu.org/mpfr/${name}"; }; } + rec { name = "nasm-${version}.tar.bz2"; version = "2.15.05"; archive = fetchurl { sha256 = "1l1gxs5ncdbgz91lsl4y7w5aapask3w02q9inayb2m5bwlwq6jrw"; url = "https://www.nasm.us/pub/nasm/releasebuilds/${version}/${name}"; }; } + ]; + + toolchain = pkgs.stdenv.mkDerivation rec { + pname = "crossgcc-${architecture}"; + version = "4.14"; + src = pkgs.fetchgit { + inherit url; + rev = version; + fetchSubmodules = true; + sha256 = "00xr74yc0kj9rrqa1a8b7bih865qlp9i4zs67ysavkfrjrwwssxm"; + }; + + hardeningDisable = [ "format" ]; + nativeBuildInputs = builtins.attrValues { inherit (pkgs) curl m4 flex bison zlib gnat; }; + + buildPhase = '' + mkdir --parents util/crossgcc/tarballs + ${pkgs.lib.concatMapStringsSep "\n" (file: "ln -s ${file.archive} util/crossgcc/tarballs/${file.name}") (pkgs.callPackage dependencies { })} + sed "s/SOURCE_DATE_EPOCH := .*/SOURCE_DATE_EPOCH := $SOURCE_DATE_EPOCH/" --in-place Makefile + make crossgcc-${architecture} CPUS=$(nproc) + ''; + + installPhase = '' + runHook preInstall + cp -r util/crossgcc $out + runHook postInstall + ''; + }; + +in pkgs.mkShell { + + inherit name; + + buildInputs = builtins.attrValues { inherit (pkgs) git coreboot-utils flashrom me_cleaner ncurses qemu m4 flex bison zlib gnat; }; + + shellHook = '' + export PS1='\h (${name}) \W \$ ' + mkdir -p '${project}' + git clone '${url}' '${project}' || true + cd '${project}' || exit 1 + rm -rf util/crossgcc + git fetch --all + git reset --hard origin/master + git checkout ${toolchain.version} + rm -rf util/crossgcc + ln -sf ${toolchain} util/crossgcc + sed -i 's|$(OBJCOPY) --strip-$(STRIP) $< $@|$(OBJCOPY) --strip-debug $< $@|g' payloads/libpayload/Makefile.payload + + printf ' + flashrom --programmer internal # read BIOS chipset internally if possible + flashrom --programmer internal --read backup.rom --chip $chipset # read BIOS internally if possible with selected chipset + flashrom --programmer internal --read backup1.rom --chip $chipset + flashrom --programmer internal --read backup2.rom --chip $chipset + flashrom --programmer internal --read backup3.rom --chip $chipset + flashrom --programmer ch341a_spi --read backup.rom --chip $chipset # use an external programmer if internal does not work + sha256sum *.rom # check BIOS hashes for exactness + me_cleaner.py --soft-disable backup.rom # clean management engine and overwrite bios inplace + ifdtool --extract backup.rom # split regions of cleaned bios + + # Rename and move descriptor.bin, gbe.bin, me.bin into 3rdparty/blobs/mainboard/$vendor/$model where + # $vendor and $model are variable (for example lenovo/t420). Create folders if they do not exist. + # To test in qemu select model/vendor Emulation/QEMU x86 i440fx/piix4 in nconfig. + # In real world situations, one might only read and write internally to the bios region. + + flashrom --programmer internal --read bios.rom --chip $chipset --ifd --image bios + flashrom --programmer internal --write bios.rom --chip $chipset --ifd --image bios + + make distclean # clear old configuration + make clean # clear old compilation and keep configuration + make nconfig # setup configurtion + cat .config # check configuration + make # build coreboot + qemu-system-x86_64 -bios build/coreboot.rom -serial stdio # test image in qemu + + ' + ''; +} diff --git a/.config/nixpkgs/shells/falcon.nix b/.config/nixpkgs/shells/falcon/shell.nix index 0d1a76e..7bd0b54 100644 --- a/.config/nixpkgs/shells/falcon.nix +++ b/.config/nixpkgs/shells/falcon/shell.nix @@ -1,19 +1,24 @@ -with import (builtins.fetchTarball { - url = "https://github.com/NixOS/nixpkgs/archive/360e2af4f87.tar.gz"; - sha256 = "1i3i9cpn6m3r07pgw4w3xinbqmxkm7pmnqjlz96x424ngbc21sg2"; }) {}; - let + + # nix-shell -E 'import (builtins.fetchurl "$url")' + + name = "nix-shell.falcon-kernel"; + + pkgs = import (builtins.fetchTarball { + url = "https://github.com/NixOS/nixpkgs/archive/360e2af4f87.tar.gz"; + sha256 = "1i3i9cpn6m3r07pgw4w3xinbqmxkm7pmnqjlz96x424ngbc21sg2"; }) {}; + project = "${builtins.getEnv "HOME"}/Desktop/moto-falcon/lineageos-kernel/lineageos-motorala-msm8226"; - toolchain = stdenv.mkDerivation rec { + toolchain = pkgs.stdenv.mkDerivation rec { name = "gcc-linaro-4.9.4"; src = builtins.fetchTarball { url = "https://releases.linaro.org/components/toolchain/binaries/4.9-2017.01/arm-linux-gnueabihf/gcc-linaro-4.9.4-2017.01-x86_64_arm-linux-gnueabihf.tar.xz"; sha256 = "11zznrx0hkq34bn7x7kxn5q9icrf22vqgmd1ifxmdskm2g14x3l8"; }; dontBuild = true; - buildInputs = [ python2 zlib ncurses5 expat lzma ]; - nativeBuildInputs = [ autoPatchelfHook ]; + buildInputs = builtins.attrValues { inherit (pkgs) python2 zlib ncurses5 expat lzma; }; + nativeBuildInputs = builtins.attrValues { inherit (pkgs) autoPatchelfHook; }; installPhase = '' runHook preInstall mkdir $out @@ -22,18 +27,16 @@ let ''; }; -in - -mkShell { +in pkgs.mkShell { - name = "falcon-kernel"; + inherit name; - buildInputs = [ gnumake ncurses ]; + buildInputs = builtins.attrValues { inherit (pkgs) gnumake ncurses; }; shellHook = '' export CROSS_COMPILE=${toolchain}/bin/arm-linux-gnueabihf- export ARCH=arm - export PS1='\h (falcon kernel) \W \$ ' + export PS1='\h (${name}) \W \$ ' cd '${project}' || exit 1 ''; } diff --git a/.config/nixpkgs/shells/firejail/shell.nix b/.config/nixpkgs/shells/firejail/shell.nix new file mode 100644 index 0000000..4f5e5e1 --- /dev/null +++ b/.config/nixpkgs/shells/firejail/shell.nix @@ -0,0 +1,48 @@ +let + + # nix-shell -E 'import (builtins.fetchurl "$url")' + # https://www.man7.org/linux/man-pages/man1/Firejail.1.html + + name = "nix-shell.firejail"; + + pkgs = import (builtins.fetchTarball { + url = "https://releases.nixos.org/nixos/22.11/nixos-22.11.466.596a8e828c5/nixexprs.tar.xz"; + sha256 = "1367bad5zz0mfm4czb6p0s0ni38f0x1ffh02z76rx4nranipqbgg"; + }) { }; + + firejail = { + rootfs ? "rootfs", + options ? [ ], + path ? [ pkgs.busybox ], + entrypoint ? "/bin/sh" + }: + pkgs.writeShellApplication { + inherit name; + text = '' + set -euxo pipefail + PATH=${pkgs.lib.strings.makeBinPath [ pkgs.firejail pkgs.coreutils ]} + mkdir --parents '${rootfs}' + firejail \ + --chroot '${rootfs}' \ + ${pkgs.lib.strings.concatMapStringsSep " " (value: value) options} \ + -- /usr/bin/env --ignore-environment ${ + pkgs.writeScript "entrypoint-${name}" '' + set -eu + export PATH=${pkgs.lib.strings.makeBinPath path} + ${entrypoint} + '' + }; + ''; + }; + + jail = firejail { + options = [ ]; + }; + +in pkgs.mkShell { + inherit name; + shellHook = '' + printf '%s\n' "${jail}/bin/${jail.name}" + exec "${jail}/bin/${jail.name}" + ''; +} diff --git a/.config/nixpkgs/shells/larynx-server/shell.nix b/.config/nixpkgs/shells/larynx-server/shell.nix new file mode 100644 index 0000000..9021e47 --- /dev/null +++ b/.config/nixpkgs/shells/larynx-server/shell.nix @@ -0,0 +1,54 @@ +let + + name = "nix-shell.larynx-server"; + + nixpkgs = import <nixpkgs> { }; + + pkgs = import (builtins.fetchTarball { + url = "https://releases.nixos.org/nixos/22.11/nixos-22.11.466.596a8e828c5/nixexprs.tar.xz"; + sha256 = "1367bad5zz0mfm4czb6p0s0ni38f0x1ffh02z76rx4nranipqbgg"; + }) { }; + + larynx = pkgs.stdenvNoCC.mkDerivation rec { + name = "larynx"; + version = "1.1.0"; + sourceRoot = "."; + + src = pkgs.dockerTools.exportImage { + fromImage = pkgs.dockerTools.pullImage rec { + imageName = "rhasspy/larynx"; + imageDigest = "sha256:ada5b443e2446b38ba61d764ec37c0ed78d46e659a011243967e7cc8e52311e3"; + sha256 = "sha256-TbaHNNMRGp4SWYC06WSmNr3igpiJagDKoD3TEnttYt8="; + finalImageName = imageName; + finalImageTag = version; + }; + diskSize = "3072"; + }; + + phases = [ "unpackPhase" "installPhase" ]; + + installPhase = '' + mkdir --parents $out/bin/larynx/app + cp --recursive home/larynx/app/.venv $out/bin/larynx/app + cp --recursive home/larynx/app/larynx $out/bin/larynx/app + ''; + }; + + fhs = pkgs.buildFHSUserEnv { + name = "larynx-server"; + runScript = "${pkgs.writeScriptBin name '' + export PYTHONPATH=/bin/larynx/app + /bin/larynx/app/.venv/bin/python3 -m larynx.server + ''}/bin/${name}"; + targetPkgs = pkgs: [ + larynx + pkgs.python39 + ]; + profile = "export FHS=1"; + }; + +in pkgs.mkShell { + inherit fhs; + inherit name; + shellHook = "exec ${fhs}/bin/${fhs.name}"; +} diff --git a/.config/nixpkgs/shells/larynx/shell.nix b/.config/nixpkgs/shells/larynx/shell.nix new file mode 100644 index 0000000..ac2e940 --- /dev/null +++ b/.config/nixpkgs/shells/larynx/shell.nix @@ -0,0 +1,54 @@ +let + + name = "nix-shell.larynx"; + + nixpkgs = import <nixpkgs> { }; + + pkgs = import (builtins.fetchTarball { + url = "https://releases.nixos.org/nixos/22.11/nixos-22.11.466.596a8e828c5/nixexprs.tar.xz"; + sha256 = "1367bad5zz0mfm4czb6p0s0ni38f0x1ffh02z76rx4nranipqbgg"; + }) { }; + + larynx = pkgs.stdenvNoCC.mkDerivation rec { + name = "larynx"; + version = "1.1.0"; + sourceRoot = "."; + + src = pkgs.dockerTools.exportImage { + fromImage = pkgs.dockerTools.pullImage rec { + imageName = "rhasspy/larynx"; + imageDigest = "sha256:ada5b443e2446b38ba61d764ec37c0ed78d46e659a011243967e7cc8e52311e3"; + sha256 = "sha256-TbaHNNMRGp4SWYC06WSmNr3igpiJagDKoD3TEnttYt8="; + finalImageName = imageName; + finalImageTag = version; + }; + diskSize = "3072"; + }; + + phases = [ "unpackPhase" "installPhase" ]; + + installPhase = '' + mkdir --parents $out/bin/larynx/app + cp --recursive home/larynx/app/.venv $out/bin/larynx/app + cp --recursive home/larynx/app/larynx $out/bin/larynx/app + ''; + }; + + fhs = pkgs.buildFHSUserEnv { + name = "larynx"; + runScript = "${pkgs.writeScriptBin name '' + export PYTHONPATH=/bin/larynx/app + /bin/larynx/app/.venv/bin/python3 -m larynx "$@" + ''}/bin/${name}"; + targetPkgs = pkgs: [ + larynx + pkgs.python39 + ]; + profile = "export FHS=1"; + }; + +in pkgs.mkShell { + inherit fhs; + inherit name; + shellHook = "exec ${fhs}/bin/${fhs.name}"; +} diff --git a/.config/nixpkgs/shells/mermaid-live-editor/shell.nix b/.config/nixpkgs/shells/mermaid-live-editor/shell.nix new file mode 100644 index 0000000..db89a42 --- /dev/null +++ b/.config/nixpkgs/shells/mermaid-live-editor/shell.nix @@ -0,0 +1,74 @@ +let + + name = "nix-shell.mermaid-live-editor"; + version = "bf6c54c00e84d8c7d541920607db72f50d775ba5"; + + pkgs = import (builtins.fetchTarball { + url = "https://releases.nixos.org/nixos/22.11/nixos-22.11.466.596a8e828c5/nixexprs.tar.xz"; + sha256 = "1367bad5zz0mfm4czb6p0s0ni38f0x1ffh02z76rx4nranipqbgg"; + }) { }; + + package = pkgs.callPackage ({ lib, stdenv, fetchgit, mkYarnModules }: + + stdenv.mkDerivation rec { + inherit version; + pname = "mermaid-live-editor-node-modules"; + + src = fetchgit { + rev = version; + url = "https://github.com/mermaid-js/mermaid-live-editor.git"; + sha256 = "sha256-SadZzBruGKh4LCR9vr87vl/HBEgVN8Qczi9+thGmNCE="; + }; + + node_modules = mkYarnModules { + inherit pname version; + yarnLock = "${src}/yarn.lock"; + packageJSON = "${src}/package.json"; + }; + + installPhase = '' + runHook preInstall + mkdir $out + cp --recursive --no-target-directory ${node_modules} $out + cd $out/node_modules + chmod +w . + ln --symbolic mermaid-live-editor/node_modules/svelte-preprocess . + runHook postInstall + ''; + + meta = with lib; { + homepage = url; + license = licenses.mit; + description = "Edit, preview and share mermaid charts/diagrams. New implementation of the live editor."; + }; + }) { }; + + shell = pkgs.writeShellApplication { + inherit name; + text = '' + /usr/bin/env --ignore-environment /bin/sh -c ${ + pkgs.writeScript name '' + export PS1='\h (${name}) \W \$ ' + export PATH=${ + pkgs.lib.strings.makeBinPath [ + package + pkgs.busybox + pkgs.git + pkgs.yarn + ] + } + git clone https://github.com/mermaid-js/mermaid-live-editor.git + cd mermaid-live-editor + git checkout '${version}' + ln -sf '${package}/node_modules' + stat .svelte-kit || yarn build + yarn preview + '' + }; + ''; + }; + +in pkgs.mkShell { + inherit name; + shellHook = "exec ${shell}/bin/${shell.name}"; +} diff --git a/.config/nixpkgs/shells/nixops.nix b/.config/nixpkgs/shells/nixops.nix deleted file mode 100644 index 03756cd..0000000 --- a/.config/nixpkgs/shells/nixops.nix +++ /dev/null @@ -1,19 +0,0 @@ -with import <nixpkgs> { }; - -let - - version = "20.09"; - project = "${builtins.getEnv "HOME"}/Shares/Projects/infrastructure"; - channel = (import "${project}/nixos/versions.nix")."${version}".channel; - -in mkShell { - name = "nixops-${version}"; - shellHook = '' - export VAULT_ADDR='http://vault.test' - export NIX_PATH=${channel}/nixexprs.tar.xz - export _NIX_CHANNEL=${channel} - export PS1='\h (nixos ${version} ''${_NIX_CHANNEL##*.}) \W \$ ' - cd '${project}' || exit 1 - ssh -T git@github.com - ''; -} diff --git a/.config/nixpkgs/shells/nsjail/shell.nix b/.config/nixpkgs/shells/nsjail/shell.nix new file mode 100644 index 0000000..d954588 --- /dev/null +++ b/.config/nixpkgs/shells/nsjail/shell.nix @@ -0,0 +1,52 @@ +let + + # nix-shell -E 'import (builtins.fetchurl "$url")' + # https://nsjail.dev/ + + name = "nix-shell.nsjail"; + + pkgs = import (builtins.fetchTarball { + url = "https://releases.nixos.org/nixos/22.11/nixos-22.11.466.596a8e828c5/nixexprs.tar.xz"; + sha256 = "1367bad5zz0mfm4czb6p0s0ni38f0x1ffh02z76rx4nranipqbgg"; + }) { }; + + nsjail = { + rootfs ? "rootfs", + options ? [ ], + path ? [ pkgs.busybox ], + entrypoint ? "/bin/sh" + }: + pkgs.writeShellApplication { + inherit name; + text = '' + set -euxo pipefail + PATH=${pkgs.lib.strings.makeBinPath [ pkgs.nsjail pkgs.coreutils ]} + mkdir --parents '${rootfs}' + nsjail \ + --chroot "$(pwd)"/'${rootfs}' \ + ${pkgs.lib.strings.concatMapStringsSep " " (value: value) options} \ + -- /usr/bin/env --ignore-environment ${ + pkgs.writeScript "entrypoint-${name}" '' + set -eu + export PATH=${pkgs.lib.strings.makeBinPath path} + ${entrypoint} + '' + }; + ''; + }; + + jail = nsjail { + options = [ + "--bindmount_ro /nix" + "--bindmount_ro /usr" + "--bindmount_ro /bin" + ]; + }; + +in pkgs.mkShell { + inherit name; + shellHook = '' + printf '%s\n' "${jail}/bin/${jail.name}" + exec "${jail}/bin/${jail.name}" + ''; +} diff --git a/.config/nixpkgs/shells/planner/shell.nix b/.config/nixpkgs/shells/planner/shell.nix new file mode 100644 index 0000000..079beda --- /dev/null +++ b/.config/nixpkgs/shells/planner/shell.nix @@ -0,0 +1,68 @@ +let + + name = "nix-shell.planner"; + + pkgs = (import (builtins.fetchTarball { + url = "https://releases.nixos.org/nixos/21.11/nixos-21.11.336020.2128d0aa28e/nixexprs.tar.xz"; + sha256 = "0w8plbxms0di6gnh0k2yhj0pgxzxas7g5x0m01zjzixf16i2bapj"; + }) { }); + + package = pkgs.callPackage ({ lib, stdenvNoCC, fetchgit, pkgconfig, intltool + , automake111x, autoconf, libtool, gnome2, libxslt, python2, gcc48 }: + stdenvNoCC.mkDerivation rec { + pname = "planner"; + version = "de43d655f9f8103993129cde9de3d0e080d0546c"; + src = fetchgit { + url = "https://gitlab.gnome.org/World/planner.git"; + sha256 = "1zpcswdpcjhllk7phy3z1zyxcgqr4pp0vf5fgpg5f3gqpk4xvwyg"; + rev = version; + }; + nativeBuildInputs = [ + autoconf + automake111x + gnome2.gnome-common + gnome2.gtk-doc + gnome2.scrollkeeper + intltool + libtool + pkgconfig + ]; + buildInputs = [ + gcc48 + gnome2.GConf + gnome2.gtk + gnome2.libglade + gnome2.libgnomecanvas + gnome2.libgnomeui + libxslt + python2.pkgs.pygtk + ]; + enableParallelBuilding = true; + preConfigure = "./autogen.sh"; + makeFlags = [ "CFLAGS=-DGLIB_DISABLE_DEPRECATION_WARNINGS" ]; + configureFlags = [ "--enable-python" "--enable-python-plugin" ]; + meta = with lib; { + description = "Project management application for GNOME"; + homepage = "https://wiki.gnome.org/Apps/Planner"; + license = licenses.gpl2Plus; + platforms = platforms.all; + }; + }) { }; + + shell = pkgs.writeShellApplication { + inherit name; + text = '' + /usr/bin/env --ignore-environment /bin/sh -c ${ + pkgs.writeScript name '' + export PS1='\h (${name}) \W \$ ' + export PATH=${pkgs.lib.strings.makeBinPath [ package pkgs.busybox ]} + /bin/sh + '' + }; + ''; + }; + +in pkgs.mkShell { + inherit name package; + shellHook = "exec ${shell}/bin/${shell.name}"; +} diff --git a/.config/nixpkgs/shells/proot/shell.nix b/.config/nixpkgs/shells/proot/shell.nix new file mode 100644 index 0000000..46ed76f --- /dev/null +++ b/.config/nixpkgs/shells/proot/shell.nix @@ -0,0 +1,52 @@ +let + + # nix-shell -E 'import (builtins.fetchurl "$url")' + # https://manpages.ubuntu.com/manpages/trusty/man1/proot.1.html + + name = "nix-shell.proot"; + + pkgs = import (builtins.fetchTarball { + url = "https://releases.nixos.org/nixos/22.11/nixos-22.11.466.596a8e828c5/nixexprs.tar.xz"; + sha256 = "1367bad5zz0mfm4czb6p0s0ni38f0x1ffh02z76rx4nranipqbgg"; + }) { }; + + proot = { + rootfs ? "rootfs", + binds ? [ ], + options ? [ ], + path ? [ pkgs.busybox ], + entrypoint ? "/bin/sh" + }: + pkgs.writeShellApplication { + inherit name; + text = '' + set -euxo pipefail + PATH=${pkgs.lib.strings.makeBinPath [ pkgs.proot pkgs.coreutils ]} + mkdir --parents '${rootfs}' + proot \ + --rootfs='${rootfs}' \ + ${pkgs.lib.strings.concatMapStringsSep " " (option: "--bind=${option}") binds} \ + ${pkgs.lib.strings.concatMapStringsSep " " (value: value) options} \ + /usr/bin/env --ignore-environment ${ + pkgs.writeScript "entrypoint-${name}" '' + set -eu + export HISTFILE=/dev/null + export PATH=${pkgs.lib.strings.makeBinPath path} + ${entrypoint} + '' + }; + ''; + }; + + jail = proot { + binds = [ "/nix" "/usr" "/bin" ]; + options = [ "--cwd=/" "--verbose=0" ]; + }; + +in pkgs.mkShell { + inherit name; + shellHook = '' + printf '%s\n' "${jail}/bin/${jail.name}" + exec "${jail}/bin/${jail.name}" + ''; +} diff --git a/.config/nixpkgs/shells/pure/shell.nix b/.config/nixpkgs/shells/pure/shell.nix new file mode 100644 index 0000000..2e58365 --- /dev/null +++ b/.config/nixpkgs/shells/pure/shell.nix @@ -0,0 +1,22 @@ +let + + name = "nix-shell.pure"; + pkgs = import <nixpkgs> { }; + + shell = pkgs.writeShellApplication { + inherit name; + text = '' + /usr/bin/env --ignore-environment /bin/sh -c ${ + pkgs.writeScript name '' + export PS1='\h (${name}) \W \$ ' + export PATH=${pkgs.lib.strings.makeBinPath [ pkgs.busybox ]} + /bin/sh + '' + }; + ''; + }; + +in pkgs.mkShell { + inherit name; + shellHook = "exec ${shell}/bin/${shell.name}"; +} diff --git a/.config/nixpkgs/shells/scribus/shell.nix b/.config/nixpkgs/shells/scribus/shell.nix new file mode 100644 index 0000000..9658c0a --- /dev/null +++ b/.config/nixpkgs/shells/scribus/shell.nix @@ -0,0 +1,96 @@ +let + + name = "nix-shell.scribus"; + + pkgs = (import (builtins.fetchTarball { + url = "https://releases.nixos.org/nixos/21.11/nixos-21.11.336020.2128d0aa28e/nixexprs.tar.xz"; + sha256 = "0w8plbxms0di6gnh0k2yhj0pgxzxas7g5x0m01zjzixf16i2bapj"; + }) { }); + + package = pkgs.callPackage ({ lib, stdenv, fetchurl, pkg-config, freetype, lcms, libtiff + , libxml2, gnome2, qt4, python2, cups, fontconfig, libjpeg, zlib, libpng + , xorg, cairo, podofo, hunspell, boost, cmake, imagemagick, ghostscript }: + + let + icon = fetchurl { + url = "https://gist.githubusercontent.com/ejpcmac/a74b762026c9bc4000be624c3d085517/raw/18edc497c5cb6fdeef1c8aede37a0ee68413f9d3/scribus-icon-centered.svg"; + sha256 = "0hq3i7c2l50445an9glhhg47kj26y16svfajc6naqn307ph9vzc3"; + }; + pythonEnv = python2.withPackages (ps: [ ps.tkinter ps.pillow ]); + in stdenv.mkDerivation rec { + pname = "scribus"; + version = "1.4.8"; + + src = fetchurl { + url = "mirror://sourceforge/${pname}/${pname}/${pname}-${version}.tar.xz"; + sha256 = "0bq433myw6h1siqlsakxv6ghb002rp3mfz5k12bg68s0k6skn992"; + }; + + nativeBuildInputs = [ pkg-config cmake ]; + buildInputs = with xorg; [ + boost + cairo + cups + fontconfig + freetype + gnome2.libart_lgpl + hunspell + imagemagick + lcms + libX11 + libXau + libXaw + libXdmcp + libXext + libXi + libXinerama + libXtst + libjpeg + libpng + libpthreadstubs + libtiff + libxml2 + podofo + pythonEnv + qt4 + zlib + ]; + + postPatch = '' + substituteInPlace scribus/util_ghostscript.cpp \ + --replace 'QString gsName("gs");' \ + 'QString gsName("${ghostscript}/bin/gs");' + ''; + + postInstall = '' + for i in 16 24 48 64 96 128 256 512; do + mkdir -p $out/share/icons/hicolor/''${i}x''${i}/apps + convert -background none -resize ''${i}x''${i} ${icon} $out/share/icons/hicolor/''${i}x''${i}/apps/scribus.png + done + ''; + + meta = { + platforms = lib.platforms.linux; + description = "Desktop Publishing (DTP) and Layout program for Linux"; + homepage = "https://www.scribus.net"; + license = lib.licenses.gpl2; + }; + }) { }; + + shell = pkgs.writeShellApplication { + inherit name; + text = '' + /usr/bin/env --ignore-environment /bin/sh -c ${ + pkgs.writeScript name '' + export PS1='\h (${name}) \W \$ ' + export PATH=${pkgs.lib.strings.makeBinPath [ package pkgs.busybox ]} + /bin/sh + '' + }; + ''; + }; + +in pkgs.mkShell { + inherit name package; + shellHook = "exec ${shell}/bin/${shell.name}"; +} diff --git a/.config/nixpkgs/shells/tilp2/shell.nix b/.config/nixpkgs/shells/tilp2/shell.nix new file mode 100644 index 0000000..f57bc3b --- /dev/null +++ b/.config/nixpkgs/shells/tilp2/shell.nix @@ -0,0 +1,66 @@ +let + + name = "nix-shell.tilp2"; + + pkgs = (import (builtins.fetchTarball { + url = "https://releases.nixos.org/nixos/21.11/nixos-21.11.336020.2128d0aa28e/nixexprs.tar.xz"; + sha256 = "0w8plbxms0di6gnh0k2yhj0pgxzxas7g5x0m01zjzixf16i2bapj"; + }) { }); + + package = pkgs.callPackage ({ stdenv, lib, fetchurl, fetchpatch + , autoreconfHook, pkg-config, intltool, glib, gnome2, gtk2, gfm + , libticables2, libticalcs2, libticonv, libtifiles2 }: + + stdenv.mkDerivation rec { + pname = "tilp2"; + version = "1.18"; + src = fetchurl { + url = "mirror://sourceforge/tilp/${pname}-${version}.tar.bz2"; + sha256 = "0isf73bjwk06baz2gm3vpdh600gqck9ca4aqxzb089dmxriv6fkv"; + }; + + patches = fetchpatch { + name = "remove-broken-kde-support.patch"; + url = "https://aur.archlinux.org/cgit/aur.git/plain/remove-broken-kde-support.patch?h=tilp"; + sha256 = "1fn6vh7r45spkwpmkvffkbn7zrcsdrs5mjmspd5rwi3jc12cy3ny"; + }; + + nativeBuildInputs = [ autoreconfHook pkg-config intltool ]; + + buildInputs = [ + glib + gtk2 + gnome2.libglade + gfm + libticables2 + libticalcs2 + libticonv + libtifiles2 + ]; + + meta = with lib; { + changelog = "http://lpg.ticalc.org/prj_tilp/news.html"; + description = "Transfer data between Texas Instruments graphing calculators and a computer"; + homepage = "http://lpg.ticalc.org/prj_tilp/"; + license = licenses.gpl2Plus; + platforms = with platforms; linux ++ darwin; + }; + }) { }; + + shell = pkgs.writeShellApplication { + inherit name; + text = '' + /usr/bin/env --ignore-environment /bin/sh -c ${ + pkgs.writeScript name '' + export PS1='\h (${name}) \W \$ ' + export PATH=${pkgs.lib.strings.makeBinPath [ package pkgs.busybox ]} + /bin/sh + '' + }; + ''; + }; + +in pkgs.mkShell { + inherit name package; + shellHook = "exec ${shell}/bin/${shell.name}"; +} |