Merge staging-next into staging

authored by

github-actions[bot] and committed by
GitHub
c494d3a0 b4a5c1a4

+1201 -696
+5 -2
doc/languages-frameworks/cuda.section.md
··· 12 12 13 13 To use one or more CUDA packages in an expression, give the expression a `cudaPackages` parameter, and in case CUDA is optional 14 14 ```nix 15 - cudaSupport ? false 16 - cudaPackages ? {} 15 + { config 16 + , cudaSupport ? config.cudaSupport 17 + , cudaPackages ? { } 18 + , ... 19 + }: 17 20 ``` 18 21 19 22 When using `callPackage`, you can choose to pass in a different variant, e.g.
+81 -69
pkgs/applications/editors/vim/plugins/generated.nix
··· 173 173 174 174 LazyVim = buildVimPluginFrom2Nix { 175 175 pname = "LazyVim"; 176 - version = "2023-07-23"; 176 + version = "2023-07-25"; 177 177 src = fetchFromGitHub { 178 178 owner = "LazyVim"; 179 179 repo = "LazyVim"; 180 - rev = "9a0543531d05a417ba63f3dd710530ba5765aca5"; 181 - sha256 = "0xr0brs8wvcmw6zpqp2khq7f6k2nscicjd537gg0mv23pcw6skgm"; 180 + rev = "aa1cccf230a01bd85d5173f7d87f782fd83caa88"; 181 + sha256 = "1kx8n6rn9vgsp7j9kmdz2f6yg812i64nclii0y2cjpnb8h1aa0cf"; 182 182 }; 183 183 meta.homepage = "https://github.com/LazyVim/LazyVim/"; 184 184 }; 185 185 186 186 LeaderF = buildVimPluginFrom2Nix { 187 187 pname = "LeaderF"; 188 - version = "2023-07-24"; 188 + version = "2023-07-25"; 189 189 src = fetchFromGitHub { 190 190 owner = "Yggdroot"; 191 191 repo = "LeaderF"; 192 - rev = "4c5290e277d2a50d83222dacba35aec42c096875"; 193 - sha256 = "1a99sdvdjz61hh357psbq4jxyksv1lpn8nn96a5cm02g81922r3z"; 192 + rev = "8d51a3512fa318393df2bc092e458fd7d6c8e75b"; 193 + sha256 = "0abffydl0h8nnxq5m0vicbi4cxcbfa34m13al7xx0plbk31q3iyd"; 194 194 }; 195 195 meta.homepage = "https://github.com/Yggdroot/LeaderF/"; 196 196 }; ··· 559 559 560 560 ale = buildVimPluginFrom2Nix { 561 561 pname = "ale"; 562 - version = "2023-07-24"; 562 + version = "2023-07-25"; 563 563 src = fetchFromGitHub { 564 564 owner = "dense-analysis"; 565 565 repo = "ale"; 566 - rev = "481c5cccbf48f6df97cfa1489e811438b4f2f088"; 567 - sha256 = "1qf42k28p4im6cm9nizxdkzfxnriw7nbnbcinkyg1i56axm4iz3d"; 566 + rev = "b216892f0c1ce7bbe9efeeb6cf55b52a473f49c2"; 567 + sha256 = "0df56hrqyv1vq19alnpv981fmrb68gx3127izp7pi974r4if87pa"; 568 568 }; 569 569 meta.homepage = "https://github.com/dense-analysis/ale/"; 570 570 }; ··· 967 967 968 968 base46 = buildVimPluginFrom2Nix { 969 969 pname = "base46"; 970 - version = "2023-07-23"; 970 + version = "2023-07-25"; 971 971 src = fetchFromGitHub { 972 972 owner = "nvchad"; 973 973 repo = "base46"; 974 - rev = "4191712e74c44f135a32aeab30576d569bbbded4"; 975 - sha256 = "06sr52pz0904hrb04zpz3q5rddgbbkh8rxsiwyp3ygs8w717ij5g"; 974 + rev = "cb012feef7ce8c0bb8cdcb2b858393aa92834f46"; 975 + sha256 = "1zg0pw2jhx8w21yfky3icai0wq87884ybls34hhn9rwkzn78m4n9"; 976 976 }; 977 977 meta.homepage = "https://github.com/nvchad/base46/"; 978 978 }; ··· 1303 1303 1304 1304 clangd_extensions-nvim = buildVimPluginFrom2Nix { 1305 1305 pname = "clangd_extensions.nvim"; 1306 - version = "2023-07-24"; 1306 + version = "2023-07-25"; 1307 1307 src = fetchFromGitHub { 1308 1308 owner = "p00f"; 1309 1309 repo = "clangd_extensions.nvim"; 1310 - rev = "4a822fca87c40099a4e8b27f396e7b24114b60d0"; 1311 - sha256 = "1jw9hrb4577vn6yx037bd7diklcpkajasw7mv70mdwlxckdvvn02"; 1310 + rev = "b3b0eb798ecbdd16832fd38d4b07ba31ab4fe831"; 1311 + sha256 = "127sb5w8sv5ldx6vgzf7ynkw24wpvpdp7m192fh1qgymlnma8hsy"; 1312 1312 }; 1313 1313 meta.homepage = "https://github.com/p00f/clangd_extensions.nvim/"; 1314 1314 }; ··· 3021 3021 3022 3022 edgy-nvim = buildVimPluginFrom2Nix { 3023 3023 pname = "edgy.nvim"; 3024 - version = "2023-07-01"; 3024 + version = "2023-07-25"; 3025 3025 src = fetchFromGitHub { 3026 3026 owner = "folke"; 3027 3027 repo = "edgy.nvim"; 3028 - rev = "0d3b64f9159442cf9edcad451a0dd9fb7e31bc41"; 3029 - sha256 = "1w43qilfhacnmqr76lp2fkbawbndas180f5ab7h133rwgr64lc7p"; 3028 + rev = "4ccc1c67ae2b1a0c55f18c83d03b714e2bb1bae4"; 3029 + sha256 = "0s0h8s2wwg2niacp401j7l3c0knl44awf32clq15h1hcabqvvkn3"; 3030 3030 }; 3031 3031 meta.homepage = "https://github.com/folke/edgy.nvim/"; 3032 3032 }; ··· 3708 3708 3709 3709 gitsigns-nvim = buildNeovimPlugin { 3710 3710 pname = "gitsigns.nvim"; 3711 - version = "2023-07-18"; 3711 + version = "2023-07-25"; 3712 3712 src = fetchFromGitHub { 3713 3713 owner = "lewis6991"; 3714 3714 repo = "gitsigns.nvim"; 3715 - rev = "adcf2c7f2f495f5df148683764bf7cba6a70f34c"; 3716 - sha256 = "1lhcysi2v51l5hbv7x74wah0hsndfd6c8slg8q4avbyb46wycppr"; 3715 + rev = "11b80e7eea249affc8776483272bcfc627b5552a"; 3716 + sha256 = "0mwmyci65w4rzrvlcws7s6yw4m801vdcqr585harccifyrvpslls"; 3717 3717 }; 3718 3718 meta.homepage = "https://github.com/lewis6991/gitsigns.nvim/"; 3719 3719 }; ··· 3732 3732 3733 3733 glance-nvim = buildVimPluginFrom2Nix { 3734 3734 pname = "glance.nvim"; 3735 - version = "2023-07-23"; 3735 + version = "2023-07-25"; 3736 3736 src = fetchFromGitHub { 3737 3737 owner = "DNLHC"; 3738 3738 repo = "glance.nvim"; 3739 - rev = "866d0f8584c129e071d84138c679d39aa9b5684c"; 3740 - sha256 = "1i2ly61swp25h1vkw2sk7nkkgdbr03qfgqj4j6bd5llyjppypj3q"; 3739 + rev = "3d67c10c422b2d2800761f4f484305540d54450b"; 3740 + sha256 = "186zb2zh4njwy2rxfhmgq0bb3nyfiwf7d289k35qnzw0i7b21wkj"; 3741 3741 }; 3742 3742 meta.homepage = "https://github.com/DNLHC/glance.nvim/"; 3743 3743 }; ··· 3768 3768 3769 3769 go-nvim = buildVimPluginFrom2Nix { 3770 3770 pname = "go.nvim"; 3771 - version = "2023-07-07"; 3771 + version = "2023-07-25"; 3772 3772 src = fetchFromGitHub { 3773 3773 owner = "ray-x"; 3774 3774 repo = "go.nvim"; 3775 - rev = "6550ddf5ce491d17af009c397aceb25310566eaa"; 3776 - sha256 = "01im6m0h7pa04dzh0daxkll5y1i7zf5kxlj01cribghl04zlhdxc"; 3775 + rev = "816fbe43b5dc15edcafa0b32785a4972fb34e67f"; 3776 + sha256 = "0fs3rf3l0dp0141rc0g75alq89z9khjcvhfz7brn291bik7xm56b"; 3777 3777 }; 3778 3778 meta.homepage = "https://github.com/ray-x/go.nvim/"; 3779 3779 }; ··· 5062 5062 5063 5063 lsp_signature-nvim = buildVimPluginFrom2Nix { 5064 5064 pname = "lsp_signature.nvim"; 5065 - version = "2023-06-01"; 5065 + version = "2023-07-25"; 5066 5066 src = fetchFromGitHub { 5067 5067 owner = "ray-x"; 5068 5068 repo = "lsp_signature.nvim"; 5069 - rev = "17ff7a405fea8376b015b8ea7910d2e59958bf68"; 5070 - sha256 = "1qgl3j9a0b3wf381q859xjw0pcfbfxxm0fsdhj7bgfdq11v2q60p"; 5069 + rev = "58d4e810801da74c29313da86075d6aea537501f"; 5070 + sha256 = "14v8mkv3q7l0pv63i3sgiv81bg5yfq927n94nrfz7nwfmg82rxxa"; 5071 5071 }; 5072 5072 meta.homepage = "https://github.com/ray-x/lsp_signature.nvim/"; 5073 5073 }; ··· 5267 5267 5268 5268 mason-nvim = buildVimPluginFrom2Nix { 5269 5269 pname = "mason.nvim"; 5270 - version = "2023-07-21"; 5270 + version = "2023-07-25"; 5271 5271 src = fetchFromGitHub { 5272 5272 owner = "williamboman"; 5273 5273 repo = "mason.nvim"; 5274 - rev = "3f6b544c75c01549f7a2a9e395e0f1cea42b25dd"; 5275 - sha256 = "0sjdxx2lfnaq90vw8n7418bj4dhvk65ksxs7r4mjp0jhygzhssdb"; 5274 + rev = "fe9e34a9ab4d64321cdc3ecab4ea1809239bb73f"; 5275 + sha256 = "1yvf5hml1nhglmfaa0da5mjmgxaysc8x8k1rk820vpj5f1bhl70p"; 5276 5276 }; 5277 5277 meta.homepage = "https://github.com/williamboman/mason.nvim/"; 5278 5278 }; ··· 5363 5363 5364 5364 minimap-vim = buildVimPluginFrom2Nix { 5365 5365 pname = "minimap.vim"; 5366 - version = "2023-07-24"; 5366 + version = "2023-07-25"; 5367 5367 src = fetchFromGitHub { 5368 5368 owner = "wfxr"; 5369 5369 repo = "minimap.vim"; 5370 - rev = "d8c78a8435196e6884cf93360abe76bbf946e6a7"; 5371 - sha256 = "0cs4qhl9siymbpg5xw1g4h2qji2vwzy6s430pm05iyrbdrq92gwy"; 5370 + rev = "74573b63b9ef0583262b6bf6ef209eb7f3b06b94"; 5371 + sha256 = "040z12dxagbfsbkdwpsz6dk2vpak3z737ra5ipb1ljqsswgrj5f9"; 5372 5372 }; 5373 5373 meta.homepage = "https://github.com/wfxr/minimap.vim/"; 5374 5374 }; ··· 5783 5783 5784 5784 neogit = buildVimPluginFrom2Nix { 5785 5785 pname = "neogit"; 5786 - version = "2023-07-23"; 5786 + version = "2023-07-25"; 5787 5787 src = fetchFromGitHub { 5788 5788 owner = "NeogitOrg"; 5789 5789 repo = "neogit"; 5790 - rev = "805a7aa3e5412bbc05c88fb97bef2bc219441098"; 5791 - sha256 = "0i61s5rdbnsak1a4vwx0164hilx7xslhk112yzr6bxbrnmgxw0sl"; 5790 + rev = "e94b15969e65eafbf31749700828cac117cc1336"; 5791 + sha256 = "1anzm10mc94lwnhlcxp4qkxnvf1kwr1bxb4kjq1a2c6v05sx5jfb"; 5792 5792 }; 5793 5793 meta.homepage = "https://github.com/NeogitOrg/neogit/"; 5794 5794 }; ··· 6335 6335 6336 6336 noice-nvim = buildVimPluginFrom2Nix { 6337 6337 pname = "noice.nvim"; 6338 - version = "2023-07-22"; 6338 + version = "2023-07-25"; 6339 6339 src = fetchFromGitHub { 6340 6340 owner = "folke"; 6341 6341 repo = "noice.nvim"; 6342 - rev = "c7969e3c25530087b3a52128030163280a7cf679"; 6343 - sha256 = "0hzn57jsa6ffw9dfyj71pm4r2f1w978qx0s6bk6qv93rrznvjnwz"; 6342 + rev = "894db25ec726d32047799d4d0a982b701bec453b"; 6343 + sha256 = "1vpdl0905vxxbcc354v4g2m2nrpc7fmzpn2yjwgmwz34wacvmik5"; 6344 6344 }; 6345 6345 meta.homepage = "https://github.com/folke/noice.nvim/"; 6346 6346 }; ··· 6743 6743 6744 6744 nvim-fzf = buildVimPluginFrom2Nix { 6745 6745 pname = "nvim-fzf"; 6746 - version = "2022-07-12"; 6746 + version = "2023-07-25"; 6747 6747 src = fetchFromGitHub { 6748 6748 owner = "vijaymarupudi"; 6749 6749 repo = "nvim-fzf"; 6750 - rev = "a8dc4bae4c1e1552e0233df796e512ab9ca65e44"; 6751 - sha256 = "0cyq5rq029hnk9p3qw6gfhxvqiz5m788i4w6n4xxb6wif642bd4l"; 6750 + rev = "45d14cd66c160b199b3c5cef0e7c81793dc2b1e0"; 6751 + sha256 = "1qv7k1nvh61sd24k0c1iayhv3xw9vx14ciqgdmfggl8d4cfvlg21"; 6752 6752 }; 6753 6753 meta.homepage = "https://github.com/vijaymarupudi/nvim-fzf/"; 6754 6754 }; ··· 6935 6935 6936 6936 nvim-lspconfig = buildVimPluginFrom2Nix { 6937 6937 pname = "nvim-lspconfig"; 6938 - version = "2023-07-21"; 6938 + version = "2023-07-25"; 6939 6939 src = fetchFromGitHub { 6940 6940 owner = "neovim"; 6941 6941 repo = "nvim-lspconfig"; 6942 - rev = "dd11ba7b3c8f82d51b6d4dd7d68fce2d78bf78a0"; 6943 - sha256 = "0qkb5bwd6l17j52pi405ma1iq0lidqz300m3322jv8z8fhagp8si"; 6942 + rev = "6f426c34c8e21af2f934e56be9d1198a507ecc9f"; 6943 + sha256 = "167d9df5a3sh69frklk70ff3aw9ks33cc1v6y32iky8i16479zfi"; 6944 6944 }; 6945 6945 meta.homepage = "https://github.com/neovim/nvim-lspconfig/"; 6946 6946 }; ··· 7271 7271 7272 7272 nvim-treesitter = buildVimPluginFrom2Nix { 7273 7273 pname = "nvim-treesitter"; 7274 - version = "2023-07-24"; 7274 + version = "2023-07-25"; 7275 7275 src = fetchFromGitHub { 7276 7276 owner = "nvim-treesitter"; 7277 7277 repo = "nvim-treesitter"; 7278 - rev = "7c1e944311a0d4eb2c8a346661ee4ed207aca514"; 7279 - sha256 = "01aw60dzgj72yk5npwwfgq7l8193kr67yypkyrc6938gdw4p3mqk"; 7278 + rev = "74a7da4e4be5ee71e9efb6d7bdffa16ad620cc57"; 7279 + sha256 = "017fp6rmqqf60br9fzc0xkndxcbq68s092k80ac4p47cqwr3blqn"; 7280 7280 }; 7281 7281 meta.homepage = "https://github.com/nvim-treesitter/nvim-treesitter/"; 7282 7282 }; ··· 7655 7655 7656 7656 orgmode = buildVimPluginFrom2Nix { 7657 7657 pname = "orgmode"; 7658 - version = "2023-07-20"; 7658 + version = "2023-07-25"; 7659 7659 src = fetchFromGitHub { 7660 7660 owner = "nvim-orgmode"; 7661 7661 repo = "orgmode"; 7662 - rev = "b5e12db00e88a9183fd19d9868698d85aec96aca"; 7663 - sha256 = "0w016pgkdcrgjviz1banjnr85fp09kyx7wc8h0xwnlxr16d812lm"; 7662 + rev = "6b6eb8eabbed4d95568fd1f5374a3dff7ed51a3b"; 7663 + sha256 = "1snqqrpck8wgkc67dzcy6y0y9n37sipkaq6fxxy1h71d8363vkwd"; 7664 7664 }; 7665 7665 meta.homepage = "https://github.com/nvim-orgmode/orgmode/"; 7666 7666 }; ··· 8485 8485 8486 8486 sg-nvim = buildVimPluginFrom2Nix { 8487 8487 pname = "sg.nvim"; 8488 - version = "2023-07-24"; 8488 + version = "2023-07-25"; 8489 8489 src = fetchFromGitHub { 8490 8490 owner = "sourcegraph"; 8491 8491 repo = "sg.nvim"; 8492 - rev = "6a59833ea23c7dce49936a71309465ba17e9b661"; 8493 - sha256 = "0fv3rs74gz56vcishxwpjy4rzxbc58c4kpzcapmrg1ia5hrlmgzb"; 8492 + rev = "3fdedc7f14ee3967e2b0a49d51fdef1f92b802af"; 8493 + sha256 = "14lf8izgkr5m0w41k63vp2r2b2ll0zvjkm5c6lqrm3i7cmmln229"; 8494 8494 }; 8495 8495 meta.homepage = "https://github.com/sourcegraph/sg.nvim/"; 8496 8496 }; ··· 9800 9800 9801 9801 trouble-nvim = buildVimPluginFrom2Nix { 9802 9802 pname = "trouble.nvim"; 9803 - version = "2023-07-23"; 9803 + version = "2023-07-25"; 9804 9804 src = fetchFromGitHub { 9805 9805 owner = "folke"; 9806 9806 repo = "trouble.nvim"; 9807 - rev = "0e6703c1d37d2d34ed029ab54f9bd66e3f2ecbf7"; 9808 - sha256 = "1rz22rmv5cg0zr07cwmsh9gxkmfgz4s3ld7g3mnybpxgan251k17"; 9807 + rev = "fc4bb22b1d2cd5eb46fe61a9f6d6416d742beb5c"; 9808 + sha256 = "0mhhjl4q45bn0i22jqri6v3rp24d7l3k2q72ggx5i1xinxls3ap5"; 9809 9809 }; 9810 9810 meta.homepage = "https://github.com/folke/trouble.nvim/"; 9811 9811 }; ··· 15205 15205 15206 15206 wiki-vim = buildVimPluginFrom2Nix { 15207 15207 pname = "wiki.vim"; 15208 - version = "2023-07-20"; 15208 + version = "2023-07-25"; 15209 15209 src = fetchFromGitHub { 15210 15210 owner = "lervag"; 15211 15211 repo = "wiki.vim"; 15212 - rev = "1c733d36026c4f9c9dac742c73a23f24838e6fef"; 15213 - sha256 = "01ff7cj784h2w970hmjmvhbv8f76wla3b1pnhsvrgfl2rlcf6gd9"; 15212 + rev = "4bd7d1b21a0197f11b336cefb434132b5e595dcf"; 15213 + sha256 = "176v8idcjv32q4kywdrr5xqpj849ckcdlvqybv04mhd6wcnq3xzr"; 15214 15214 }; 15215 15215 meta.homepage = "https://github.com/lervag/wiki.vim/"; 15216 15216 }; ··· 15566 15566 15567 15567 lspsaga-nvim-original = buildVimPluginFrom2Nix { 15568 15568 pname = "lspsaga-nvim-original"; 15569 - version = "2023-07-24"; 15569 + version = "2023-07-25"; 15570 15570 src = fetchFromGitHub { 15571 15571 owner = "nvimdev"; 15572 15572 repo = "lspsaga.nvim"; 15573 - rev = "e1e617638b08179273ab2a0161249b9ff57cee0c"; 15574 - sha256 = "158l3qicvx1fi56frn4na6yangjw66mdxdf1n682ambr62fvgcj6"; 15573 + rev = "31b4b4336d05e7c8ff0f833a493de2a2875f1b38"; 15574 + sha256 = "0m426zxd6liah3xfdnxjs289c27z31fw8r0fdw8dvnvgsbhz1a2v"; 15575 15575 }; 15576 15576 meta.homepage = "https://github.com/nvimdev/lspsaga.nvim/"; 15577 15577 }; ··· 15588 15588 meta.homepage = "https://github.com/mattn/calendar-vim/"; 15589 15589 }; 15590 15590 15591 + nightfly = buildVimPluginFrom2Nix { 15592 + pname = "nightfly"; 15593 + version = "2023-07-19"; 15594 + src = fetchFromGitHub { 15595 + owner = "bluz71"; 15596 + repo = "vim-nightfly-colors"; 15597 + rev = "cd68ec3c0a3ca2bf15072dd2040401ea4b89e79f"; 15598 + sha256 = "00nfpkpv0li3wgh926azp8xf1zvdh3zc6fx5aznplhs9j6xbdx21"; 15599 + }; 15600 + meta.homepage = "https://github.com/bluz71/vim-nightfly-colors/"; 15601 + }; 15602 + 15591 15603 nord-vim = buildVimPluginFrom2Nix { 15592 15604 pname = "nord-vim"; 15593 15605 version = "2023-05-03"; ··· 15602 15614 15603 15615 nvchad-extensions = buildVimPluginFrom2Nix { 15604 15616 pname = "nvchad-extensions"; 15605 - version = "2023-07-24"; 15617 + version = "2023-07-25"; 15606 15618 src = fetchFromGitHub { 15607 15619 owner = "nvchad"; 15608 15620 repo = "extensions"; 15609 - rev = "16715bc45900e9771be3656c50801f751a8d9b46"; 15610 - sha256 = "1pjny541m23h4iw8b9wg6dlapa57ffzqlpws6bcsdiw6j91mcpla"; 15621 + rev = "0abb3ead8ce6ffa0e03b596a000d231b5e5d406b"; 15622 + sha256 = "13bngm38j90n21szilc27bpdzgjk4g41a6a8yz1bc60rddxxjxr3"; 15611 15623 }; 15612 15624 meta.homepage = "https://github.com/nvchad/extensions/"; 15613 15625 };
+3 -3
pkgs/applications/editors/vim/plugins/nvim-treesitter/generated.nix
··· 1509 1509 }; 1510 1510 puppet = buildGrammar { 1511 1511 language = "puppet"; 1512 - version = "0.0.0+rev=8e13a37"; 1512 + version = "0.0.0+rev=9ce9a5f"; 1513 1513 src = fetchFromGitHub { 1514 1514 owner = "amaanq"; 1515 1515 repo = "tree-sitter-puppet"; 1516 - rev = "8e13a3768091703ac27ef1e5763e542af7f6dead"; 1517 - hash = "sha256-vBxCqFsSF2kwUK5uNWDPvl7F+mcD8rdTzsckcab4vUU="; 1516 + rev = "9ce9a5f7d64528572aaa8d59459ba869e634086b"; 1517 + hash = "sha256-YEjjy9WLwITERYqoeSVrRYnwVBIAwdc4o0lvAK9wizw="; 1518 1518 }; 1519 1519 meta.homepage = "https://github.com/amaanq/tree-sitter-puppet"; 1520 1520 };
+1 -1
pkgs/applications/editors/vim/plugins/overrides.nix
··· 932 932 pname = "sg-nvim-rust"; 933 933 inherit (old) version src; 934 934 935 - cargoHash = "sha256-wR1QIB4Qqw/b2f7XFbPytDSz/8BtaFep3BZuT0RJ3hg="; 935 + cargoHash = "sha256-KhUCIAGSgf7TxabEzcjo582VgbSU79QSGlaEP7BbJCE="; 936 936 937 937 nativeBuildInputs = [ pkg-config ]; 938 938
+1
pkgs/applications/editors/vim/plugins/vim-plugin-names
··· 1093 1093 https://github.com/nfnty/vim-nftables/,, 1094 1094 https://github.com/kana/vim-niceblock/,, 1095 1095 https://github.com/nickel-lang/vim-nickel/,main, 1096 + https://github.com/bluz71/vim-nightfly-colors/,,nightfly 1096 1097 https://github.com/tommcdo/vim-ninja-feet/,, 1097 1098 https://github.com/LnL7/vim-nix/,, 1098 1099 https://github.com/symphorien/vim-nixhash/,,
+1 -1
pkgs/applications/graphics/digikam/default.nix
··· 54 54 , breeze-icons 55 55 , oxygen 56 56 57 - , cudaSupport ? config.cudaSupport or false 57 + , cudaSupport ? config.cudaSupport 58 58 , cudaPackages ? {} 59 59 }: 60 60
+1 -1
pkgs/applications/misc/blender/default.nix
··· 5 5 , openvdb, libXxf86vm, tbb, alembic 6 6 , zlib, zstd, fftw, opensubdiv, freetype, jemalloc, ocl-icd, addOpenGLRunpath 7 7 , jackaudioSupport ? false, libjack2 8 - , cudaSupport ? config.cudaSupport or false, cudaPackages ? {} 8 + , cudaSupport ? config.cudaSupport, cudaPackages ? { } 9 9 , hipSupport ? false, hip # comes with a significantly larger closure size 10 10 , colladaSupport ? true, opencollada 11 11 , spaceNavSupport ? stdenv.isLinux, libspnav
+2 -2
pkgs/applications/networking/instant-messengers/teamspeak/client.nix
··· 30 30 stdenv.mkDerivation rec { 31 31 pname = "teamspeak-client"; 32 32 33 - version = "3.6.0"; 33 + version = "3.6.1"; 34 34 35 35 src = fetchurl { 36 36 url = "https://files.teamspeak-services.com/releases/client/${version}/TeamSpeak3-Client-linux_${arch}-${version}.run"; 37 - hash = "sha256-ZbElnFoQmXdtCR9lb6eOz4dMzSwpfjC1DvG3VbDoSEA="; 37 + hash = "sha256-j4sgZ+tJpV6ST0yLmbLTLgBxQTcK1LZoEEfMe3TUAC4="; 38 38 }; 39 39 40 40 # grab the plugin sdk for the desktop icon
+32
pkgs/applications/office/libreoffice/0001-Strip-away-BUILDCONFIG.patch
··· 1 + From 982d38084f08950863b55043f36ce5548bd73635 Mon Sep 17 00:00:00 2001 2 + From: Maximilian Bosch <maximilian@mbosch.me> 3 + Date: Mon, 24 Jul 2023 19:12:25 +0200 4 + Subject: [PATCH] Strip away BUILDCONFIG 5 + 6 + The `BuildConfig` field in `libsofficeapp.so` includes the entire 7 + `PKG_CONFIG_PATH` and subsequently references to a lot of `dev` outputs 8 + of library dependencies blowing up the closure. 9 + 10 + Since this is not strictly needed and the inputs are comprehensible via 11 + `nix derivation show`, this doesn't bring a real benefit in the case of 12 + nixpkgs anyways. 13 + --- 14 + desktop/source/lib/init.cxx | 2 +- 15 + 1 file changed, 1 insertion(+), 1 deletion(-) 16 + 17 + diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx 18 + index 8d830c0cbd00..fbdc86aa7115 100644 19 + --- a/desktop/source/lib/init.cxx 20 + +++ b/desktop/source/lib/init.cxx 21 + @@ -7097,7 +7097,7 @@ static char* lo_getVersionInfo(SAL_UNUSED_PARAMETER LibreOfficeKit* /*pThis*/) 22 + "\"ProductVersion\": \"%PRODUCTVERSION\", " 23 + "\"ProductExtension\": \"%PRODUCTEXTENSION\", " 24 + "\"BuildId\": \"%BUILDID\", " 25 + - "\"BuildConfig\": \"" BUILDCONFIG "\" " 26 + + "\"BuildConfig\": \"removed to avoid runtime dependencies against dev outputs of each dependency. Use 'nix derivation show' against the package to find out details about BuildConfig.\" " 27 + "}")); 28 + } 29 + 30 + -- 31 + 2.40.1 32 +
+16
pkgs/applications/office/libreoffice/default.nix
··· 214 214 tar -xf ${srcs.translations} 215 215 ''; 216 216 217 + # Remove build config to reduce the amount of `-dev` outputs in the 218 + # runtime closure. This was introduced in upstream commit 219 + # cbfac11330882c7d0a817b6c37a08b2ace2b66f4, so the patch doesn't apply 220 + # for 7.4. 221 + patches = lib.optionals (lib.versionAtLeast version "7.5") [ 222 + ./0001-Strip-away-BUILDCONFIG.patch 223 + ]; 224 + 225 + # libreoffice tries to reference the BUILDCONFIG (e.g. PKG_CONFIG_PATH) 226 + # in the binary causing the closure size to blow up because of many unnecessary 227 + # dependencies to dev outputs. This behavior was patched away in nixpkgs 228 + # (see above), make sure these don't leak again by accident. 229 + disallowedRequisites = lib.concatMap 230 + (x: lib.optional (x?dev) x.dev) 231 + buildInputs; 232 + 217 233 ### QT/KDE 218 234 # 219 235 # configure.ac assumes that the first directory that contains headers and
+1 -1
pkgs/applications/radio/urh/default.nix
··· 33 33 homepage = "https://github.com/jopohl/urh"; 34 34 description = "Universal Radio Hacker: investigate wireless protocols like a boss"; 35 35 license = licenses.gpl3; 36 - platforms = platforms.linux; 36 + platforms = platforms.unix; 37 37 maintainers = with maintainers; [ fpletz ]; 38 38 }; 39 39 }
+1 -1
pkgs/applications/science/math/caffe/default.nix
··· 13 13 , Accelerate, CoreGraphics, CoreVideo 14 14 , lmdbSupport ? true, lmdb 15 15 , leveldbSupport ? true, leveldb, snappy 16 - , cudaSupport ? config.cudaSupport or false, cudaPackages ? {} 16 + , cudaSupport ? config.cudaSupport, cudaPackages ? { } 17 17 , cudnnSupport ? cudaSupport 18 18 , ncclSupport ? false 19 19 , pythonSupport ? false, python ? null, numpy ? null
+2 -1
pkgs/applications/science/math/cntk/default.nix
··· 2 2 , fetchpatch 3 3 , openblas, blas, lapack, opencv3, libzip, boost, protobuf, mpi 4 4 , onebitSGDSupport ? false 5 - , cudaSupport ? false, cudaPackages ? {}, addOpenGLRunpath, cudatoolkit, nvidia_x11 5 + , config 6 + , cudaSupport ? config.cudaSupport, cudaPackages ? { }, addOpenGLRunpath, cudatoolkit, nvidia_x11 6 7 , cudnnSupport ? cudaSupport 7 8 }: 8 9
+1 -1
pkgs/applications/science/math/mathematica/default.nix
··· 2 2 , config 3 3 , lib 4 4 , cudaPackages 5 - , cudaSupport ? config.cudaSupport or false 5 + , cudaSupport ? config.cudaSupport 6 6 , lang ? "en" 7 7 , webdoc ? false 8 8 , version ? null
+1 -1
pkgs/applications/science/math/mxnet/default.nix
··· 1 1 { config, stdenv, lib, fetchurl, fetchpatch, bash, cmake 2 2 , opencv3, gtest, blas, gomp, llvmPackages, perl 3 - , cudaSupport ? config.cudaSupport or false, cudaPackages ? {}, nvidia_x11 3 + , cudaSupport ? config.cudaSupport, cudaPackages ? { }, nvidia_x11 4 4 , cudnnSupport ? cudaSupport 5 5 }: 6 6
+2 -1
pkgs/applications/science/misc/colmap/default.nix
··· 1 1 { mkDerivation, lib, fetchFromGitHub, cmake, boost179, ceres-solver, eigen, 2 2 freeimage, glog, libGLU, glew, qtbase, 3 - cudaSupport ? false, cudaPackages }: 3 + config, 4 + cudaSupport ? config.cudaSupport, cudaPackages }: 4 5 5 6 assert cudaSupport -> cudaPackages != { }; 6 7
+2 -1
pkgs/applications/science/molecular-dynamics/gromacs/default.nix
··· 1 1 { lib, stdenv, fetchurl, cmake, hwloc, fftw, perl, blas, lapack, mpi, cudatoolkit 2 2 , singlePrec ? true 3 + , config 3 4 , enableMpi ? false 4 - , enableCuda ? false 5 + , enableCuda ? config.cudaSupport 5 6 , cpuAcceleration ? null 6 7 }: 7 8
+3 -3
pkgs/applications/version-management/gex/default.nix
··· 8 8 9 9 rustPlatform.buildRustPackage rec { 10 10 pname = "gex"; 11 - version = "0.5.0"; 11 + version = "0.6.0"; 12 12 13 13 src = fetchFromGitHub { 14 14 owner = "Piturnah"; 15 15 repo = pname; 16 16 rev = "v${version}"; 17 - hash = "sha256-//sQ0s8bBQzuu5aO3RjPRjFuVYiGW6BwSPoCWKAx9DQ="; 17 + hash = "sha256-J2tmDpt4vRFgD5yfFZOdBLROvyZVEthc+MHM1Yta5jI="; 18 18 }; 19 19 20 20 nativeBuildInputs = [ pkg-config ]; 21 21 buildInputs = [ libgit2 ]; 22 22 23 - cargoHash = "sha256-rkhkFnRDtMTWFM+E5C4jR7TWtHdy3WUtIzvGDDLHqtE="; 23 + cargoHash = "sha256-AsUHswR7+wMyAvOp3rkvRJvThHLH993gQ+/V38vbbNQ="; 24 24 25 25 meta = with lib; { 26 26 description = "Git Explorer: cross-platform git workflow improvement tool inspired by Magit";
+2 -2
pkgs/applications/version-management/git-machete/default.nix
··· 12 12 13 13 buildPythonApplication rec { 14 14 pname = "git-machete"; 15 - version = "3.17.6"; 15 + version = "3.17.8"; 16 16 17 17 src = fetchFromGitHub { 18 18 owner = "virtuslab"; 19 19 repo = pname; 20 20 rev = "v${version}"; 21 - hash = "sha256-o3Z1xPu5RcspU4m3Bb6ydZkXOMgOMJPN/+TLekwe/wI="; 21 + hash = "sha256-d1vbLlGKln/zcuuKZgNOcu/z15co3p8ecrwL5lucIEk="; 22 22 }; 23 23 24 24 nativeBuildInputs = [ installShellFiles ];
+80
pkgs/build-support/writers/data.nix
··· 1 + { lib, runCommandNoCC, dasel }: 2 + let 3 + daselBin = lib.getExe dasel; 4 + 5 + inherit (lib) 6 + last 7 + optionalString 8 + types 9 + ; 10 + in 11 + rec { 12 + # Creates a transformer function that writes input data to disk, transformed 13 + # by both the `input` and `output` arguments. 14 + # 15 + # Type: makeDataWriter :: input -> output -> nameOrPath -> data -> (any -> string) -> string -> string -> any -> derivation 16 + # 17 + # input :: T -> string: function that takes the nix data and returns a string 18 + # output :: string: script that takes the $inputFile and write the result into $out 19 + # nameOrPath :: string: if the name contains a / the files gets written to a sub-folder of $out. The derivation name is the basename of this argument. 20 + # data :: T: the data that will be converted. 21 + # 22 + # Example: 23 + # writeJSON = makeDataWriter { input = builtins.toJSON; output = "cp $inputPath $out"; }; 24 + # myConfig = writeJSON "config.json" { hello = "world"; } 25 + # 26 + makeDataWriter = { input ? lib.id, output ? "cp $inputPath $out" }: nameOrPath: data: 27 + assert lib.or (types.path.check nameOrPath) (builtins.match "([0-9A-Za-z._])[0-9A-Za-z._-]*" nameOrPath != null); 28 + let 29 + name = last (builtins.split "/" nameOrPath); 30 + in 31 + runCommandNoCC name 32 + { 33 + input = input data; 34 + passAsFile = [ "input" ]; 35 + } '' 36 + ${output} 37 + 38 + ${optionalString (types.path.check nameOrPath) '' 39 + mv $out tmp 40 + mkdir -p $out/$(dirname "${nameOrPath}") 41 + mv tmp $out/${nameOrPath} 42 + ''} 43 + ''; 44 + 45 + # Writes the content to text. 46 + # 47 + # Example: 48 + # writeText "filename.txt" "file content" 49 + writeText = makeDataWriter { 50 + input = toString; 51 + output = "cp $inputPath $out"; 52 + }; 53 + 54 + # Writes the content to a JSON file. 55 + # 56 + # Example: 57 + # writeJSON "data.json" { hello = "world"; } 58 + writeJSON = makeDataWriter { 59 + input = builtins.toJSON; 60 + output = "${daselBin} -f $inputPath -r json -w json > $out"; 61 + }; 62 + 63 + # Writes the content to a TOML file. 64 + # 65 + # Example: 66 + # writeTOML "data.toml" { hello = "world"; } 67 + writeTOML = makeDataWriter { 68 + input = builtins.toJSON; 69 + output = "${daselBin} -f $inputPath -r json -w toml > $out"; 70 + }; 71 + 72 + # Writes the content to a YAML file. 73 + # 74 + # Example: 75 + # writeYAML "data.yaml" { hello = "world"; } 76 + writeYAML = makeDataWriter { 77 + input = builtins.toJSON; 78 + output = "${daselBin} -f $inputPath -r json -w yaml > $out"; 79 + }; 80 + }
+8 -357
pkgs/build-support/writers/default.nix
··· 1 - { pkgs, config, buildPackages, lib, stdenv, libiconv, mkNugetDeps, mkNugetSource, gixy }: 1 + { pkgs, config, lib }: 2 2 3 3 let 4 4 aliases = if config.allowAliases then (import ./aliases.nix lib) else prev: {}; 5 5 6 - writers = with lib; rec { 7 - # Base implementation for non-compiled executables. 8 - # Takes an interpreter, for example `${pkgs.bash}/bin/bash` 9 - # 10 - # Examples: 11 - # writeBash = makeScriptWriter { interpreter = "${pkgs.bash}/bin/bash"; } 12 - # makeScriptWriter { interpreter = "${pkgs.dash}/bin/dash"; } "hello" "echo hello world" 13 - makeScriptWriter = { interpreter, check ? "" }: nameOrPath: content: 14 - assert lib.or (types.path.check nameOrPath) (builtins.match "([0-9A-Za-z._])[0-9A-Za-z._-]*" nameOrPath != null); 15 - assert lib.or (types.path.check content) (types.str.check content); 16 - let 17 - name = last (builtins.split "/" nameOrPath); 18 - in 19 - 20 - pkgs.runCommandLocal name (if (types.str.check content) then { 21 - inherit content interpreter; 22 - passAsFile = [ "content" ]; 23 - } else { 24 - inherit interpreter; 25 - contentPath = content; 26 - }) '' 27 - # On darwin a script cannot be used as an interpreter in a shebang but 28 - # there doesn't seem to be a limit to the size of shebang and multiple 29 - # arguments to the interpreter are allowed. 30 - if [[ -n "${toString pkgs.stdenvNoCC.isDarwin}" ]] && isScript $interpreter 31 - then 32 - wrapperInterpreterLine=$(head -1 "$interpreter" | tail -c+3) 33 - # Get first word from the line (note: xargs echo remove leading spaces) 34 - wrapperInterpreter=$(echo "$wrapperInterpreterLine" | xargs echo | cut -d " " -f1) 35 - 36 - if isScript $wrapperInterpreter 37 - then 38 - echo "error: passed interpreter ($interpreter) is a script which has another script ($wrapperInterpreter) as an interpreter, which is not supported." 39 - exit 1 40 - fi 41 - 42 - # This should work as long as wrapperInterpreter is a shell, which is 43 - # the case for programs wrapped with makeWrapper, like 44 - # python3.withPackages etc. 45 - interpreterLine="$wrapperInterpreterLine $interpreter" 46 - else 47 - interpreterLine=$interpreter 48 - fi 49 - 50 - echo "#! $interpreterLine" > $out 51 - cat "$contentPath" >> $out 52 - ${optionalString (check != "") '' 53 - ${check} $out 54 - ''} 55 - chmod +x $out 56 - ${optionalString (types.path.check nameOrPath) '' 57 - mv $out tmp 58 - mkdir -p $out/$(dirname "${nameOrPath}") 59 - mv tmp $out/${nameOrPath} 60 - ''} 61 - ''; 62 - 63 - # Base implementation for compiled executables. 64 - # Takes a compile script, which in turn takes the name as an argument. 65 - # 66 - # Examples: 67 - # writeSimpleC = makeBinWriter { compileScript = name: "gcc -o $out $contentPath"; } 68 - makeBinWriter = { compileScript, strip ? true }: nameOrPath: content: 69 - assert lib.or (types.path.check nameOrPath) (builtins.match "([0-9A-Za-z._])[0-9A-Za-z._-]*" nameOrPath != null); 70 - assert lib.or (types.path.check content) (types.str.check content); 71 - let 72 - name = last (builtins.split "/" nameOrPath); 73 - in 74 - pkgs.runCommand name ((if (types.str.check content) then { 75 - inherit content; 76 - passAsFile = [ "content" ]; 77 - } else { 78 - contentPath = content; 79 - }) // lib.optionalAttrs (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) { 80 - # post-link-hook expects codesign_allocate to be in PATH 81 - # https://github.com/NixOS/nixpkgs/issues/154203 82 - # https://github.com/NixOS/nixpkgs/issues/148189 83 - nativeBuildInputs = [ stdenv.cc.bintools ]; 84 - }) '' 85 - ${compileScript} 86 - ${lib.optionalString strip 87 - "${lib.getBin buildPackages.bintools-unwrapped}/bin/${buildPackages.bintools-unwrapped.targetPrefix}strip -S $out"} 88 - # Sometimes binaries produced for darwin (e. g. by GHC) won't be valid 89 - # mach-o executables from the get-go, but need to be corrected somehow 90 - # which is done by fixupPhase. 91 - ${lib.optionalString pkgs.stdenvNoCC.hostPlatform.isDarwin "fixupPhase"} 92 - ${optionalString (types.path.check nameOrPath) '' 93 - mv $out tmp 94 - mkdir -p $out/$(dirname "${nameOrPath}") 95 - mv tmp $out/${nameOrPath} 96 - ''} 97 - ''; 98 - 99 - # Like writeScript but the first line is a shebang to bash 100 - # 101 - # Example: 102 - # writeBash "example" '' 103 - # echo hello world 104 - # '' 105 - writeBash = makeScriptWriter { 106 - interpreter = "${pkgs.bash}/bin/bash"; 6 + # Writers for JSON-like data structures 7 + dataWriters = import ./data.nix { 8 + inherit lib; inherit (pkgs) runCommandNoCC dasel; 107 9 }; 108 10 109 - # Like writeScriptBin but the first line is a shebang to bash 110 - writeBashBin = name: 111 - writeBash "/bin/${name}"; 112 - 113 - # Like writeScript but the first line is a shebang to dash 114 - # 115 - # Example: 116 - # writeDash "example" '' 117 - # echo hello world 118 - # '' 119 - writeDash = makeScriptWriter { 120 - interpreter = "${pkgs.dash}/bin/dash"; 11 + # Writers for scripts 12 + scriptWriters = import ./scripts.nix { 13 + inherit lib pkgs; 121 14 }; 122 15 123 - # Like writeScriptBin but the first line is a shebang to dash 124 - writeDashBin = name: 125 - writeDash "/bin/${name}"; 126 - 127 - # Like writeScript but the first line is a shebang to fish 128 - # 129 - # Example: 130 - # writeFish "example" '' 131 - # echo hello world 132 - # '' 133 - writeFish = makeScriptWriter { 134 - interpreter = "${pkgs.fish}/bin/fish --no-config"; 135 - check = "${pkgs.fish}/bin/fish --no-config --no-execute"; # syntax check only 136 - }; 137 - 138 - # Like writeScriptBin but the first line is a shebang to fish 139 - writeFishBin = name: 140 - writeFish "/bin/${name}"; 141 - 142 - # writeHaskell takes a name, an attrset with libraries and haskell version (both optional) 143 - # and some haskell source code and returns an executable. 144 - # 145 - # Example: 146 - # writeHaskell "missiles" { libraries = [ pkgs.haskellPackages.acme-missiles ]; } '' 147 - # import Acme.Missiles 148 - # 149 - # main = launchMissiles 150 - # ''; 151 - writeHaskell = name: { 152 - libraries ? [], 153 - ghc ? pkgs.ghc, 154 - ghcArgs ? [], 155 - threadedRuntime ? true, 156 - strip ? true 157 - }: 158 - let 159 - appendIfNotSet = el: list: if elem el list then list else list ++ [ el ]; 160 - ghcArgs' = if threadedRuntime then appendIfNotSet "-threaded" ghcArgs else ghcArgs; 161 - 162 - in makeBinWriter { 163 - compileScript = '' 164 - cp $contentPath tmp.hs 165 - ${ghc.withPackages (_: libraries )}/bin/ghc ${lib.escapeShellArgs ghcArgs'} tmp.hs 166 - mv tmp $out 167 - ''; 168 - inherit strip; 169 - } name; 170 - 171 - # writeHaskellBin takes the same arguments as writeHaskell but outputs a directory (like writeScriptBin) 172 - writeHaskellBin = name: 173 - writeHaskell "/bin/${name}"; 174 - 175 - writeRust = name: { 176 - rustc ? pkgs.rustc, 177 - rustcArgs ? [], 178 - strip ? true 179 - }: 180 - let 181 - darwinArgs = lib.optionals stdenv.isDarwin [ "-L${lib.getLib libiconv}/lib" ]; 182 - in 183 - makeBinWriter { 184 - compileScript = '' 185 - cp "$contentPath" tmp.rs 186 - PATH=${makeBinPath [pkgs.gcc]} ${lib.getBin rustc}/bin/rustc ${lib.escapeShellArgs rustcArgs} ${lib.escapeShellArgs darwinArgs} -o "$out" tmp.rs 187 - ''; 188 - inherit strip; 189 - } name; 190 - 191 - writeRustBin = name: 192 - writeRust "/bin/${name}"; 193 - 194 - # writeJS takes a name an attributeset with libraries and some JavaScript sourcecode and 195 - # returns an executable 196 - # 197 - # Example: 198 - # writeJS "example" { libraries = [ pkgs.nodePackages.uglify-js ]; } '' 199 - # var UglifyJS = require("uglify-js"); 200 - # var code = "function add(first, second) { return first + second; }"; 201 - # var result = UglifyJS.minify(code); 202 - # console.log(result.code); 203 - # '' 204 - writeJS = name: { libraries ? [] }: content: 205 - let 206 - node-env = pkgs.buildEnv { 207 - name = "node"; 208 - paths = libraries; 209 - pathsToLink = [ 210 - "/lib/node_modules" 211 - ]; 212 - }; 213 - in writeDash name '' 214 - export NODE_PATH=${node-env}/lib/node_modules 215 - exec ${pkgs.nodejs}/bin/node ${pkgs.writeText "js" content} "$@" 216 - ''; 217 - 218 - # writeJSBin takes the same arguments as writeJS but outputs a directory (like writeScriptBin) 219 - writeJSBin = name: 220 - writeJS "/bin/${name}"; 221 - 222 - awkFormatNginx = builtins.toFile "awkFormat-nginx.awk" '' 223 - awk -f 224 - {sub(/^[ \t]+/,"");idx=0} 225 - /\{/{ctx++;idx=1} 226 - /\}/{ctx--} 227 - {id="";for(i=idx;i<ctx;i++)id=sprintf("%s%s", id, "\t");printf "%s%s\n", id, $0} 228 - ''; 229 - 230 - writeNginxConfig = name: text: pkgs.runCommandLocal name { 231 - inherit text; 232 - passAsFile = [ "text" ]; 233 - nativeBuildInputs = [ gixy ]; 234 - } /* sh */ '' 235 - # nginx-config-formatter has an error - https://github.com/1connect/nginx-config-formatter/issues/16 236 - awk -f ${awkFormatNginx} "$textPath" | sed '/^\s*$/d' > $out 237 - gixy $out 238 - ''; 239 - 240 - # writePerl takes a name an attributeset with libraries and some perl sourcecode and 241 - # returns an executable 242 - # 243 - # Example: 244 - # writePerl "example" { libraries = [ pkgs.perlPackages.boolean ]; } '' 245 - # use boolean; 246 - # print "Howdy!\n" if true; 247 - # '' 248 - writePerl = name: { libraries ? [] }: 249 - makeScriptWriter { 250 - interpreter = "${pkgs.perl.withPackages (p: libraries)}/bin/perl"; 251 - } name; 252 - 253 - # writePerlBin takes the same arguments as writePerl but outputs a directory (like writeScriptBin) 254 - writePerlBin = name: 255 - writePerl "/bin/${name}"; 256 - 257 - # makePythonWriter takes python and compatible pythonPackages and produces python script writer, 258 - # which validates the script with flake8 at build time. If any libraries are specified, 259 - # python.withPackages is used as interpreter, otherwise the "bare" python is used. 260 - makePythonWriter = python: pythonPackages: buildPythonPackages: name: { libraries ? [], flakeIgnore ? [] }: 261 - let 262 - ignoreAttribute = optionalString (flakeIgnore != []) "--ignore ${concatMapStringsSep "," escapeShellArg flakeIgnore}"; 263 - in 264 - makeScriptWriter { 265 - interpreter = 266 - if libraries == [] 267 - then python.interpreter 268 - else (python.withPackages (ps: libraries)).interpreter 269 - ; 270 - check = optionalString python.isPy3k (writeDash "pythoncheck.sh" '' 271 - exec ${buildPythonPackages.flake8}/bin/flake8 --show-source ${ignoreAttribute} "$1" 272 - ''); 273 - } name; 274 - 275 - # writePyPy2 takes a name an attributeset with libraries and some pypy2 sourcecode and 276 - # returns an executable 277 - # 278 - # Example: 279 - # writePyPy2 "test_pypy2" { libraries = [ pkgs.pypy2Packages.enum ]; } '' 280 - # from enum import Enum 281 - # 282 - # class Test(Enum): 283 - # a = "success" 284 - # 285 - # print Test.a 286 - # '' 287 - writePyPy2 = makePythonWriter pkgs.pypy2 pkgs.pypy2Packages buildPackages.pypy2Packages; 288 - 289 - # writePyPy2Bin takes the same arguments as writePyPy2 but outputs a directory (like writeScriptBin) 290 - writePyPy2Bin = name: 291 - writePyPy2 "/bin/${name}"; 292 - 293 - # writePython3 takes a name an attributeset with libraries and some python3 sourcecode and 294 - # returns an executable 295 - # 296 - # Example: 297 - # writePython3 "test_python3" { libraries = [ pkgs.python3Packages.pyyaml ]; } '' 298 - # import yaml 299 - # 300 - # y = yaml.load(""" 301 - # - test: success 302 - # """) 303 - # print(y[0]['test']) 304 - # '' 305 - writePython3 = makePythonWriter pkgs.python3 pkgs.python3Packages buildPackages.python3Packages; 306 - 307 - # writePython3Bin takes the same arguments as writePython3 but outputs a directory (like writeScriptBin) 308 - writePython3Bin = name: 309 - writePython3 "/bin/${name}"; 310 - 311 - # writePyPy3 takes a name an attributeset with libraries and some pypy3 sourcecode and 312 - # returns an executable 313 - # 314 - # Example: 315 - # writePyPy3 "test_pypy3" { libraries = [ pkgs.pypy3Packages.pyyaml ]; } '' 316 - # import yaml 317 - # 318 - # y = yaml.load(""" 319 - # - test: success 320 - # """) 321 - # print(y[0]['test']) 322 - # '' 323 - writePyPy3 = makePythonWriter pkgs.pypy3 pkgs.pypy3Packages buildPackages.pypy3Packages; 324 - 325 - # writePyPy3Bin takes the same arguments as writePyPy3 but outputs a directory (like writeScriptBin) 326 - writePyPy3Bin = name: 327 - writePyPy3 "/bin/${name}"; 328 - 329 - 330 - makeFSharpWriter = { dotnet-sdk ? pkgs.dotnet-sdk, fsi-flags ? "", libraries ? _: [] }: nameOrPath: 331 - let 332 - fname = last (builtins.split "/" nameOrPath); 333 - path = if strings.hasSuffix ".fsx" nameOrPath then nameOrPath else "${nameOrPath}.fsx"; 334 - _nugetDeps = mkNugetDeps { name = "${fname}-nuget-deps"; nugetDeps = libraries; }; 335 - 336 - nuget-source = mkNugetSource { 337 - name = "${fname}-nuget-source"; 338 - description = "A Nuget source with the dependencies for ${fname}"; 339 - deps = [ _nugetDeps ]; 340 - }; 341 - 342 - fsi = writeBash "fsi" '' 343 - export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 344 - export DOTNET_CLI_TELEMETRY_OPTOUT=1 345 - export DOTNET_NOLOGO=1 346 - script="$1"; shift 347 - ${dotnet-sdk}/bin/dotnet fsi --quiet --nologo --readline- ${fsi-flags} "$@" < "$script" 348 - ''; 349 - 350 - in content: writers.makeScriptWriter { 351 - interpreter = fsi; 352 - } path 353 - '' 354 - #i "nuget: ${nuget-source}/lib" 355 - ${ content } 356 - exit 0 357 - ''; 358 - 359 - writeFSharp = 360 - makeFSharpWriter {}; 361 - 362 - writeFSharpBin = name: 363 - writeFSharp "/bin/${name}"; 364 - 365 - }; 16 + writers = scriptWriters // dataWriters; 366 17 in 367 18 writers // (aliases writers)
+383
pkgs/build-support/writers/scripts.nix
··· 1 + { pkgs, lib }: 2 + let 3 + inherit (lib) 4 + concatMapStringsSep 5 + elem 6 + escapeShellArg 7 + last 8 + optionalString 9 + stringLength 10 + strings 11 + types 12 + ; 13 + 14 + inherit (pkgs) 15 + buildPackages 16 + gixy 17 + libiconv 18 + mkNugetDeps 19 + mkNugetSource 20 + stdenv 21 + ; 22 + in 23 + rec { 24 + # Base implementation for non-compiled executables. 25 + # Takes an interpreter, for example `${pkgs.bash}/bin/bash` 26 + # 27 + # Examples: 28 + # writeBash = makeScriptWriter { interpreter = "${pkgs.bash}/bin/bash"; } 29 + # makeScriptWriter { interpreter = "${pkgs.dash}/bin/dash"; } "hello" "echo hello world" 30 + makeScriptWriter = { interpreter, check ? "" }: nameOrPath: content: 31 + assert lib.or (types.path.check nameOrPath) (builtins.match "([0-9A-Za-z._])[0-9A-Za-z._-]*" nameOrPath != null); 32 + assert lib.or (types.path.check content) (types.str.check content); 33 + let 34 + name = last (builtins.split "/" nameOrPath); 35 + in 36 + 37 + pkgs.runCommandLocal name (if (types.str.check content) then { 38 + inherit content interpreter; 39 + passAsFile = [ "content" ]; 40 + } else { 41 + inherit interpreter; 42 + contentPath = content; 43 + }) '' 44 + # On darwin a script cannot be used as an interpreter in a shebang but 45 + # there doesn't seem to be a limit to the size of shebang and multiple 46 + # arguments to the interpreter are allowed. 47 + if [[ -n "${toString pkgs.stdenvNoCC.isDarwin}" ]] && isScript $interpreter 48 + then 49 + wrapperInterpreterLine=$(head -1 "$interpreter" | tail -c+3) 50 + # Get first word from the line (note: xargs echo remove leading spaces) 51 + wrapperInterpreter=$(echo "$wrapperInterpreterLine" | xargs echo | cut -d " " -f1) 52 + 53 + if isScript $wrapperInterpreter 54 + then 55 + echo "error: passed interpreter ($interpreter) is a script which has another script ($wrapperInterpreter) as an interpreter, which is not supported." 56 + exit 1 57 + fi 58 + 59 + # This should work as long as wrapperInterpreter is a shell, which is 60 + # the case for programs wrapped with makeWrapper, like 61 + # python3.withPackages etc. 62 + interpreterLine="$wrapperInterpreterLine $interpreter" 63 + else 64 + interpreterLine=$interpreter 65 + fi 66 + 67 + echo "#! $interpreterLine" > $out 68 + cat "$contentPath" >> $out 69 + ${optionalString (check != "") '' 70 + ${check} $out 71 + ''} 72 + chmod +x $out 73 + ${optionalString (types.path.check nameOrPath) '' 74 + mv $out tmp 75 + mkdir -p $out/$(dirname "${nameOrPath}") 76 + mv tmp $out/${nameOrPath} 77 + ''} 78 + ''; 79 + 80 + # Base implementation for compiled executables. 81 + # Takes a compile script, which in turn takes the name as an argument. 82 + # 83 + # Examples: 84 + # writeSimpleC = makeBinWriter { compileScript = name: "gcc -o $out $contentPath"; } 85 + makeBinWriter = { compileScript, strip ? true }: nameOrPath: content: 86 + assert lib.or (types.path.check nameOrPath) (builtins.match "([0-9A-Za-z._])[0-9A-Za-z._-]*" nameOrPath != null); 87 + assert lib.or (types.path.check content) (types.str.check content); 88 + let 89 + name = last (builtins.split "/" nameOrPath); 90 + in 91 + pkgs.runCommand name ((if (types.str.check content) then { 92 + inherit content; 93 + passAsFile = [ "content" ]; 94 + } else { 95 + contentPath = content; 96 + }) // lib.optionalAttrs (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) { 97 + # post-link-hook expects codesign_allocate to be in PATH 98 + # https://github.com/NixOS/nixpkgs/issues/154203 99 + # https://github.com/NixOS/nixpkgs/issues/148189 100 + nativeBuildInputs = [ stdenv.cc.bintools ]; 101 + }) '' 102 + ${compileScript} 103 + ${lib.optionalString strip 104 + "${lib.getBin buildPackages.bintools-unwrapped}/bin/${buildPackages.bintools-unwrapped.targetPrefix}strip -S $out"} 105 + # Sometimes binaries produced for darwin (e. g. by GHC) won't be valid 106 + # mach-o executables from the get-go, but need to be corrected somehow 107 + # which is done by fixupPhase. 108 + ${lib.optionalString pkgs.stdenvNoCC.hostPlatform.isDarwin "fixupPhase"} 109 + ${optionalString (types.path.check nameOrPath) '' 110 + mv $out tmp 111 + mkdir -p $out/$(dirname "${nameOrPath}") 112 + mv tmp $out/${nameOrPath} 113 + ''} 114 + ''; 115 + 116 + # Like writeScript but the first line is a shebang to bash 117 + # 118 + # Example: 119 + # writeBash "example" '' 120 + # echo hello world 121 + # '' 122 + writeBash = makeScriptWriter { 123 + interpreter = "${pkgs.bash}/bin/bash"; 124 + }; 125 + 126 + # Like writeScriptBin but the first line is a shebang to bash 127 + writeBashBin = name: 128 + writeBash "/bin/${name}"; 129 + 130 + # Like writeScript but the first line is a shebang to dash 131 + # 132 + # Example: 133 + # writeDash "example" '' 134 + # echo hello world 135 + # '' 136 + writeDash = makeScriptWriter { 137 + interpreter = "${pkgs.dash}/bin/dash"; 138 + }; 139 + 140 + # Like writeScriptBin but the first line is a shebang to dash 141 + writeDashBin = name: 142 + writeDash "/bin/${name}"; 143 + 144 + # Like writeScript but the first line is a shebang to fish 145 + # 146 + # Example: 147 + # writeFish "example" '' 148 + # echo hello world 149 + # '' 150 + writeFish = makeScriptWriter { 151 + interpreter = "${pkgs.fish}/bin/fish --no-config"; 152 + check = "${pkgs.fish}/bin/fish --no-config --no-execute"; # syntax check only 153 + }; 154 + 155 + # Like writeScriptBin but the first line is a shebang to fish 156 + writeFishBin = name: 157 + writeFish "/bin/${name}"; 158 + 159 + # writeHaskell takes a name, an attrset with libraries and haskell version (both optional) 160 + # and some haskell source code and returns an executable. 161 + # 162 + # Example: 163 + # writeHaskell "missiles" { libraries = [ pkgs.haskellPackages.acme-missiles ]; } '' 164 + # import Acme.Missiles 165 + # 166 + # main = launchMissiles 167 + # ''; 168 + writeHaskell = name: { 169 + libraries ? [], 170 + ghc ? pkgs.ghc, 171 + ghcArgs ? [], 172 + threadedRuntime ? true, 173 + strip ? true 174 + }: 175 + let 176 + appendIfNotSet = el: list: if elem el list then list else list ++ [ el ]; 177 + ghcArgs' = if threadedRuntime then appendIfNotSet "-threaded" ghcArgs else ghcArgs; 178 + 179 + in makeBinWriter { 180 + compileScript = '' 181 + cp $contentPath tmp.hs 182 + ${ghc.withPackages (_: libraries )}/bin/ghc ${lib.escapeShellArgs ghcArgs'} tmp.hs 183 + mv tmp $out 184 + ''; 185 + inherit strip; 186 + } name; 187 + 188 + # writeHaskellBin takes the same arguments as writeHaskell but outputs a directory (like writeScriptBin) 189 + writeHaskellBin = name: 190 + writeHaskell "/bin/${name}"; 191 + 192 + writeRust = name: { 193 + rustc ? pkgs.rustc, 194 + rustcArgs ? [], 195 + strip ? true 196 + }: 197 + let 198 + darwinArgs = lib.optionals stdenv.isDarwin [ "-L${lib.getLib libiconv}/lib" ]; 199 + in 200 + makeBinWriter { 201 + compileScript = '' 202 + cp "$contentPath" tmp.rs 203 + PATH=${lib.makeBinPath [pkgs.gcc]} ${lib.getBin rustc}/bin/rustc ${lib.escapeShellArgs rustcArgs} ${lib.escapeShellArgs darwinArgs} -o "$out" tmp.rs 204 + ''; 205 + inherit strip; 206 + } name; 207 + 208 + writeRustBin = name: 209 + writeRust "/bin/${name}"; 210 + 211 + # writeJS takes a name an attributeset with libraries and some JavaScript sourcecode and 212 + # returns an executable 213 + # 214 + # Example: 215 + # writeJS "example" { libraries = [ pkgs.nodePackages.uglify-js ]; } '' 216 + # var UglifyJS = require("uglify-js"); 217 + # var code = "function add(first, second) { return first + second; }"; 218 + # var result = UglifyJS.minify(code); 219 + # console.log(result.code); 220 + # '' 221 + writeJS = name: { libraries ? [] }: content: 222 + let 223 + node-env = pkgs.buildEnv { 224 + name = "node"; 225 + paths = libraries; 226 + pathsToLink = [ 227 + "/lib/node_modules" 228 + ]; 229 + }; 230 + in writeDash name '' 231 + export NODE_PATH=${node-env}/lib/node_modules 232 + exec ${pkgs.nodejs}/bin/node ${pkgs.writeText "js" content} "$@" 233 + ''; 234 + 235 + # writeJSBin takes the same arguments as writeJS but outputs a directory (like writeScriptBin) 236 + writeJSBin = name: 237 + writeJS "/bin/${name}"; 238 + 239 + awkFormatNginx = builtins.toFile "awkFormat-nginx.awk" '' 240 + awk -f 241 + {sub(/^[ \t]+/,"");idx=0} 242 + /\{/{ctx++;idx=1} 243 + /\}/{ctx--} 244 + {id="";for(i=idx;i<ctx;i++)id=sprintf("%s%s", id, "\t");printf "%s%s\n", id, $0} 245 + ''; 246 + 247 + writeNginxConfig = name: text: pkgs.runCommandLocal name { 248 + inherit text; 249 + passAsFile = [ "text" ]; 250 + nativeBuildInputs = [ gixy ]; 251 + } /* sh */ '' 252 + # nginx-config-formatter has an error - https://github.com/1connect/nginx-config-formatter/issues/16 253 + awk -f ${awkFormatNginx} "$textPath" | sed '/^\s*$/d' > $out 254 + gixy $out 255 + ''; 256 + 257 + # writePerl takes a name an attributeset with libraries and some perl sourcecode and 258 + # returns an executable 259 + # 260 + # Example: 261 + # writePerl "example" { libraries = [ pkgs.perlPackages.boolean ]; } '' 262 + # use boolean; 263 + # print "Howdy!\n" if true; 264 + # '' 265 + writePerl = name: { libraries ? [] }: 266 + makeScriptWriter { 267 + interpreter = "${pkgs.perl.withPackages (p: libraries)}/bin/perl"; 268 + } name; 269 + 270 + # writePerlBin takes the same arguments as writePerl but outputs a directory (like writeScriptBin) 271 + writePerlBin = name: 272 + writePerl "/bin/${name}"; 273 + 274 + # makePythonWriter takes python and compatible pythonPackages and produces python script writer, 275 + # which validates the script with flake8 at build time. If any libraries are specified, 276 + # python.withPackages is used as interpreter, otherwise the "bare" python is used. 277 + makePythonWriter = python: pythonPackages: buildPythonPackages: name: { libraries ? [], flakeIgnore ? [] }: 278 + let 279 + ignoreAttribute = optionalString (flakeIgnore != []) "--ignore ${concatMapStringsSep "," escapeShellArg flakeIgnore}"; 280 + in 281 + makeScriptWriter { 282 + interpreter = 283 + if libraries == [] 284 + then python.interpreter 285 + else (python.withPackages (ps: libraries)).interpreter 286 + ; 287 + check = optionalString python.isPy3k (writeDash "pythoncheck.sh" '' 288 + exec ${buildPythonPackages.flake8}/bin/flake8 --show-source ${ignoreAttribute} "$1" 289 + ''); 290 + } name; 291 + 292 + # writePyPy2 takes a name an attributeset with libraries and some pypy2 sourcecode and 293 + # returns an executable 294 + # 295 + # Example: 296 + # writePyPy2 "test_pypy2" { libraries = [ pkgs.pypy2Packages.enum ]; } '' 297 + # from enum import Enum 298 + # 299 + # class Test(Enum): 300 + # a = "success" 301 + # 302 + # print Test.a 303 + # '' 304 + writePyPy2 = makePythonWriter pkgs.pypy2 pkgs.pypy2Packages buildPackages.pypy2Packages; 305 + 306 + # writePyPy2Bin takes the same arguments as writePyPy2 but outputs a directory (like writeScriptBin) 307 + writePyPy2Bin = name: 308 + writePyPy2 "/bin/${name}"; 309 + 310 + # writePython3 takes a name an attributeset with libraries and some python3 sourcecode and 311 + # returns an executable 312 + # 313 + # Example: 314 + # writePython3 "test_python3" { libraries = [ pkgs.python3Packages.pyyaml ]; } '' 315 + # import yaml 316 + # 317 + # y = yaml.load(""" 318 + # - test: success 319 + # """) 320 + # print(y[0]['test']) 321 + # '' 322 + writePython3 = makePythonWriter pkgs.python3 pkgs.python3Packages buildPackages.python3Packages; 323 + 324 + # writePython3Bin takes the same arguments as writePython3 but outputs a directory (like writeScriptBin) 325 + writePython3Bin = name: 326 + writePython3 "/bin/${name}"; 327 + 328 + # writePyPy3 takes a name an attributeset with libraries and some pypy3 sourcecode and 329 + # returns an executable 330 + # 331 + # Example: 332 + # writePyPy3 "test_pypy3" { libraries = [ pkgs.pypy3Packages.pyyaml ]; } '' 333 + # import yaml 334 + # 335 + # y = yaml.load(""" 336 + # - test: success 337 + # """) 338 + # print(y[0]['test']) 339 + # '' 340 + writePyPy3 = makePythonWriter pkgs.pypy3 pkgs.pypy3Packages buildPackages.pypy3Packages; 341 + 342 + # writePyPy3Bin takes the same arguments as writePyPy3 but outputs a directory (like writeScriptBin) 343 + writePyPy3Bin = name: 344 + writePyPy3 "/bin/${name}"; 345 + 346 + 347 + makeFSharpWriter = { dotnet-sdk ? pkgs.dotnet-sdk, fsi-flags ? "", libraries ? _: [] }: nameOrPath: 348 + let 349 + fname = last (builtins.split "/" nameOrPath); 350 + path = if strings.hasSuffix ".fsx" nameOrPath then nameOrPath else "${nameOrPath}.fsx"; 351 + _nugetDeps = mkNugetDeps { name = "${fname}-nuget-deps"; nugetDeps = libraries; }; 352 + 353 + nuget-source = mkNugetSource { 354 + name = "${fname}-nuget-source"; 355 + description = "A Nuget source with the dependencies for ${fname}"; 356 + deps = [ _nugetDeps ]; 357 + }; 358 + 359 + fsi = writeBash "fsi" '' 360 + export HOME=$NIX_BUILD_TOP/.home 361 + export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 362 + export DOTNET_CLI_TELEMETRY_OPTOUT=1 363 + export DOTNET_NOLOGO=1 364 + script="$1"; shift 365 + ${dotnet-sdk}/bin/dotnet fsi --quiet --nologo --readline- ${fsi-flags} "$@" < "$script" 366 + ''; 367 + 368 + in content: makeScriptWriter { 369 + interpreter = fsi; 370 + } path 371 + '' 372 + #i "nuget: ${nuget-source}/lib" 373 + ${ content } 374 + exit 0 375 + ''; 376 + 377 + writeFSharp = 378 + makeFSharpWriter {}; 379 + 380 + writeFSharpBin = name: 381 + writeFSharp "/bin/${name}"; 382 + 383 + }
+112 -82
pkgs/build-support/writers/test.nix
··· 12 12 }: 13 13 with writers; 14 14 let 15 + expectSuccess = test: 16 + runCommand "run-${test.name}" {} '' 17 + if [[ "$(${test})" != success ]]; then 18 + echo 'test ${test.name} failed' 19 + exit 1 20 + fi 15 21 16 - bin = { 17 - bash = writeBashBin "test-writers-bash-bin" '' 18 - if [[ "test" == "test" ]]; then echo "success"; fi 22 + touch $out 23 + ''; 24 + 25 + expectSuccessBin = test: 26 + runCommand "run-${test.name}" {} '' 27 + if [[ "$(${lib.getExe test})" != success ]]; then 28 + echo 'test ${test.name} failed' 29 + exit 1 30 + fi 31 + 32 + touch $out 33 + ''; 34 + 35 + expectDataEqual = { file, expected }: 36 + let 37 + expectedFile = writeText "${file.name}-expected" expected; 38 + in 39 + runCommand "run-${file.name}" {} '' 40 + if ! diff -u ${file} ${expectedFile}; then 41 + echo 'test ${file.name} failed' 42 + exit 1 43 + fi 44 + 45 + touch $out 19 46 ''; 47 + in 48 + lib.recurseIntoAttrs { 49 + bin = lib.recurseIntoAttrs { 50 + bash = expectSuccessBin (writeBashBin "test-writers-bash-bin" '' 51 + if [[ "test" == "test" ]]; then echo "success"; fi 52 + ''); 20 53 21 - dash = writeDashBin "test-writers-dash-bin" '' 54 + dash = expectSuccessBin (writeDashBin "test-writers-dash-bin" '' 22 55 test '~' = '~' && echo 'success' 23 - ''; 56 + ''); 24 57 25 - fish = writeFishBin "test-writers-fish-bin" '' 58 + fish = expectSuccessBin (writeFishBin "test-writers-fish-bin" '' 26 59 if test "test" = "test" 27 60 echo "success" 28 61 end 29 - ''; 62 + ''); 30 63 31 - rust = writeRustBin "test-writers-rust-bin" {} '' 64 + rust = expectSuccessBin (writeRustBin "test-writers-rust-bin" {} '' 32 65 fn main(){ 33 66 println!("success") 34 67 } 35 - ''; 68 + ''); 36 69 37 - haskell = writeHaskellBin "test-writers-haskell-bin" { libraries = [ haskellPackages.acme-default ]; } '' 70 + haskell = expectSuccessBin (writeHaskellBin "test-writers-haskell-bin" { libraries = [ haskellPackages.acme-default ]; } '' 38 71 import Data.Default 39 72 40 73 int :: Int ··· 44 77 main = case int of 45 78 18871 -> putStrLn $ id "success" 46 79 _ -> print "fail" 47 - ''; 80 + ''); 48 81 49 - js = writeJSBin "test-writers-js-bin" { libraries = [ nodePackages.semver ]; } '' 82 + js = expectSuccessBin (writeJSBin "test-writers-js-bin" { libraries = [ nodePackages.semver ]; } '' 50 83 var semver = require('semver'); 51 84 52 85 if (semver.valid('1.2.3')) { ··· 54 87 } else { 55 88 console.log('fail') 56 89 } 57 - ''; 90 + ''); 58 91 59 - perl = writePerlBin "test-writers-perl-bin" { libraries = [ perlPackages.boolean ]; } '' 92 + perl = expectSuccessBin (writePerlBin "test-writers-perl-bin" { libraries = [ perlPackages.boolean ]; } '' 60 93 use boolean; 61 94 print "success\n" if true; 62 - ''; 95 + ''); 63 96 64 - pypy2 = writePyPy2Bin "test-writers-pypy2-bin" { libraries = [ pypy2Packages.enum ]; } '' 97 + pypy2 = expectSuccessBin (writePyPy2Bin "test-writers-pypy2-bin" { libraries = [ pypy2Packages.enum ]; } '' 65 98 from enum import Enum 66 - 67 99 68 100 class Test(Enum): 69 101 a = "success" 70 - 71 102 72 103 print Test.a 73 - ''; 104 + ''); 74 105 75 - python3 = writePython3Bin "test-writers-python3-bin" { libraries = [ python3Packages.pyyaml ]; } '' 106 + python3 = expectSuccessBin (writePython3Bin "test-writers-python3-bin" { libraries = [ python3Packages.pyyaml ]; } '' 76 107 import yaml 77 108 78 - y = yaml.load(""" 109 + y = yaml.safe_load(""" 79 110 - test: success 80 111 """) 81 112 print(y[0]['test']) 82 - ''; 113 + ''); 83 114 84 - pypy3 = writePyPy3Bin "test-writers-pypy3-bin" { libraries = [ pypy3Packages.pyyaml ]; } '' 115 + pypy3 = expectSuccessBin (writePyPy3Bin "test-writers-pypy3-bin" { libraries = [ pypy3Packages.pyyaml ]; } '' 85 116 import yaml 86 117 87 - y = yaml.load(""" 118 + y = yaml.safe_load(""" 88 119 - test: success 89 120 """) 90 121 print(y[0]['test']) 91 - ''; 122 + ''); 92 123 }; 93 124 94 - simple = { 95 - bash = writeBash "test-writers-bash" '' 125 + simple = lib.recurseIntoAttrs { 126 + bash = expectSuccess (writeBash "test-writers-bash" '' 96 127 if [[ "test" == "test" ]]; then echo "success"; fi 97 - ''; 128 + ''); 98 129 99 - dash = writeDash "test-writers-dash" '' 130 + dash = expectSuccess (writeDash "test-writers-dash" '' 100 131 test '~' = '~' && echo 'success' 101 - ''; 132 + ''); 102 133 103 - fish = writeFish "test-writers-fish" '' 134 + fish = expectSuccess (writeFish "test-writers-fish" '' 104 135 if test "test" = "test" 105 136 echo "success" 106 137 end 107 - ''; 138 + ''); 108 139 109 - haskell = writeHaskell "test-writers-haskell" { libraries = [ haskellPackages.acme-default ]; } '' 140 + haskell = expectSuccess (writeHaskell "test-writers-haskell" { libraries = [ haskellPackages.acme-default ]; } '' 110 141 import Data.Default 111 142 112 143 int :: Int ··· 116 147 main = case int of 117 148 18871 -> putStrLn $ id "success" 118 149 _ -> print "fail" 119 - ''; 150 + ''); 120 151 121 - js = writeJS "test-writers-js" { libraries = [ nodePackages.semver ]; } '' 152 + js = expectSuccess (writeJS "test-writers-js" { libraries = [ nodePackages.semver ]; } '' 122 153 var semver = require('semver'); 123 154 124 155 if (semver.valid('1.2.3')) { ··· 126 157 } else { 127 158 console.log('fail') 128 159 } 129 - ''; 160 + ''); 130 161 131 - perl = writePerl "test-writers-perl" { libraries = [ perlPackages.boolean ]; } '' 162 + perl = expectSuccess (writePerl "test-writers-perl" { libraries = [ perlPackages.boolean ]; } '' 132 163 use boolean; 133 164 print "success\n" if true; 134 - ''; 165 + ''); 135 166 136 - pypy2 = writePyPy2 "test-writers-pypy2" { libraries = [ pypy2Packages.enum ]; } '' 167 + pypy2 = expectSuccess (writePyPy2 "test-writers-pypy2" { libraries = [ pypy2Packages.enum ]; } '' 137 168 from enum import Enum 138 - 139 169 140 170 class Test(Enum): 141 171 a = "success" 142 172 143 - 144 173 print Test.a 145 - ''; 174 + ''); 146 175 147 - python3 = writePython3 "test-writers-python3" { libraries = [ python3Packages.pyyaml ]; } '' 176 + python3 = expectSuccess (writePython3 "test-writers-python3" { libraries = [ python3Packages.pyyaml ]; } '' 148 177 import yaml 149 178 150 - y = yaml.load(""" 179 + y = yaml.safe_load(""" 151 180 - test: success 152 181 """) 153 182 print(y[0]['test']) 154 - ''; 183 + ''); 155 184 156 - pypy3 = writePyPy3 "test-writers-pypy3" { libraries = [ pypy3Packages.pyyaml ]; } '' 185 + pypy3 = expectSuccess (writePyPy3 "test-writers-pypy3" { libraries = [ pypy3Packages.pyyaml ]; } '' 157 186 import yaml 158 187 159 - y = yaml.load(""" 188 + y = yaml.safe_load(""" 160 189 - test: success 161 190 """) 162 191 print(y[0]['test']) 163 - ''; 192 + ''); 164 193 165 - fsharp = makeFSharpWriter { 194 + fsharp = expectSuccess (makeFSharpWriter { 166 195 libraries = { fetchNuGet }: [ 167 196 (fetchNuGet { pname = "FSharp.SystemTextJson"; version = "0.17.4"; sha256 = "1bplzc9ybdqspii4q28l8gmfvzpkmgq5l1hlsiyg2h46w881lwg2"; }) 168 197 ]; ··· 183 212 then "success" 184 213 else "failed" 185 214 |> printfn "%s" 186 - ''; 215 + ''); 187 216 188 - pypy2NoLibs = writePyPy2 "test-writers-pypy2-no-libs" {} '' 217 + pypy2NoLibs = expectSuccess (writePyPy2 "test-writers-pypy2-no-libs" {} '' 189 218 print("success") 190 - ''; 219 + ''); 191 220 192 - python3NoLibs = writePython3 "test-writers-python3-no-libs" {} '' 221 + python3NoLibs = expectSuccess (writePython3 "test-writers-python3-no-libs" {} '' 193 222 print("success") 194 - ''; 223 + ''); 195 224 196 - pypy3NoLibs = writePyPy3 "test-writers-pypy3-no-libs" {} '' 225 + pypy3NoLibs = expectSuccess (writePyPy3 "test-writers-pypy3-no-libs" {} '' 197 226 print("success") 198 - ''; 227 + ''); 199 228 200 - fsharpNoNugetDeps = writeFSharp "test-writers-fsharp-no-nuget-deps" '' 229 + fsharpNoNugetDeps = expectSuccess (writeFSharp "test-writers-fsharp-no-nuget-deps" '' 201 230 printfn "success" 202 - ''; 231 + ''); 203 232 }; 204 233 205 - 206 - path = { 207 - bash = writeBash "test-writers-bash-path" (writeText "test" '' 234 + path = lib.recurseIntoAttrs { 235 + bash = expectSuccess (writeBash "test-writers-bash-path" (writeText "test" '' 208 236 if [[ "test" == "test" ]]; then echo "success"; fi 209 - ''); 210 - haskell = writeHaskell "test-writers-haskell-path" { libraries = [ haskellPackages.acme-default ]; } (writeText "test" '' 237 + '')); 238 + 239 + haskell = expectSuccess (writeHaskell "test-writers-haskell-path" { libraries = [ haskellPackages.acme-default ]; } (writeText "test" '' 211 240 import Data.Default 212 241 213 242 int :: Int ··· 217 246 main = case int of 218 247 18871 -> putStrLn $ id "success" 219 248 _ -> print "fail" 220 - ''); 249 + '')); 221 250 }; 222 251 223 - writeTest = expectedValue: name: test: 224 - writeDash "run-${name}" '' 225 - if test "$(${test})" != "${expectedValue}"; then 226 - echo 'test ${test} failed' 227 - exit 1 228 - fi 229 - ''; 230 - 231 - in runCommand "test-writers" { 232 - passthru = { inherit writeTest bin simple path; }; 233 - meta.platforms = lib.platforms.all; 234 - } '' 235 - ${lib.concatMapStringsSep "\n" (test: writeTest "success" test.name "${test}/bin/${test.name}") (lib.attrValues bin)} 236 - ${lib.concatMapStringsSep "\n" (test: writeTest "success" test.name test) (lib.attrValues simple)} 237 - ${lib.concatMapStringsSep "\n" (test: writeTest "success" test.name test) (lib.attrValues path)} 252 + data = { 253 + json = expectDataEqual { 254 + file = writeJSON "data.json" { hello = "world"; }; 255 + expected = '' 256 + { 257 + "hello": "world" 258 + } 259 + ''; 260 + }; 238 261 239 - echo 'nix-writers successfully tested' >&2 240 - touch $out 241 - '' 262 + toml = expectDataEqual { 263 + file = writeTOML "data.toml" { hello = "world"; }; 264 + expected = "hello = 'world'\n"; 265 + }; 242 266 267 + yaml = expectDataEqual { 268 + file = writeYAML "data.yaml" { hello = "world"; }; 269 + expected = "hello: world\n"; 270 + }; 271 + }; 272 + }
+7 -13
pkgs/development/compilers/cudatoolkit/common.nix
··· 24 24 , libkrb5 25 25 , krb5 26 26 , makeWrapper 27 + , markForCudatoolkitRootHook 27 28 , ncurses5 28 29 , numactl 29 30 , nss ··· 31 32 , python3 # FIXME: CUDAToolkit 10 may still need python27 32 33 , pulseaudio 33 34 , requireFile 35 + , setupCudaHook 34 36 , stdenv 35 37 , backendStdenv # E.g. gcc11Stdenv, set in extension.nix 36 38 , unixODBC ··· 80 82 addOpenGLRunpath 81 83 autoPatchelfHook 82 84 autoAddOpenGLRunpathHook 85 + markForCudatoolkitRootHook 83 86 ] ++ lib.optionals (lib.versionOlder version "11") [ 84 87 libsForQt5.wrapQtAppsHook 85 88 ] ++ lib.optionals (lib.versionAtLeast version "11.8") [ 86 89 qt6Packages.wrapQtAppsHook 87 90 ]; 91 + depsTargetTargetPropagated = [ 92 + setupCudaHook 93 + ]; 88 94 buildInputs = lib.optionals (lib.versionOlder version "11") [ 89 95 libsForQt5.qt5.qtwebengine 90 96 freeglut ··· 129 135 (lib.getLib libtiff) 130 136 qt6Packages.qtwayland 131 137 rdma-core 132 - ucx 138 + (ucx.override { enableCuda = false; }) # Avoid infinite recursion 133 139 xorg.libxshmfence 134 140 xorg.libxkbfile 135 141 ] ++ (lib.optionals (lib.versionAtLeast version "12.1") (map lib.getLib ([ ··· 280 286 sed -i "1 i#define _BITS_FLOATN_H" "$out/include/host_defines.h" 281 287 '' + 282 288 # Point NVCC at a compatible compiler 283 - # FIXME: redist cuda_nvcc copy-pastes this code 284 - # Refer to comments in the overrides for cuda_nvcc for explanation 285 289 # CUDA_TOOLKIT_ROOT_DIR is legacy, 286 290 # Cf. https://cmake.org/cmake/help/latest/module/FindCUDA.html#input-variables 287 - # NOTE: We unconditionally set -Xfatbin=-compress-all, which reduces the size of the compiled 288 - # binaries. If binaries grow over 2GB, they will fail to link. This is a problem for us, as 289 - # the default set of CUDA capabilities we build can regularly cause this to occur (for 290 - # example, with Magma). 291 291 '' 292 292 mkdir -p $out/nix-support 293 293 cat <<EOF >> $out/nix-support/setup-hook 294 294 cmakeFlags+=' -DCUDA_TOOLKIT_ROOT_DIR=$out' 295 - cmakeFlags+=' -DCUDA_HOST_COMPILER=${backendStdenv.cc}/bin' 296 - cmakeFlags+=' -DCMAKE_CUDA_HOST_COMPILER=${backendStdenv.cc}/bin' 297 - if [ -z "\''${CUDAHOSTCXX-}" ]; then 298 - export CUDAHOSTCXX=${backendStdenv.cc}/bin; 299 - fi 300 - export NVCC_PREPEND_FLAGS+=' --compiler-bindir=${backendStdenv.cc}/bin -Xfatbin=-compress-all' 301 295 EOF 302 296 303 297 # Move some libraries to the lib output so that programs that
+30 -1
pkgs/development/compilers/cudatoolkit/extension.nix
··· 38 38 39 39 cudaFlags = final.callPackage ./flags.nix {}; 40 40 41 + # Internal hook, used by cudatoolkit and cuda redist packages 42 + # to accommodate automatic CUDAToolkit_ROOT construction 43 + markForCudatoolkitRootHook = (final.callPackage 44 + ({ makeSetupHook }: 45 + makeSetupHook 46 + { name = "mark-for-cudatoolkit-root-hook"; } 47 + ./hooks/mark-for-cudatoolkit-root-hook.sh) 48 + { }); 49 + 50 + # Normally propagated by cuda_nvcc or cudatoolkit through their depsHostHostPropagated 51 + setupCudaHook = (final.callPackage 52 + ({ makeSetupHook, backendStdenv }: 53 + makeSetupHook 54 + { 55 + name = "setup-cuda-hook"; 56 + 57 + substitutions.ccRoot = "${backendStdenv.cc}"; 58 + 59 + # Required in addition to ccRoot as otherwise bin/gcc is looked up 60 + # when building CMakeCUDACompilerId.cu 61 + substitutions.ccFullPath = "${backendStdenv.cc}/bin/${backendStdenv.cc.targetPrefix}c++"; 62 + } 63 + ./hooks/setup-cuda-hook.sh) 64 + { }); 65 + 41 66 in 42 67 { 43 68 inherit 44 69 backendStdenv 45 70 cudatoolkit 46 - cudaFlags; 71 + cudaFlags 72 + markForCudatoolkitRootHook 73 + setupCudaHook; 74 + 75 + saxpy = final.callPackage ./saxpy { }; 47 76 }
+8
pkgs/development/compilers/cudatoolkit/hooks/mark-for-cudatoolkit-root-hook.sh
··· 1 + # shellcheck shell=bash 2 + 3 + markForCUDAToolkit_ROOT() { 4 + mkdir -p "${prefix}/nix-support" 5 + touch "${prefix}/nix-support/include-in-cudatoolkit-root" 6 + } 7 + 8 + fixupOutputHooks+=(markForCUDAToolkit_ROOT)
+5
pkgs/development/compilers/cudatoolkit/hooks/nvcc-setup-hook.sh
··· 1 + # shellcheck shell=bash 2 + 3 + # CMake's enable_language(CUDA) runs a compiler test and it doesn't account for 4 + # CUDAToolkit_ROOT. We have to help it locate libcudart 5 + export NVCC_APPEND_FLAGS+=" -L@cudartRoot@/lib -I@cudartRoot@/include"
+68
pkgs/development/compilers/cudatoolkit/hooks/setup-cuda-hook.sh
··· 1 + # shellcheck shell=bash 2 + 3 + echo Sourcing setup-cuda-hook >&2 4 + 5 + extendCUDAToolkit_ROOT() { 6 + if [[ -f "$1/nix-support/include-in-cudatoolkit-root" ]] ; then 7 + addToSearchPathWithCustomDelimiter ";" CUDAToolkit_ROOT "$1" 8 + 9 + if [[ -d "$1/include" ]] ; then 10 + addToSearchPathWithCustomDelimiter ";" CUDAToolkit_INCLUDE_DIR "$1/include" 11 + fi 12 + fi 13 + } 14 + 15 + addEnvHooks "$targetOffset" extendCUDAToolkit_ROOT 16 + 17 + setupCUDAToolkitCompilers() { 18 + echo Executing setupCUDAToolkitCompilers >&2 19 + 20 + if [[ -n "${dontSetupCUDAToolkitCompilers-}" ]] ; then 21 + return 22 + fi 23 + 24 + # Point NVCC at a compatible compiler 25 + 26 + # For CMake-based projects: 27 + # https://cmake.org/cmake/help/latest/module/FindCUDA.html#input-variables 28 + # https://cmake.org/cmake/help/latest/envvar/CUDAHOSTCXX.html 29 + # https://cmake.org/cmake/help/latest/variable/CMAKE_CUDA_HOST_COMPILER.html 30 + 31 + export cmakeFlags+=" -DCUDA_HOST_COMPILER=@ccFullPath@" 32 + export cmakeFlags+=" -DCMAKE_CUDA_HOST_COMPILER=@ccFullPath@" 33 + 34 + # For non-CMake projects: 35 + # We prepend --compiler-bindir to nvcc flags. 36 + # Downstream packages can override these, because NVCC 37 + # uses the last --compiler-bindir it gets on the command line. 38 + # FIXME: this results in "incompatible redefinition" warnings. 39 + # https://docs.nvidia.com/cuda/cuda-compiler-driver-nvcc/index.html#compiler-bindir-directory-ccbin 40 + if [ -z "${CUDAHOSTCXX-}" ]; then 41 + export CUDAHOSTCXX="@ccFullPath@"; 42 + fi 43 + 44 + export NVCC_PREPEND_FLAGS+=" --compiler-bindir=@ccRoot@/bin" 45 + 46 + # NOTE: We set -Xfatbin=-compress-all, which reduces the size of the compiled 47 + # binaries. If binaries grow over 2GB, they will fail to link. This is a problem for us, as 48 + # the default set of CUDA capabilities we build can regularly cause this to occur (for 49 + # example, with Magma). 50 + # 51 + # @SomeoneSerge: original comment was made by @ConnorBaker in .../cudatoolkit/common.nix 52 + if [[ -z "${dontCompressFatbin-}" ]]; then 53 + export NVCC_PREPEND_FLAGS+=" -Xfatbin=-compress-all" 54 + fi 55 + 56 + # CMake's enable_language(CUDA) runs a compiler test and it doesn't account for 57 + # CUDAToolkit_ROOT. We have to help it locate libcudart 58 + if [[ -z "${nvccDontPrependCudartFlags-}" ]] ; then 59 + export NVCC_APPEND_FLAGS+=" -L@cudartRoot@/lib -I@cudartRoot@/include" 60 + fi 61 + } 62 + 63 + setupCMakeCUDAToolkit_ROOT() { 64 + export cmakeFlags+=" -DCUDAToolkit_INCLUDE_DIR=$CUDAToolkit_INCLUDE_DIR -DCUDAToolkit_ROOT=$CUDAToolkit_ROOT" 65 + } 66 + 67 + postHooks+=(setupCUDAToolkitCompilers) 68 + preConfigureHooks+=(setupCMakeCUDAToolkit_ROOT)
+2
pkgs/development/compilers/cudatoolkit/redist/build-cuda-redist-package.nix
··· 4 4 , fetchurl 5 5 , autoPatchelfHook 6 6 , autoAddOpenGLRunpathHook 7 + , markForCudatoolkitRootHook 7 8 }: 8 9 9 10 pname: ··· 28 29 # directory to the rpath of all ELF binaries. 29 30 # Check e.g. with `patchelf --print-rpath path/to/my/binary 30 31 autoAddOpenGLRunpathHook 32 + markForCudatoolkitRootHook 31 33 ]; 32 34 33 35 buildInputs = [
+19 -27
pkgs/development/compilers/cudatoolkit/redist/overrides.nix
··· 27 27 inherit (prev.backendStdenv) cc; 28 28 in 29 29 { 30 - # Point NVCC at a compatible compiler 31 - # FIXME: non-redist cudatoolkit copy-pastes this code 30 + # Required by cmake's enable_language(CUDA) to build a test program 31 + # When implementing cross-compilation support: this is 32 + # final.pkgs.targetPackages.cudaPackages.cuda_cudart 33 + env.cudartRoot = "${prev.lib.getDev final.cuda_cudart}"; 32 34 33 - # For CMake-based projects: 34 - # https://cmake.org/cmake/help/latest/module/FindCUDA.html#input-variables 35 - # https://cmake.org/cmake/help/latest/envvar/CUDAHOSTCXX.html 36 - # https://cmake.org/cmake/help/latest/variable/CMAKE_CUDA_HOST_COMPILER.html 35 + # Point NVCC at a compatible compiler 37 36 38 - # For non-CMake projects: 39 - # We prepend --compiler-bindir to nvcc flags. 40 - # Downstream packages can override these, because NVCC 41 - # uses the last --compiler-bindir it gets on the command line. 42 - # FIXME: this results in "incompatible redefinition" warnings. 43 - # https://docs.nvidia.com/cuda/cuda-compiler-driver-nvcc/index.html#compiler-bindir-directory-ccbin 44 - # NOTE: We unconditionally set -Xfatbin=-compress-all, which reduces the size of the 45 - # compiled binaries. If binaries grow over 2GB, they will fail to link. This is a problem 46 - # for us, as the default set of CUDA capabilities we build can regularly cause this to 47 - # occur (for example, with Magma). 48 - postInstall = (oldAttrs.postInstall or "") + '' 49 - mkdir -p $out/nix-support 50 - cat <<EOF >> $out/nix-support/setup-hook 51 - cmakeFlags+=' -DCUDA_HOST_COMPILER=${cc}/bin' 52 - cmakeFlags+=' -DCMAKE_CUDA_HOST_COMPILER=${cc}/bin' 53 - if [ -z "\''${CUDAHOSTCXX-}" ]; then 54 - export CUDAHOSTCXX=${cc}/bin; 55 - fi 56 - export NVCC_PREPEND_FLAGS+=' --compiler-bindir=${cc}/bin -Xfatbin=-compress-all' 57 - EOF 58 - ''; 37 + # Desiredata: whenever a package (e.g. magma) adds cuda_nvcc to 38 + # nativeBuildInputs (offsets `(-1, 0)`), magma should also source the 39 + # setupCudaHook, i.e. we want it the hook to be propagated into the 40 + # same nativeBuildInputs. 41 + # 42 + # Logically, cuda_nvcc should include the hook in depsHostHostPropagated, 43 + # so that the final offsets for the propagated hook would be `(-1, 0) + 44 + # (0, 0) = (-1, 0)`. 45 + # 46 + # In practice, TargetTarget appears to work: 47 + # https://gist.github.com/fd80ff142cd25e64603618a3700e7f82 48 + depsTargetTargetPropagated = [ 49 + final.setupCudaHook 50 + ]; 59 51 }); 60 52 61 53 cuda_nvprof = prev.cuda_nvprof.overrideAttrs (oldAttrs: {
+12
pkgs/development/compilers/cudatoolkit/saxpy/CMakeLists.txt
··· 1 + cmake_minimum_required(VERSION 3.25) 2 + project(saxpy LANGUAGES CXX CUDA) 3 + 4 + find_package(CUDAToolkit REQUIRED COMPONENTS cudart cublas) 5 + 6 + add_executable(saxpy saxpy.cu) 7 + target_link_libraries(saxpy PUBLIC CUDA::cublas CUDA::cudart m) 8 + target_compile_features(saxpy PRIVATE cxx_std_14) 9 + target_compile_options(saxpy PRIVATE $<$<COMPILE_LANGUAGE:CUDA>: 10 + --expt-relaxed-constexpr>) 11 + 12 + install(TARGETS saxpy)
+50
pkgs/development/compilers/cudatoolkit/saxpy/default.nix
··· 1 + { autoAddOpenGLRunpathHook 2 + , backendStdenv 3 + , cmake 4 + , cuda_cccl 5 + , cuda_cudart 6 + , cudaFlags 7 + , cuda_nvcc 8 + , lib 9 + , libcublas 10 + , setupCudaHook 11 + , stdenv 12 + }: 13 + 14 + backendStdenv.mkDerivation { 15 + pname = "saxpy"; 16 + version = "unstable-2023-07-11"; 17 + 18 + src = ./.; 19 + 20 + buildInputs = [ 21 + libcublas 22 + cuda_cudart 23 + cuda_cccl 24 + ]; 25 + nativeBuildInputs = [ 26 + cmake 27 + 28 + # NOTE: this needs to be pkgs.buildPackages.cudaPackages_XX_Y.cuda_nvcc for 29 + # cross-compilation to work. This should work automatically once we move to 30 + # spliced scopes. Delete this comment once that happens 31 + cuda_nvcc 32 + 33 + # Alternatively, we could remove the propagated hook from cuda_nvcc and add 34 + # directly: 35 + # setupCudaHook 36 + autoAddOpenGLRunpathHook 37 + ]; 38 + 39 + cmakeFlags = [ 40 + "-DCMAKE_VERBOSE_MAKEFILE=ON" 41 + "-DCMAKE_CUDA_ARCHITECTURES=${with cudaFlags; builtins.concatStringsSep ";" (map dropDot cudaCapabilities)}" 42 + ]; 43 + 44 + meta = { 45 + description = "A simple (Single-precision AX Plus Y) FindCUDAToolkit.cmake example for testing cross-compilation"; 46 + license = lib.licenses.mit; 47 + maintainers = lib.teams.cuda.members; 48 + platforms = lib.platforms.unix; 49 + }; 50 + }
+68
pkgs/development/compilers/cudatoolkit/saxpy/saxpy.cu
··· 1 + #include <cublas_v2.h> 2 + #include <cuda_runtime.h> 3 + #include <vector> 4 + 5 + #include <stdio.h> 6 + 7 + static inline void check(cudaError_t err, const char *context) { 8 + if (err != cudaSuccess) { 9 + fprintf(stderr, "CUDA error at %s: %s\n", context, cudaGetErrorString(err)); 10 + std::exit(EXIT_FAILURE); 11 + } 12 + } 13 + 14 + #define CHECK(x) check(x, #x) 15 + 16 + __global__ void saxpy(int n, float a, float *x, float *y) { 17 + int i = blockIdx.x * blockDim.x + threadIdx.x; 18 + if (i < n) 19 + y[i] = a * x[i] + y[i]; 20 + } 21 + 22 + int main(void) { 23 + setbuf(stderr, NULL); 24 + fprintf(stderr, "Start\n"); 25 + 26 + int rtVersion, driverVersion; 27 + CHECK(cudaRuntimeGetVersion(&rtVersion)); 28 + CHECK(cudaDriverGetVersion(&driverVersion)); 29 + 30 + fprintf(stderr, "Runtime version: %d\n", rtVersion); 31 + fprintf(stderr, "Driver version: %d\n", driverVersion); 32 + 33 + constexpr int N = 1 << 10; 34 + 35 + std::vector<float> xHost(N), yHost(N); 36 + for (int i = 0; i < N; i++) { 37 + xHost[i] = 1.0f; 38 + yHost[i] = 2.0f; 39 + } 40 + 41 + fprintf(stderr, "Host memory initialized, copying to the device\n"); 42 + fflush(stderr); 43 + 44 + float *xDevice, *yDevice; 45 + CHECK(cudaMalloc(&xDevice, N * sizeof(float))); 46 + CHECK(cudaMalloc(&yDevice, N * sizeof(float))); 47 + 48 + CHECK(cudaMemcpy(xDevice, xHost.data(), N * sizeof(float), 49 + cudaMemcpyHostToDevice)); 50 + CHECK(cudaMemcpy(yDevice, yHost.data(), N * sizeof(float), 51 + cudaMemcpyHostToDevice)); 52 + fprintf(stderr, "Scheduled a cudaMemcpy, calling the kernel\n"); 53 + 54 + saxpy<<<(N + 255) / 256, 256>>>(N, 2.0f, xDevice, yDevice); 55 + fprintf(stderr, "Scheduled a kernel call\n"); 56 + CHECK(cudaGetLastError()); 57 + 58 + CHECK(cudaMemcpy(yHost.data(), yDevice, N * sizeof(float), 59 + cudaMemcpyDeviceToHost)); 60 + 61 + float maxError = 0.0f; 62 + for (int i = 0; i < N; i++) 63 + maxError = max(maxError, abs(yHost[i] - 4.0f)); 64 + fprintf(stderr, "Max error: %f\n", maxError); 65 + 66 + CHECK(cudaFree(xDevice)); 67 + CHECK(cudaFree(yDevice)); 68 + }
+2 -1
pkgs/development/libraries/arrayfire/default.nix
··· 19 19 , clblas 20 20 , doxygen 21 21 , buildDocs ? false 22 - , cudaSupport ? false 22 + , config 23 + , cudaSupport ? config.cudaSupport 23 24 , cudatoolkit 24 25 , darwin 25 26 }:
+2 -1
pkgs/development/libraries/elpa/default.nix
··· 4 4 , avxSupport ? stdenv.hostPlatform.avxSupport 5 5 , avx2Support ? stdenv.hostPlatform.avx2Support 6 6 , avx512Support ? stdenv.hostPlatform.avx512Support 7 + , config 7 8 # Enable NIVIA GPU support 8 9 # Note, that this needs to be built on a system with a GPU 9 10 # present for the tests to succeed. 10 - , enableCuda ? false 11 + , enableCuda ? config.cudaSupport 11 12 # type of GPU architecture 12 13 , nvidiaArch ? "sm_60" 13 14 , cudatoolkit
+1 -1
pkgs/development/libraries/frei0r/default.nix
··· 7 7 , opencv 8 8 , pcre 9 9 , pkg-config 10 - , cudaSupport ? config.cudaSupport or false 10 + , cudaSupport ? config.cudaSupport 11 11 , cudaPackages 12 12 }: 13 13
+2 -1
pkgs/development/libraries/hwloc/default.nix
··· 2 2 , x11Support ? false 3 3 , libX11 4 4 , cairo 5 - , enableCuda ? false 5 + , config 6 + , enableCuda ? config.cudaSupport 6 7 , cudaPackages 7 8 }: 8 9
+1 -1
pkgs/development/libraries/librealsense/default.nix
··· 13 13 , glfw 14 14 , libGLU 15 15 , curl 16 - , cudaSupport ? config.cudaSupport or false, cudaPackages ? {} 16 + , cudaSupport ? config.cudaSupport, cudaPackages ? { } 17 17 , enablePython ? false, pythonPackages ? null 18 18 , enableGUI ? false, 19 19 }:
+1 -1
pkgs/development/libraries/lightgbm/default.nix
··· 1 1 { config, stdenv, lib, fetchFromGitHub, cmake, gtest, doCheck ? true 2 - , cudaSupport ? config.cudaSupport or false, openclSupport ? false, mpiSupport ? false, javaWrapper ? false, hdfsSupport ? false 2 + , cudaSupport ? config.cudaSupport, openclSupport ? false, mpiSupport ? false, javaWrapper ? false, hdfsSupport ? false 3 3 , rLibrary ? false, cudaPackages, opencl-headers, ocl-icd, boost, llvmPackages, openmpi, openjdk, swig, hadoop, R, rPackages }: 4 4 5 5 assert doCheck -> mpiSupport != true;
+1 -1
pkgs/development/libraries/mlt/default.nix
··· 21 21 , sox 22 22 , vid-stab 23 23 , darwin 24 - , cudaSupport ? config.cudaSupport or false 24 + , cudaSupport ? config.cudaSupport 25 25 , cudaPackages ? { } 26 26 , enableJackrack ? stdenv.isLinux 27 27 , ladspa-sdk
+1 -1
pkgs/development/libraries/nvidia-thrust/default.nix
··· 8 8 , symlinkJoin 9 9 , tbb 10 10 , hostSystem ? "CPP" 11 - , deviceSystem ? if config.cudaSupport or false then "CUDA" else "OMP" 11 + , deviceSystem ? if config.cudaSupport then "CUDA" else "OMP" 12 12 }: 13 13 14 14 # Policy for device_vector<T>
+1 -1
pkgs/development/libraries/opencv/3.x.nix
··· 14 14 , enableOpenblas ? true, openblas, blas, lapack 15 15 , enableContrib ? true 16 16 17 - , enableCuda ? (config.cudaSupport or false) && 17 + , enableCuda ? config.cudaSupport && 18 18 stdenv.hostPlatform.isx86_64 19 19 , cudaPackages ? { } 20 20 , enableUnfree ? false
+1 -1
pkgs/development/libraries/opencv/4.x.nix
··· 37 37 , blas 38 38 , enableContrib ? true 39 39 40 - , enableCuda ? (config.cudaSupport or false) && stdenv.hostPlatform.isx86_64 40 + , enableCuda ? config.cudaSupport && stdenv.hostPlatform.isx86_64 41 41 , enableCublas ? enableCuda 42 42 , enableCudnn ? false # NOTE: CUDNN has a large impact on closure size so we disable it by default 43 43 , enableCufft ? enableCuda
+2 -2
pkgs/development/libraries/openmpi/default.nix
··· 1 1 { lib, stdenv, fetchurl, gfortran, perl, libnl 2 2 , rdma-core, zlib, numactl, libevent, hwloc, targetPackages, symlinkJoin 3 3 , libpsm2, libfabric, pmix, ucx 4 - 4 + , config 5 5 # Enable CUDA support 6 - , cudaSupport ? false, cudatoolkit 6 + , cudaSupport ? config.cudaSupport, cudatoolkit 7 7 8 8 # Enable the Sun Grid Engine bindings 9 9 , enableSGE ? false
+1 -1
pkgs/development/libraries/opensubdiv/default.nix
··· 1 1 { config, lib, stdenv, fetchFromGitHub, cmake, pkg-config, xorg, libGLU 2 2 , libGL, glew, ocl-icd, python3 3 - , cudaSupport ? config.cudaSupport or false, cudatoolkit 3 + , cudaSupport ? config.cudaSupport, cudatoolkit 4 4 # For visibility mostly. The whole approach to cuda architectures and capabilities 5 5 # will be reworked soon. 6 6 , cudaArch ? "compute_37"
+2 -1
pkgs/development/libraries/science/chemistry/openmm/default.nix
··· 11 11 , enableOpencl ? true 12 12 , opencl-headers 13 13 , ocl-icd 14 - , enableCuda ? false 14 + , config 15 + , enableCuda ? config.cudaSupport 15 16 , cudaPackages 16 17 , addOpenGLRunpath 17 18 }:
+1 -1
pkgs/development/libraries/science/math/faiss/default.nix
··· 5 5 , stdenv 6 6 , cmake 7 7 , cudaPackages ? { } 8 - , cudaSupport ? config.cudaSupport or false 8 + , cudaSupport ? config.cudaSupport 9 9 , nvidia-thrust 10 10 , useThrustSourceBuild ? true 11 11 , pythonSupport ? true
+10 -27
pkgs/development/libraries/science/math/magma/generic.nix
··· 86 86 # "75" -> "750" Cf. https://bitbucket.org/icl/magma/src/f4ec79e2c13a2347eff8a77a3be6f83bc2daec20/CMakeLists.txt#lines-273 87 87 "${minArch'}0"; 88 88 89 - cuda-common-redist = with cudaPackages; [ 90 - libcublas # cublas_v2.h 91 - libcusparse # cusparse.h 92 - ]; 93 - 94 - # Build-time dependencies 95 - cuda-native-redist = symlinkJoin { 96 - name = "cuda-native-redist-${cudaVersion}"; 97 - paths = with cudaPackages; [ 98 - cuda_cudart # cuda_runtime.h 99 - cuda_nvcc 100 - ] ++ lists.optionals (strings.versionOlder cudaVersion "11.8") [ 101 - cuda_nvprof # <cuda_profiler_api.h> 102 - ] ++ lists.optionals (strings.versionAtLeast cudaVersion "11.8") [ 103 - cuda_profiler_api # <cuda_profiler_api.h> 104 - ] ++ cuda-common-redist; 105 - }; 106 - 107 - # Run-time dependencies 108 - cuda-redist = symlinkJoin { 109 - name = "cuda-redist-${cudaVersion}"; 110 - paths = cuda-common-redist; 111 - }; 112 89 in 113 90 114 91 assert (builtins.match "[^[:space:]]*" gpuTargetString) != null; ··· 128 105 ninja 129 106 gfortran 130 107 ] ++ lists.optionals cudaSupport [ 131 - cuda-native-redist 108 + cudaPackages.cuda_nvcc 132 109 ]; 133 110 134 111 buildInputs = [ 135 112 libpthreadstubs 136 113 lapack 137 114 blas 138 - ] ++ lists.optionals cudaSupport [ 139 - cuda-redist 140 - ] ++ lists.optionals rocmSupport [ 115 + ] ++ lists.optionals cudaSupport (with cudaPackages; [ 116 + cuda_cudart 117 + libcublas # cublas_v2.h 118 + libcusparse # cusparse.h 119 + ] ++ lists.optionals (strings.versionOlder cudaVersion "11.8") [ 120 + cuda_nvprof # <cuda_profiler_api.h> 121 + ] ++ lists.optionals (strings.versionAtLeast cudaVersion "11.8") [ 122 + cuda_profiler_api # <cuda_profiler_api.h> 123 + ]) ++ lists.optionals rocmSupport [ 141 124 hip 142 125 hipblas 143 126 hipsparse
+2 -1
pkgs/development/libraries/science/math/suitesparse/4.4.nix
··· 1 1 { lib, stdenv, fetchurl, gfortran, blas, lapack 2 - , enableCuda ? false, cudatoolkit 2 + , config 3 + , enableCuda ? config.cudaSupport, cudatoolkit 3 4 }: 4 5 5 6 let
+2 -1
pkgs/development/libraries/science/math/suitesparse/default.nix
··· 6 6 , fixDarwinDylibNames 7 7 , gmp 8 8 , mpfr 9 - , enableCuda ? false 9 + , config 10 + , enableCuda ? config.cudaSupport 10 11 , cudatoolkit 11 12 }: 12 13
+2 -1
pkgs/development/libraries/ucc/default.nix
··· 1 1 { stdenv, lib, fetchFromGitHub, libtool, automake, autoconf, ucx 2 - , enableCuda ? false 2 + , config 3 + , enableCuda ? config.cudaSupport 3 4 , cudatoolkit 4 5 , enableAvx ? stdenv.hostPlatform.avxSupport 5 6 , enableSse41 ? stdenv.hostPlatform.sse4_1Support
+2 -1
pkgs/development/libraries/ucx/default.nix
··· 1 1 { lib, stdenv, fetchFromGitHub, autoreconfHook, doxygen, numactl 2 2 , rdma-core, libbfd, libiberty, perl, zlib, symlinkJoin, pkg-config 3 - , enableCuda ? false 3 + , config 4 + , enableCuda ? config.cudaSupport 4 5 , cudatoolkit 5 6 , enableRocm ? false 6 7 , rocm-core, rocm-runtime, rocm-device-libs, hip
+1 -1
pkgs/development/libraries/xgboost/default.nix
··· 5 5 , cmake 6 6 , gtest 7 7 , doCheck ? true 8 - , cudaSupport ? config.cudaSupport or false 8 + , cudaSupport ? config.cudaSupport 9 9 , ncclSupport ? false 10 10 , rLibrary ? false 11 11 , cudaPackages
+1 -1
pkgs/development/python-modules/chainer/default.nix
··· 1 1 { lib 2 2 , buildPythonPackage 3 3 , config 4 - , cudaSupport ? config.cudaSupport or false 4 + , cudaSupport ? config.cudaSupport 5 5 , cupy 6 6 , fetchFromGitHub 7 7 , filelock
+1 -1
pkgs/development/python-modules/jaxlib/bin.nix
··· 27 27 , scipy 28 28 , stdenv 29 29 # Options: 30 - , cudaSupport ? config.cudaSupport or false 30 + , cudaSupport ? config.cudaSupport 31 31 , cudaPackages ? {} 32 32 }: 33 33
+2 -1
pkgs/development/python-modules/jaxlib/default.nix
··· 40 40 , snappy 41 41 , zlib 42 42 43 + , config 43 44 # CUDA flags: 44 - , cudaSupport ? false 45 + , cudaSupport ? config.cudaSupport 45 46 , cudaPackages ? {} 46 47 47 48 # MKL:
+3 -1
pkgs/development/python-modules/libgpuarray/default.nix
··· 9 9 , six 10 10 , nose 11 11 , mako 12 - , cudaSupport ? false, cudaPackages 12 + , config 13 + , cudaSupport ? config.cudaSupport 14 + , cudaPackages ? { } 13 15 , openclSupport ? true, ocl-icd, clblas 14 16 }: 15 17
+41
pkgs/development/python-modules/macaddress/default.nix
··· 1 + { lib 2 + , buildPythonPackage 3 + , fetchFromGitHub 4 + , pytestCheckHook 5 + , hypothesis 6 + , reprshed 7 + }: 8 + 9 + buildPythonPackage rec { 10 + pname = "macaddress"; 11 + version = "2.0.2"; 12 + format = "setuptools"; 13 + 14 + src = fetchFromGitHub { 15 + owner = "mentalisttraceur"; 16 + repo = "python-macaddress"; 17 + rev = "v${version}"; 18 + hash = "sha256-2eD5Ui8kUduKLJ0mSiwaz7TQSeF1+2ASirp70V/8+EA="; 19 + }; 20 + 21 + pythonImportsCheck = [ 22 + "macaddress" 23 + ]; 24 + 25 + nativeCheckInputs = [ 26 + pytestCheckHook 27 + hypothesis 28 + reprshed 29 + ]; 30 + 31 + pytestFlagsArray = [ 32 + "$src/test.py" 33 + ]; 34 + 35 + meta = with lib; { 36 + homepage = "https://github.com/mentalisttraceur/python-macaddress"; 37 + description = "A module for handling hardware identifiers like MAC addresses"; 38 + license = licenses.bsd0; 39 + maintainers = with maintainers; [ netali ]; 40 + }; 41 + }
+3 -1
pkgs/development/python-modules/numba/default.nix
··· 14 14 , runCommand 15 15 , fetchpatch 16 16 17 + , config 18 + 17 19 # CUDA-only dependencies: 18 20 , addOpenGLRunpath ? null 19 21 , cudaPackages ? {} 20 22 21 23 # CUDA flags: 22 - , cudaSupport ? false 24 + , cudaSupport ? config.cudaSupport 23 25 }: 24 26 25 27 let
+28
pkgs/development/python-modules/reprshed/default.nix
··· 1 + { lib 2 + , buildPythonPackage 3 + , fetchFromGitHub 4 + }: 5 + 6 + buildPythonPackage rec { 7 + pname = "python-reprshed"; 8 + version = "1.0.6"; 9 + format = "setuptools"; 10 + 11 + src = fetchFromGitHub { 12 + owner = "mentalisttraceur"; 13 + repo = "python-reprshed"; 14 + rev = "v${version}"; 15 + hash = "sha256-XfmiewI74eDLKTAU6Ed76QXfJYMRb+idRACl6CW07ME="; 16 + }; 17 + 18 + pythonImportsCheck = [ 19 + "reprshed" 20 + ]; 21 + 22 + meta = with lib; { 23 + homepage = "https://github.com/mentalisttraceur/python-reprshed"; 24 + description = "A toolshed for writing great __repr__ methods quickly and easily"; 25 + license = licenses.bsd0; 26 + maintainers = with maintainers; [ netali ]; 27 + }; 28 + }
+2 -1
pkgs/development/python-modules/tensorflow/bin.nix
··· 21 21 , backports_weakref 22 22 , tensorflow-estimator-bin 23 23 , tensorboard 24 - , cudaSupport ? false 24 + , config 25 + , cudaSupport ? config.cudaSupport 25 26 , cudaPackages ? {} 26 27 , zlib 27 28 , python
+2 -1
pkgs/development/python-modules/tensorflow/default.nix
··· 17 17 # that in nix as well. It would make some things easier and less confusing, but 18 18 # it would also make the default tensorflow package unfree. See 19 19 # https://groups.google.com/a/tensorflow.org/forum/#!topic/developers/iRCt5m4qUz0 20 - , cudaSupport ? false 20 + , config 21 + , cudaSupport ? config.cudaSupport 21 22 , cudaPackages ? { } 22 23 , cudaCapabilities ? cudaPackages.cudaFlags.cudaCapabilities 23 24 , mklSupport ? false, mkl
+2 -2
pkgs/development/python-modules/teslajsonpy/default.nix
··· 17 17 18 18 buildPythonPackage rec { 19 19 pname = "teslajsonpy"; 20 - version = "3.9.0"; 20 + version = "3.9.1"; 21 21 format = "pyproject"; 22 22 23 23 disabled = pythonOlder "3.7"; ··· 26 26 owner = "zabuldon"; 27 27 repo = pname; 28 28 rev = "refs/tags/v${version}"; 29 - hash = "sha256-6H8miS0tKB99ZkiBvqJ77NIsswJ+ivYt1VZOLwTQr24="; 29 + hash = "sha256-6QwBXWV/oMPDogzS5+EtRP9uzySvdYtnRR4Lb5IWwh4="; 30 30 }; 31 31 32 32 nativeBuildInputs = [
+3 -2
pkgs/development/python-modules/theano/default.nix
··· 11 11 , setuptools 12 12 , six 13 13 , libgpuarray 14 - , cudaSupport ? false, cudaPackages ? {} 15 - , cudnnSupport ? false 14 + , config 15 + , cudaSupport ? config.cudaSupport, cudaPackages ? { } 16 + , cudnnSupport ? cudaSupport 16 17 }: 17 18 18 19 let
+1 -1
pkgs/development/python-modules/torch/default.nix
··· 1 1 { stdenv, lib, fetchFromGitHub, buildPythonPackage, python, 2 - cudaSupport ? false, cudaPackages, magma, 2 + config, cudaSupport ? config.cudaSupport, cudaPackages, magma, 3 3 useSystemNccl ? true, 4 4 MPISupport ? false, mpi, 5 5 buildDocs ? false,
+2 -1
pkgs/games/katago/default.nix
··· 1 1 { stdenv 2 2 , boost 3 3 , cmake 4 + , config 4 5 , cudaPackages 5 6 , eigen 6 7 , fetchFromGitHub ··· 14 15 , openssl 15 16 , writeShellScriptBin 16 17 , enableAVX2 ? stdenv.hostPlatform.avx2Support 17 - , backend ? "opencl" 18 + , backend ? if config.cudaSupport then "cuda" else "opencl" 18 19 , enableBigBoards ? false 19 20 , enableContrib ? false 20 21 , enableTcmalloc ? true
+2 -1
pkgs/servers/sunshine/default.nix
··· 30 30 , svt-av1 31 31 , vulkan-loader 32 32 , libappindicator 33 - , cudaSupport ? false 33 + , config 34 + , cudaSupport ? config.cudaSupport 34 35 , cudaPackages ? {} 35 36 }: 36 37 let
-1
pkgs/test/haskell/default.nix
··· 5 5 cabalSdist = callPackage ./cabalSdist { }; 6 6 documentationTarball = callPackage ./documentationTarball { }; 7 7 setBuildTarget = callPackage ./setBuildTarget { }; 8 - writers = callPackage ./writers { }; 9 8 incremental = callPackage ./incremental { }; 10 9 }
-26
pkgs/test/haskell/writers/default.nix
··· 1 - # Wrap only the haskell-related tests from tests.writers 2 - # in their own derivation for Hydra CI in the haskell-updates 3 - # jobset. Can presumably removed as soon as tests.writers is 4 - # always green on darwin as well: 5 - # https://github.com/NixOS/nixpkgs/issues/126182 6 - { runCommand, tests }: 7 - 8 - let 9 - inherit (tests.writers) 10 - writeTest 11 - bin 12 - simple 13 - path 14 - ; 15 - in 16 - 17 - runCommand "test-haskell-writers" { 18 - meta = { 19 - inherit (tests.writers.meta) platforms; 20 - }; 21 - } '' 22 - ${writeTest "success" "test-haskell-bin-writer" "${bin.haskell}/bin/${bin.haskell.name}"} 23 - ${writeTest "success" "test-haskell-simple-writer" simple.haskell} 24 - ${writeTest "success" "test-haskell-path-writer" path.haskell} 25 - touch $out 26 - ''
+8 -3
pkgs/tools/admin/hop-cli/default.nix
··· 10 10 11 11 rustPlatform.buildRustPackage rec { 12 12 pname = "hop-cli"; 13 - version = "0.2.35"; 13 + version = "0.2.52"; 14 14 15 15 src = fetchFromGitHub { 16 16 owner = "hopinc"; 17 17 repo = "cli"; 18 18 rev = "v${version}"; 19 - hash = "sha256-TgPEcsv7/n+PzZXazozbgmX2tt4WDvyH3j6rY+M0AGE="; 19 + hash = "sha256-xuOkW5jetl+8obeFJnbkVZa+wYWfTNiTOmcrzC8+wGE="; 20 20 }; 21 21 22 - cargoHash = "sha256-HEUsyboZQ4j5IEOqiWEBSlJqmaNDHPg1kstnM9AgZBo="; 22 + cargoHash = "sha256-ePUlw4UzsQ2lNuJ5g5OAYh6nKTIoHdDMb34Jzuqtas8="; 23 23 24 24 nativeBuildInputs = [ 25 25 pkg-config ··· 32 32 ]; 33 33 34 34 OPENSSL_NO_VENDOR = 1; 35 + 36 + checkFlags = [ 37 + # This test fails on read-only filesystems 38 + "--skip=commands::volumes::utils::test::test_parse_target_from_path_like" 39 + ]; 35 40 36 41 meta = with lib; { 37 42 mainProgram = "hop";
+2 -1
pkgs/tools/compression/zfp/default.nix
··· 1 1 { cmake, cudatoolkit, fetchFromGitHub, gfortran, lib, llvmPackages, python3Packages, stdenv 2 + , config 2 3 , enableCfp ? true 3 - , enableCuda ? false 4 + , enableCuda ? config.cudaSupport 4 5 , enableFortran ? builtins.elem stdenv.targetPlatform.system gfortran.meta.platforms 5 6 , enableOpenMP ? true 6 7 , enablePython ? true
+1 -1
pkgs/tools/filesystems/goofys/default.nix
··· 16 16 sha256 = "sha256-6yVMNSwwPZlADXuPBDRlgoz4Stuz2pgv6r6+y2/C8XY="; 17 17 }; 18 18 19 - vendorSha256 = "sha256-2N8MshBo9+2q8K00eTW5So6d8ZNRzOfQkEKmxR428gI="; 19 + vendorSha256 = "sha256-shFld293pdmVcnu3p0NoBmPGLJddZd4O/gJ8klgdlQ8="; 20 20 21 21 subPackages = [ "." ]; 22 22
+2 -1
pkgs/tools/graphics/waifu2x-converter-cpp/default.nix
··· 1 1 { cmake, fetchFromGitHub, makeWrapper, opencv3, lib, stdenv, ocl-icd, opencl-headers, OpenCL 2 - , cudaSupport ? false, cudatoolkit ? null 2 + , config 3 + , cudaSupport ? config.cudaSupport, cudatoolkit ? null 3 4 }: 4 5 5 6 stdenv.mkDerivation rec {
+5 -5
pkgs/tools/misc/ripdrag/default.nix
··· 1 - { lib, rustPlatform, fetchCrate, pkg-config, gtk4 }: 1 + { lib, rustPlatform, fetchCrate, pkg-config, wrapGAppsHook4, gtk4 }: 2 2 3 3 rustPlatform.buildRustPackage rec { 4 4 pname = "ripdrag"; 5 - version = "0.3.0"; 5 + version = "0.3.1"; 6 6 7 7 src = fetchCrate { 8 8 inherit pname version; 9 - sha256 = "sha256-D4WB1RdMPJfSLbJ96h3OuFhokfyY8Gamctm0XY694YM="; 9 + hash = "sha256-SSH/HCvrUvWNIqlx7F6eNMM1eGxGGg5eel/X/q1Um1g="; 10 10 }; 11 11 12 - cargoSha256 = "sha256-C2I26E/dd18A4DDgOYGR8aS1RBrrNUwaXI4ZJHcrKy0="; 12 + cargoHash = "sha256-FvStPBmyETjCaBqQK/KYHpwtqNCiY6n484E5bumdRzk="; 13 13 14 - nativeBuildInputs = [ pkg-config ]; 14 + nativeBuildInputs = [ pkg-config wrapGAppsHook4 ]; 15 15 16 16 buildInputs = [ gtk4 ]; 17 17
+3 -3
pkgs/tools/misc/topgrade/default.nix
··· 10 10 11 11 rustPlatform.buildRustPackage rec { 12 12 pname = "topgrade"; 13 - version = "12.0.1"; 13 + version = "12.0.2"; 14 14 15 15 src = fetchFromGitHub { 16 16 owner = "topgrade-rs"; 17 17 repo = "topgrade"; 18 18 rev = "v${version}"; 19 - hash = "sha256-H+Vx5yfHKgiUCrk42PMlu+XQsehol6aBLSwCuiBWCrs="; 19 + hash = "sha256-PfrtTegJULzPAmKUk/6P9rD+ttPJOhaf2505og64C0Y="; 20 20 }; 21 21 22 - cargoHash = "sha256-ixFTkTyPKLeH6VcFAOAwmdc6YrrIpJ8obBwm19tFq3s="; 22 + cargoHash = "sha256-S6jSI/KuHocYD2dhg3o1NSyA8Q04Xo215TWl8Y1C7g8="; 23 23 24 24 nativeBuildInputs = [ 25 25 installShellFiles
+8 -3
pkgs/tools/security/bitwarden/cli.nix
··· 5 5 , fetchFromGitHub 6 6 , python3 7 7 , darwin 8 + , nixosTests 8 9 }: 9 10 10 11 let 11 12 buildNpmPackage' = buildNpmPackage.override { nodejs = nodejs_18; }; 12 13 in buildNpmPackage' rec { 13 14 pname = "bitwarden-cli"; 14 - version = "2023.5.0"; 15 + version = "2023.7.0"; 15 16 16 17 src = fetchFromGitHub { 17 18 owner = "bitwarden"; 18 19 repo = "clients"; 19 20 rev = "cli-v${version}"; 20 - hash = "sha256-ELKpGSY4ZbgSk4vJnTiB+IOa8RQU8Ahy3A1mYsKtthU="; 21 + hash = "sha256-Xnfjp+qRJWvxvgSODbajLxYsP2DtOYK9CXBMfIn+qwA="; 21 22 }; 22 23 23 - npmDepsHash = "sha256-G8DEYPjEP3L4s0pr5n2ZTj8kkT0E7Po1BKhZ2hUdJuY="; 24 + npmDepsHash = "sha256-vz7erDhh3BpHNadPwIXkD2PRCnbxM7e7lE0rvBEXGyc="; 24 25 25 26 nativeBuildInputs = [ 26 27 python3 ··· 35 36 npmBuildScript = "build:prod"; 36 37 37 38 npmWorkspace = "apps/cli"; 39 + 40 + passthru.tests = { 41 + vaultwarden = nixosTests.vaultwarden.sqlite; 42 + }; 38 43 39 44 meta = with lib; { 40 45 changelog = "https://github.com/bitwarden/clients/releases/tag/${src.rev}";
+1 -1
pkgs/tools/security/hashcat/default.nix
··· 2 2 , addOpenGLRunpath 3 3 , config 4 4 , cudaPackages ? {} 5 - , cudaSupport ? config.cudaSupport or false 5 + , cudaSupport ? config.cudaSupport 6 6 , fetchurl 7 7 , makeWrapper 8 8 , opencl-headers
+2 -1
pkgs/tools/security/truecrack/default.nix
··· 1 1 { lib, gccStdenv, fetchFromGitLab, cudatoolkit 2 - , cudaSupport ? false 2 + , config 3 + , cudaSupport ? config.cudaSupport 3 4 , pkg-config }: 4 5 5 6 gccStdenv.mkDerivation rec {
+2 -2
pkgs/tools/text/gtree/default.nix
··· 7 7 8 8 buildGoModule rec { 9 9 pname = "gtree"; 10 - version = "1.9.1"; 10 + version = "1.9.2"; 11 11 12 12 src = fetchFromGitHub { 13 13 owner = "ddddddO"; 14 14 repo = "gtree"; 15 15 rev = "v${version}"; 16 - hash = "sha256-IH+dqPTtVBgIUI63tetS/s5gjleqdTEQ6iD0DeliOjY="; 16 + hash = "sha256-RBGbFC+MOteCImPwzn2WYq5LTYF6rZEpTt1hlfHvUBw="; 17 17 }; 18 18 19 19 vendorHash = "sha256-QxcDa499XV43p8fstENOtfe3iZ176R5/Ub5iovXlYIM=";
+5 -5
pkgs/top-level/all-packages.nix
··· 4207 4207 libtensorflow = python3.pkgs.tensorflow.libtensorflow; 4208 4208 4209 4209 libtorch-bin = callPackage ../development/libraries/science/math/libtorch/bin.nix { 4210 - cudaSupport = config.cudaSupport or false; 4210 + inherit (config) cudaSupport; 4211 4211 }; 4212 4212 4213 4213 tensorflow-lite = callPackage ../development/libraries/science/math/tensorflow-lite { }; ··· 10904 10904 10905 10905 nvidia-thrust-intel = callPackage ../development/libraries/nvidia-thrust { 10906 10906 hostSystem = "TBB"; 10907 - deviceSystem = if config.cudaSupport or false then "CUDA" else "TBB"; 10907 + deviceSystem = if config.cudaSupport then "CUDA" else "TBB"; 10908 10908 }; 10909 10909 10910 10910 nvidia-thrust-cuda = callPackage ../development/libraries/nvidia-thrust { ··· 15169 15169 15170 15170 colm = callPackage ../development/compilers/colm { }; 15171 15171 15172 - colmap = libsForQt5.callPackage ../applications/science/misc/colmap { cudaSupport = config.cudaSupport or false; }; 15172 + colmap = libsForQt5.callPackage ../applications/science/misc/colmap { inherit (config) cudaSupport; }; 15173 15173 colmapWithCuda = colmap.override { cudaSupport = true; }; 15174 15174 15175 15175 chickenPackages_4 = callPackage ../development/compilers/chicken/4 { }; ··· 39361 39361 ### SCIENCE / MATH 39362 39362 39363 39363 caffe = callPackage ../applications/science/math/caffe ({ 39364 - cudaSupport = config.cudaSupport or false; 39364 + inherit (config) cudaSupport; 39365 39365 cudaPackages = cudaPackages_10_1; 39366 39366 opencv3 = opencv3WithoutCuda; # Used only for image loading. 39367 39367 blas = openblas; ··· 39376 39376 stdenv = gcc7Stdenv; 39377 39377 inherit (linuxPackages) nvidia_x11; 39378 39378 opencv3 = opencv3WithoutCuda; # Used only for image loading. 39379 - cudaSupport = config.cudaSupport or false; 39379 + inherit (config) cudaSupport; 39380 39380 }; 39381 39381 39382 39382 dap = callPackage ../applications/science/math/dap { };
+6
pkgs/top-level/config.nix
··· 117 117 ''; 118 118 }; 119 119 120 + cudaSupport = mkMassRebuild { 121 + type = types.bool; 122 + default = false; 123 + feature = "build packages with CUDA support by default"; 124 + }; 125 + 120 126 showDerivationWarnings = mkOption { 121 127 type = types.listOf (types.enum [ "maintainerless" ]); 122 128 default = [];
+15 -11
pkgs/top-level/python-packages.nix
··· 1820 1820 chai = callPackage ../development/python-modules/chai { }; 1821 1821 1822 1822 chainer = callPackage ../development/python-modules/chainer { 1823 - cudaSupport = pkgs.config.cudaSupport or false; 1823 + inherit (pkgs.config) cudaSupport; 1824 1824 }; 1825 1825 1826 1826 chainmap = callPackage ../development/python-modules/chainmap { }; ··· 5290 5290 jax-jumpy = callPackage ../development/python-modules/jax-jumpy { }; 5291 5291 5292 5292 jaxlib-bin = callPackage ../development/python-modules/jaxlib/bin.nix { 5293 - cudaSupport = pkgs.config.cudaSupport or false; 5293 + inherit (pkgs.config) cudaSupport; 5294 5294 }; 5295 5295 5296 5296 jaxlib-build = callPackage ../development/python-modules/jaxlib rec { 5297 5297 inherit (pkgs.darwin) cctools; 5298 5298 # Some platforms don't have `cudaSupport` defined, hence the need for 'or false'. 5299 - cudaSupport = pkgs.config.cudaSupport or false; 5299 + inherit (pkgs.config) cudaSupport; 5300 5300 IOKit = pkgs.darwin.apple_sdk_11_0.IOKit; 5301 5301 protobuf = pkgs.protobuf3_20; # jaxlib-build 0.3.15 won't build with protobuf 3.21 5302 5302 }; ··· 5841 5841 5842 5842 libgpuarray = callPackage ../development/python-modules/libgpuarray { 5843 5843 clblas = pkgs.clblas.override { inherit (self) boost; }; 5844 - cudaSupport = pkgs.config.cudaSupport or false; 5844 + inherit (pkgs.config) cudaSupport; 5845 5845 }; 5846 5846 5847 5847 libiio = (toPythonModule (pkgs.libiio.override { inherit python; })).python; ··· 6167 6167 6168 6168 mac-vendor-lookup = callPackage ../development/python-modules/mac-vendor-lookup { }; 6169 6169 6170 + macaddress = callPackage ../development/python-modules/macaddress{ }; 6171 + 6170 6172 macfsevents = callPackage ../development/python-modules/macfsevents { 6171 6173 inherit (pkgs.darwin.apple_sdk.frameworks) CoreFoundation CoreServices; 6172 6174 }; ··· 7154 7156 num2words = callPackage ../development/python-modules/num2words { }; 7155 7157 7156 7158 numba = callPackage ../development/python-modules/numba { 7157 - cudaSupport = pkgs.config.cudaSupport or false; 7159 + inherit (pkgs.config) cudaSupport; 7158 7160 }; 7159 7161 7160 7162 numbaWithCuda = self.numba.override { ··· 7322 7324 openai-triton-bin = callPackage ../development/python-modules/openai-triton/bin.nix { }; 7323 7325 7324 7326 openai-whisper = callPackage ../development/python-modules/openai-whisper { 7325 - cudaSupport = pkgs.config.cudaSupport or false; 7327 + inherit (pkgs.config) cudaSupport; 7326 7328 }; 7327 7329 7328 7330 openant = callPackage ../development/python-modules/openant { }; ··· 10908 10910 10909 10911 reproject = callPackage ../development/python-modules/reproject { }; 10910 10912 10913 + reprshed = callPackage ../development/python-modules/reprshed { }; 10914 + 10911 10915 reqif = callPackage ../development/python-modules/reqif { }; 10912 10916 10913 10917 requests-aws4auth = callPackage ../development/python-modules/requests-aws4auth { }; ··· 12369 12373 tensorboardx = callPackage ../development/python-modules/tensorboardx { }; 12370 12374 12371 12375 tensorflow-bin = callPackage ../development/python-modules/tensorflow/bin.nix { 12372 - cudaSupport = pkgs.config.cudaSupport or false; 12376 + inherit (pkgs.config) cudaSupport; 12373 12377 }; 12374 12378 12375 12379 tensorflow-build = callPackage ../development/python-modules/tensorflow { 12376 12380 inherit (pkgs.darwin) cctools; 12377 - cudaSupport = pkgs.config.cudaSupport or false; 12381 + inherit (pkgs.config) cudaSupport; 12378 12382 inherit (self.tensorflow-bin) cudaPackages; 12379 12383 inherit (pkgs.darwin.apple_sdk.frameworks) Foundation Security; 12380 12384 flatbuffers-core = pkgs.flatbuffers; ··· 12493 12497 theano-pymc = callPackage ../development/python-modules/theano-pymc { }; 12494 12498 12495 12499 theano = callPackage ../development/python-modules/theano rec { 12496 - cudaSupport = pkgs.config.cudaSupport or false; 12500 + inherit (pkgs.config) cudaSupport; 12497 12501 cudnnSupport = cudaSupport; 12498 12502 }; 12499 12503 ··· 12660 12664 toposort = callPackage ../development/python-modules/toposort { }; 12661 12665 12662 12666 torch = callPackage ../development/python-modules/torch { 12663 - cudaSupport = pkgs.config.cudaSupport or false; 12667 + inherit (pkgs.config) cudaSupport; 12664 12668 magma = 12665 - if pkgs.config.cudaSupport or false 12669 + if pkgs.config.cudaSupport 12666 12670 then pkgs.magma-cuda-static 12667 12671 else pkgs.magma; 12668 12672 inherit (pkgs.darwin.apple_sdk.frameworks) Accelerate CoreServices;