1 { lib, fetchurl, boost, cmake, extra-cmake-modules, kparts, kpmcore, kirigami2
2 , kservice, libatasmart, libxcb, libyamlcpp, libpwquality, parted, polkit-qt, python
3 , qtbase, qtquickcontrols, qtsvg, qttools, qtwebengine, util-linux, tzdata
4 , ckbcomp, xkeyboard_config, mkDerivation
5 , nixos-extensions ? false
12 # release including submodule
14 url = "https://github.com/calamares/calamares/releases/download/v${version}/${pname}-${version}.tar.gz";
15 sha256 = "sha256-dZG5tgc4vbp7neK42lRiqyEAbbBqAG8N0hrFuDJxHdI=";
18 patches = lib.optionals nixos-extensions [
19 # Modifies the users module to only set passwords of user and root
20 # as the users will have already been created in the configuration.nix file
22 # Makes calamares search /run/current-system/sw/share/calamares/ for extra configuration files
23 # as by default it only searches /usr/share/calamares/ and /nix/store/<hash>-calamares-<version>/share/calamares/
24 # but calamares-nixos-extensions is not in either of these locations
25 ./nixos-extensions-paths.patch
26 # Uses pkexec within modules in order to run calamares without root permissions as a whole
27 # Also fixes storage check in the welcome module
29 # Adds unfree qml to packagechooserq
31 # Modifies finished module to add some NixOS resources
32 # Modifies packagechooser module to change the UI
34 # Remove options for unsupported partition types
36 # Fix setting the kayboard layout on GNOME wayland
37 # By default the module uses the setxkbmap, which will not change the keyboard
39 # Change default location where calamares searches for locales
40 ./supportedlocale.patch
43 nativeBuildInputs = [ cmake extra-cmake-modules ];
45 boost kparts.dev kpmcore.out kservice.dev kirigami2
46 libatasmart libxcb libyamlcpp libpwquality parted polkit-qt python
47 qtbase qtquickcontrols qtsvg qttools qtwebengine.dev util-linux
51 "-DPYTHON_LIBRARY=${python}/lib/lib${python.libPrefix}.so"
52 "-DPYTHON_INCLUDE_DIR=${python}/include/${python.libPrefix}"
53 "-DCMAKE_VERBOSE_MAKEFILE=True"
54 "-DCMAKE_BUILD_TYPE=Release"
55 "-DWITH_PYTHONQT:BOOL=ON"
58 POLKITQT-1_POLICY_FILES_INSTALL_DIR = "$(out)/share/polkit-1/actions";
61 # Run calamares without root. Other patches make it functional as a normal user
62 sed -e "s,pkexec calamares,calamares -D6," \
65 sed -e "s,X-AppStream-Ignore=true,&\nStartupWMClass=calamares," \
68 # Fix desktop reference with wayland
69 mv calamares.desktop io.calamares.calamares.desktop
71 sed -e "s,calamares.desktop,io.calamares.calamares.desktop," \
74 sed -e "s,/usr/bin/calamares,$out/bin/calamares," \
75 -i com.github.calamares.calamares.policy
77 sed -e 's,/usr/share/zoneinfo,${tzdata}/share/zoneinfo,' \
78 -i src/modules/locale/SetTimezoneJob.cpp \
79 -i src/libcalamares/locale/TimeZone.cpp
81 sed -e 's,/usr/share/X11/xkb/rules/base.lst,${xkeyboard_config}/share/X11/xkb/rules/base.lst,' \
82 -i src/modules/keyboard/keyboardwidget/keyboardglobal.cpp
84 sed -e 's,"ckbcomp","${ckbcomp}/bin/ckbcomp",' \
85 -i src/modules/keyboard/keyboardwidget/keyboardpreview.cpp
87 sed "s,\''${POLKITQT-1_POLICY_FILES_INSTALL_DIR},''${out}/share/polkit-1/actions," \
92 description = "Distribution-independent installer framework";
93 homepage = "https://calamares.io/";
94 license = with licenses; [ gpl3Plus bsd2 cc0 ];
95 maintainers = with maintainers; [ manveru vlinkz ];
96 platforms = platforms.linux;