Merge staging-next into staging

This commit is contained in:
github-actions[bot] 2023-07-26 00:02:44 +00:00 committed by GitHub
commit c494d3a0da
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
82 changed files with 1201 additions and 696 deletions

View File

@ -12,8 +12,11 @@ compatible are available as well. For example, there can be a
To use one or more CUDA packages in an expression, give the expression a `cudaPackages` parameter, and in case CUDA is optional
```nix
cudaSupport ? false
cudaPackages ? {}
{ config
, cudaSupport ? config.cudaSupport
, cudaPackages ? { }
, ...
}:
```
When using `callPackage`, you can choose to pass in a different variant, e.g.

View File

@ -173,24 +173,24 @@ final: prev:
LazyVim = buildVimPluginFrom2Nix {
pname = "LazyVim";
version = "2023-07-23";
version = "2023-07-25";
src = fetchFromGitHub {
owner = "LazyVim";
repo = "LazyVim";
rev = "9a0543531d05a417ba63f3dd710530ba5765aca5";
sha256 = "0xr0brs8wvcmw6zpqp2khq7f6k2nscicjd537gg0mv23pcw6skgm";
rev = "aa1cccf230a01bd85d5173f7d87f782fd83caa88";
sha256 = "1kx8n6rn9vgsp7j9kmdz2f6yg812i64nclii0y2cjpnb8h1aa0cf";
};
meta.homepage = "https://github.com/LazyVim/LazyVim/";
};
LeaderF = buildVimPluginFrom2Nix {
pname = "LeaderF";
version = "2023-07-24";
version = "2023-07-25";
src = fetchFromGitHub {
owner = "Yggdroot";
repo = "LeaderF";
rev = "4c5290e277d2a50d83222dacba35aec42c096875";
sha256 = "1a99sdvdjz61hh357psbq4jxyksv1lpn8nn96a5cm02g81922r3z";
rev = "8d51a3512fa318393df2bc092e458fd7d6c8e75b";
sha256 = "0abffydl0h8nnxq5m0vicbi4cxcbfa34m13al7xx0plbk31q3iyd";
};
meta.homepage = "https://github.com/Yggdroot/LeaderF/";
};
@ -559,12 +559,12 @@ final: prev:
ale = buildVimPluginFrom2Nix {
pname = "ale";
version = "2023-07-24";
version = "2023-07-25";
src = fetchFromGitHub {
owner = "dense-analysis";
repo = "ale";
rev = "481c5cccbf48f6df97cfa1489e811438b4f2f088";
sha256 = "1qf42k28p4im6cm9nizxdkzfxnriw7nbnbcinkyg1i56axm4iz3d";
rev = "b216892f0c1ce7bbe9efeeb6cf55b52a473f49c2";
sha256 = "0df56hrqyv1vq19alnpv981fmrb68gx3127izp7pi974r4if87pa";
};
meta.homepage = "https://github.com/dense-analysis/ale/";
};
@ -967,12 +967,12 @@ final: prev:
base46 = buildVimPluginFrom2Nix {
pname = "base46";
version = "2023-07-23";
version = "2023-07-25";
src = fetchFromGitHub {
owner = "nvchad";
repo = "base46";
rev = "4191712e74c44f135a32aeab30576d569bbbded4";
sha256 = "06sr52pz0904hrb04zpz3q5rddgbbkh8rxsiwyp3ygs8w717ij5g";
rev = "cb012feef7ce8c0bb8cdcb2b858393aa92834f46";
sha256 = "1zg0pw2jhx8w21yfky3icai0wq87884ybls34hhn9rwkzn78m4n9";
};
meta.homepage = "https://github.com/nvchad/base46/";
};
@ -1303,12 +1303,12 @@ final: prev:
clangd_extensions-nvim = buildVimPluginFrom2Nix {
pname = "clangd_extensions.nvim";
version = "2023-07-24";
version = "2023-07-25";
src = fetchFromGitHub {
owner = "p00f";
repo = "clangd_extensions.nvim";
rev = "4a822fca87c40099a4e8b27f396e7b24114b60d0";
sha256 = "1jw9hrb4577vn6yx037bd7diklcpkajasw7mv70mdwlxckdvvn02";
rev = "b3b0eb798ecbdd16832fd38d4b07ba31ab4fe831";
sha256 = "127sb5w8sv5ldx6vgzf7ynkw24wpvpdp7m192fh1qgymlnma8hsy";
};
meta.homepage = "https://github.com/p00f/clangd_extensions.nvim/";
};
@ -3021,12 +3021,12 @@ final: prev:
edgy-nvim = buildVimPluginFrom2Nix {
pname = "edgy.nvim";
version = "2023-07-01";
version = "2023-07-25";
src = fetchFromGitHub {
owner = "folke";
repo = "edgy.nvim";
rev = "0d3b64f9159442cf9edcad451a0dd9fb7e31bc41";
sha256 = "1w43qilfhacnmqr76lp2fkbawbndas180f5ab7h133rwgr64lc7p";
rev = "4ccc1c67ae2b1a0c55f18c83d03b714e2bb1bae4";
sha256 = "0s0h8s2wwg2niacp401j7l3c0knl44awf32clq15h1hcabqvvkn3";
};
meta.homepage = "https://github.com/folke/edgy.nvim/";
};
@ -3708,12 +3708,12 @@ final: prev:
gitsigns-nvim = buildNeovimPlugin {
pname = "gitsigns.nvim";
version = "2023-07-18";
version = "2023-07-25";
src = fetchFromGitHub {
owner = "lewis6991";
repo = "gitsigns.nvim";
rev = "adcf2c7f2f495f5df148683764bf7cba6a70f34c";
sha256 = "1lhcysi2v51l5hbv7x74wah0hsndfd6c8slg8q4avbyb46wycppr";
rev = "11b80e7eea249affc8776483272bcfc627b5552a";
sha256 = "0mwmyci65w4rzrvlcws7s6yw4m801vdcqr585harccifyrvpslls";
};
meta.homepage = "https://github.com/lewis6991/gitsigns.nvim/";
};
@ -3732,12 +3732,12 @@ final: prev:
glance-nvim = buildVimPluginFrom2Nix {
pname = "glance.nvim";
version = "2023-07-23";
version = "2023-07-25";
src = fetchFromGitHub {
owner = "DNLHC";
repo = "glance.nvim";
rev = "866d0f8584c129e071d84138c679d39aa9b5684c";
sha256 = "1i2ly61swp25h1vkw2sk7nkkgdbr03qfgqj4j6bd5llyjppypj3q";
rev = "3d67c10c422b2d2800761f4f484305540d54450b";
sha256 = "186zb2zh4njwy2rxfhmgq0bb3nyfiwf7d289k35qnzw0i7b21wkj";
};
meta.homepage = "https://github.com/DNLHC/glance.nvim/";
};
@ -3768,12 +3768,12 @@ final: prev:
go-nvim = buildVimPluginFrom2Nix {
pname = "go.nvim";
version = "2023-07-07";
version = "2023-07-25";
src = fetchFromGitHub {
owner = "ray-x";
repo = "go.nvim";
rev = "6550ddf5ce491d17af009c397aceb25310566eaa";
sha256 = "01im6m0h7pa04dzh0daxkll5y1i7zf5kxlj01cribghl04zlhdxc";
rev = "816fbe43b5dc15edcafa0b32785a4972fb34e67f";
sha256 = "0fs3rf3l0dp0141rc0g75alq89z9khjcvhfz7brn291bik7xm56b";
};
meta.homepage = "https://github.com/ray-x/go.nvim/";
};
@ -5062,12 +5062,12 @@ final: prev:
lsp_signature-nvim = buildVimPluginFrom2Nix {
pname = "lsp_signature.nvim";
version = "2023-06-01";
version = "2023-07-25";
src = fetchFromGitHub {
owner = "ray-x";
repo = "lsp_signature.nvim";
rev = "17ff7a405fea8376b015b8ea7910d2e59958bf68";
sha256 = "1qgl3j9a0b3wf381q859xjw0pcfbfxxm0fsdhj7bgfdq11v2q60p";
rev = "58d4e810801da74c29313da86075d6aea537501f";
sha256 = "14v8mkv3q7l0pv63i3sgiv81bg5yfq927n94nrfz7nwfmg82rxxa";
};
meta.homepage = "https://github.com/ray-x/lsp_signature.nvim/";
};
@ -5267,12 +5267,12 @@ final: prev:
mason-nvim = buildVimPluginFrom2Nix {
pname = "mason.nvim";
version = "2023-07-21";
version = "2023-07-25";
src = fetchFromGitHub {
owner = "williamboman";
repo = "mason.nvim";
rev = "3f6b544c75c01549f7a2a9e395e0f1cea42b25dd";
sha256 = "0sjdxx2lfnaq90vw8n7418bj4dhvk65ksxs7r4mjp0jhygzhssdb";
rev = "fe9e34a9ab4d64321cdc3ecab4ea1809239bb73f";
sha256 = "1yvf5hml1nhglmfaa0da5mjmgxaysc8x8k1rk820vpj5f1bhl70p";
};
meta.homepage = "https://github.com/williamboman/mason.nvim/";
};
@ -5363,12 +5363,12 @@ final: prev:
minimap-vim = buildVimPluginFrom2Nix {
pname = "minimap.vim";
version = "2023-07-24";
version = "2023-07-25";
src = fetchFromGitHub {
owner = "wfxr";
repo = "minimap.vim";
rev = "d8c78a8435196e6884cf93360abe76bbf946e6a7";
sha256 = "0cs4qhl9siymbpg5xw1g4h2qji2vwzy6s430pm05iyrbdrq92gwy";
rev = "74573b63b9ef0583262b6bf6ef209eb7f3b06b94";
sha256 = "040z12dxagbfsbkdwpsz6dk2vpak3z737ra5ipb1ljqsswgrj5f9";
};
meta.homepage = "https://github.com/wfxr/minimap.vim/";
};
@ -5783,12 +5783,12 @@ final: prev:
neogit = buildVimPluginFrom2Nix {
pname = "neogit";
version = "2023-07-23";
version = "2023-07-25";
src = fetchFromGitHub {
owner = "NeogitOrg";
repo = "neogit";
rev = "805a7aa3e5412bbc05c88fb97bef2bc219441098";
sha256 = "0i61s5rdbnsak1a4vwx0164hilx7xslhk112yzr6bxbrnmgxw0sl";
rev = "e94b15969e65eafbf31749700828cac117cc1336";
sha256 = "1anzm10mc94lwnhlcxp4qkxnvf1kwr1bxb4kjq1a2c6v05sx5jfb";
};
meta.homepage = "https://github.com/NeogitOrg/neogit/";
};
@ -6335,12 +6335,12 @@ final: prev:
noice-nvim = buildVimPluginFrom2Nix {
pname = "noice.nvim";
version = "2023-07-22";
version = "2023-07-25";
src = fetchFromGitHub {
owner = "folke";
repo = "noice.nvim";
rev = "c7969e3c25530087b3a52128030163280a7cf679";
sha256 = "0hzn57jsa6ffw9dfyj71pm4r2f1w978qx0s6bk6qv93rrznvjnwz";
rev = "894db25ec726d32047799d4d0a982b701bec453b";
sha256 = "1vpdl0905vxxbcc354v4g2m2nrpc7fmzpn2yjwgmwz34wacvmik5";
};
meta.homepage = "https://github.com/folke/noice.nvim/";
};
@ -6743,12 +6743,12 @@ final: prev:
nvim-fzf = buildVimPluginFrom2Nix {
pname = "nvim-fzf";
version = "2022-07-12";
version = "2023-07-25";
src = fetchFromGitHub {
owner = "vijaymarupudi";
repo = "nvim-fzf";
rev = "a8dc4bae4c1e1552e0233df796e512ab9ca65e44";
sha256 = "0cyq5rq029hnk9p3qw6gfhxvqiz5m788i4w6n4xxb6wif642bd4l";
rev = "45d14cd66c160b199b3c5cef0e7c81793dc2b1e0";
sha256 = "1qv7k1nvh61sd24k0c1iayhv3xw9vx14ciqgdmfggl8d4cfvlg21";
};
meta.homepage = "https://github.com/vijaymarupudi/nvim-fzf/";
};
@ -6935,12 +6935,12 @@ final: prev:
nvim-lspconfig = buildVimPluginFrom2Nix {
pname = "nvim-lspconfig";
version = "2023-07-21";
version = "2023-07-25";
src = fetchFromGitHub {
owner = "neovim";
repo = "nvim-lspconfig";
rev = "dd11ba7b3c8f82d51b6d4dd7d68fce2d78bf78a0";
sha256 = "0qkb5bwd6l17j52pi405ma1iq0lidqz300m3322jv8z8fhagp8si";
rev = "6f426c34c8e21af2f934e56be9d1198a507ecc9f";
sha256 = "167d9df5a3sh69frklk70ff3aw9ks33cc1v6y32iky8i16479zfi";
};
meta.homepage = "https://github.com/neovim/nvim-lspconfig/";
};
@ -7271,12 +7271,12 @@ final: prev:
nvim-treesitter = buildVimPluginFrom2Nix {
pname = "nvim-treesitter";
version = "2023-07-24";
version = "2023-07-25";
src = fetchFromGitHub {
owner = "nvim-treesitter";
repo = "nvim-treesitter";
rev = "7c1e944311a0d4eb2c8a346661ee4ed207aca514";
sha256 = "01aw60dzgj72yk5npwwfgq7l8193kr67yypkyrc6938gdw4p3mqk";
rev = "74a7da4e4be5ee71e9efb6d7bdffa16ad620cc57";
sha256 = "017fp6rmqqf60br9fzc0xkndxcbq68s092k80ac4p47cqwr3blqn";
};
meta.homepage = "https://github.com/nvim-treesitter/nvim-treesitter/";
};
@ -7655,12 +7655,12 @@ final: prev:
orgmode = buildVimPluginFrom2Nix {
pname = "orgmode";
version = "2023-07-20";
version = "2023-07-25";
src = fetchFromGitHub {
owner = "nvim-orgmode";
repo = "orgmode";
rev = "b5e12db00e88a9183fd19d9868698d85aec96aca";
sha256 = "0w016pgkdcrgjviz1banjnr85fp09kyx7wc8h0xwnlxr16d812lm";
rev = "6b6eb8eabbed4d95568fd1f5374a3dff7ed51a3b";
sha256 = "1snqqrpck8wgkc67dzcy6y0y9n37sipkaq6fxxy1h71d8363vkwd";
};
meta.homepage = "https://github.com/nvim-orgmode/orgmode/";
};
@ -8485,12 +8485,12 @@ final: prev:
sg-nvim = buildVimPluginFrom2Nix {
pname = "sg.nvim";
version = "2023-07-24";
version = "2023-07-25";
src = fetchFromGitHub {
owner = "sourcegraph";
repo = "sg.nvim";
rev = "6a59833ea23c7dce49936a71309465ba17e9b661";
sha256 = "0fv3rs74gz56vcishxwpjy4rzxbc58c4kpzcapmrg1ia5hrlmgzb";
rev = "3fdedc7f14ee3967e2b0a49d51fdef1f92b802af";
sha256 = "14lf8izgkr5m0w41k63vp2r2b2ll0zvjkm5c6lqrm3i7cmmln229";
};
meta.homepage = "https://github.com/sourcegraph/sg.nvim/";
};
@ -9800,12 +9800,12 @@ final: prev:
trouble-nvim = buildVimPluginFrom2Nix {
pname = "trouble.nvim";
version = "2023-07-23";
version = "2023-07-25";
src = fetchFromGitHub {
owner = "folke";
repo = "trouble.nvim";
rev = "0e6703c1d37d2d34ed029ab54f9bd66e3f2ecbf7";
sha256 = "1rz22rmv5cg0zr07cwmsh9gxkmfgz4s3ld7g3mnybpxgan251k17";
rev = "fc4bb22b1d2cd5eb46fe61a9f6d6416d742beb5c";
sha256 = "0mhhjl4q45bn0i22jqri6v3rp24d7l3k2q72ggx5i1xinxls3ap5";
};
meta.homepage = "https://github.com/folke/trouble.nvim/";
};
@ -15205,12 +15205,12 @@ final: prev:
wiki-vim = buildVimPluginFrom2Nix {
pname = "wiki.vim";
version = "2023-07-20";
version = "2023-07-25";
src = fetchFromGitHub {
owner = "lervag";
repo = "wiki.vim";
rev = "1c733d36026c4f9c9dac742c73a23f24838e6fef";
sha256 = "01ff7cj784h2w970hmjmvhbv8f76wla3b1pnhsvrgfl2rlcf6gd9";
rev = "4bd7d1b21a0197f11b336cefb434132b5e595dcf";
sha256 = "176v8idcjv32q4kywdrr5xqpj849ckcdlvqybv04mhd6wcnq3xzr";
};
meta.homepage = "https://github.com/lervag/wiki.vim/";
};
@ -15566,12 +15566,12 @@ final: prev:
lspsaga-nvim-original = buildVimPluginFrom2Nix {
pname = "lspsaga-nvim-original";
version = "2023-07-24";
version = "2023-07-25";
src = fetchFromGitHub {
owner = "nvimdev";
repo = "lspsaga.nvim";
rev = "e1e617638b08179273ab2a0161249b9ff57cee0c";
sha256 = "158l3qicvx1fi56frn4na6yangjw66mdxdf1n682ambr62fvgcj6";
rev = "31b4b4336d05e7c8ff0f833a493de2a2875f1b38";
sha256 = "0m426zxd6liah3xfdnxjs289c27z31fw8r0fdw8dvnvgsbhz1a2v";
};
meta.homepage = "https://github.com/nvimdev/lspsaga.nvim/";
};
@ -15588,6 +15588,18 @@ final: prev:
meta.homepage = "https://github.com/mattn/calendar-vim/";
};
nightfly = buildVimPluginFrom2Nix {
pname = "nightfly";
version = "2023-07-19";
src = fetchFromGitHub {
owner = "bluz71";
repo = "vim-nightfly-colors";
rev = "cd68ec3c0a3ca2bf15072dd2040401ea4b89e79f";
sha256 = "00nfpkpv0li3wgh926azp8xf1zvdh3zc6fx5aznplhs9j6xbdx21";
};
meta.homepage = "https://github.com/bluz71/vim-nightfly-colors/";
};
nord-vim = buildVimPluginFrom2Nix {
pname = "nord-vim";
version = "2023-05-03";
@ -15602,12 +15614,12 @@ final: prev:
nvchad-extensions = buildVimPluginFrom2Nix {
pname = "nvchad-extensions";
version = "2023-07-24";
version = "2023-07-25";
src = fetchFromGitHub {
owner = "nvchad";
repo = "extensions";
rev = "16715bc45900e9771be3656c50801f751a8d9b46";
sha256 = "1pjny541m23h4iw8b9wg6dlapa57ffzqlpws6bcsdiw6j91mcpla";
rev = "0abb3ead8ce6ffa0e03b596a000d231b5e5d406b";
sha256 = "13bngm38j90n21szilc27bpdzgjk4g41a6a8yz1bc60rddxxjxr3";
};
meta.homepage = "https://github.com/nvchad/extensions/";
};

View File

@ -1509,12 +1509,12 @@
};
puppet = buildGrammar {
language = "puppet";
version = "0.0.0+rev=8e13a37";
version = "0.0.0+rev=9ce9a5f";
src = fetchFromGitHub {
owner = "amaanq";
repo = "tree-sitter-puppet";
rev = "8e13a3768091703ac27ef1e5763e542af7f6dead";
hash = "sha256-vBxCqFsSF2kwUK5uNWDPvl7F+mcD8rdTzsckcab4vUU=";
rev = "9ce9a5f7d64528572aaa8d59459ba869e634086b";
hash = "sha256-YEjjy9WLwITERYqoeSVrRYnwVBIAwdc4o0lvAK9wizw=";
};
meta.homepage = "https://github.com/amaanq/tree-sitter-puppet";
};

View File

@ -932,7 +932,7 @@ self: super: {
pname = "sg-nvim-rust";
inherit (old) version src;
cargoHash = "sha256-wR1QIB4Qqw/b2f7XFbPytDSz/8BtaFep3BZuT0RJ3hg=";
cargoHash = "sha256-KhUCIAGSgf7TxabEzcjo582VgbSU79QSGlaEP7BbJCE=";
nativeBuildInputs = [ pkg-config ];

View File

@ -1093,6 +1093,7 @@ https://github.com/jistr/vim-nerdtree-tabs/,,
https://github.com/nfnty/vim-nftables/,,
https://github.com/kana/vim-niceblock/,,
https://github.com/nickel-lang/vim-nickel/,main,
https://github.com/bluz71/vim-nightfly-colors/,,nightfly
https://github.com/tommcdo/vim-ninja-feet/,,
https://github.com/LnL7/vim-nix/,,
https://github.com/symphorien/vim-nixhash/,,

View File

@ -54,7 +54,7 @@
, breeze-icons
, oxygen
, cudaSupport ? config.cudaSupport or false
, cudaSupport ? config.cudaSupport
, cudaPackages ? {}
}:

View File

@ -5,7 +5,7 @@
, openvdb, libXxf86vm, tbb, alembic
, zlib, zstd, fftw, opensubdiv, freetype, jemalloc, ocl-icd, addOpenGLRunpath
, jackaudioSupport ? false, libjack2
, cudaSupport ? config.cudaSupport or false, cudaPackages ? {}
, cudaSupport ? config.cudaSupport, cudaPackages ? { }
, hipSupport ? false, hip # comes with a significantly larger closure size
, colladaSupport ? true, opencollada
, spaceNavSupport ? stdenv.isLinux, libspnav

View File

@ -30,11 +30,11 @@ in
stdenv.mkDerivation rec {
pname = "teamspeak-client";
version = "3.6.0";
version = "3.6.1";
src = fetchurl {
url = "https://files.teamspeak-services.com/releases/client/${version}/TeamSpeak3-Client-linux_${arch}-${version}.run";
hash = "sha256-ZbElnFoQmXdtCR9lb6eOz4dMzSwpfjC1DvG3VbDoSEA=";
hash = "sha256-j4sgZ+tJpV6ST0yLmbLTLgBxQTcK1LZoEEfMe3TUAC4=";
};
# grab the plugin sdk for the desktop icon

View File

@ -0,0 +1,32 @@
From 982d38084f08950863b55043f36ce5548bd73635 Mon Sep 17 00:00:00 2001
From: Maximilian Bosch <maximilian@mbosch.me>
Date: Mon, 24 Jul 2023 19:12:25 +0200
Subject: [PATCH] Strip away BUILDCONFIG
The `BuildConfig` field in `libsofficeapp.so` includes the entire
`PKG_CONFIG_PATH` and subsequently references to a lot of `dev` outputs
of library dependencies blowing up the closure.
Since this is not strictly needed and the inputs are comprehensible via
`nix derivation show`, this doesn't bring a real benefit in the case of
nixpkgs anyways.
---
desktop/source/lib/init.cxx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 8d830c0cbd00..fbdc86aa7115 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -7097,7 +7097,7 @@ static char* lo_getVersionInfo(SAL_UNUSED_PARAMETER LibreOfficeKit* /*pThis*/)
"\"ProductVersion\": \"%PRODUCTVERSION\", "
"\"ProductExtension\": \"%PRODUCTEXTENSION\", "
"\"BuildId\": \"%BUILDID\", "
- "\"BuildConfig\": \"" BUILDCONFIG "\" "
+ "\"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.\" "
"}"));
}
--
2.40.1

View File

@ -214,6 +214,22 @@ in
tar -xf ${srcs.translations}
'';
# Remove build config to reduce the amount of `-dev` outputs in the
# runtime closure. This was introduced in upstream commit
# cbfac11330882c7d0a817b6c37a08b2ace2b66f4, so the patch doesn't apply
# for 7.4.
patches = lib.optionals (lib.versionAtLeast version "7.5") [
./0001-Strip-away-BUILDCONFIG.patch
];
# libreoffice tries to reference the BUILDCONFIG (e.g. PKG_CONFIG_PATH)
# in the binary causing the closure size to blow up because of many unnecessary
# dependencies to dev outputs. This behavior was patched away in nixpkgs
# (see above), make sure these don't leak again by accident.
disallowedRequisites = lib.concatMap
(x: lib.optional (x?dev) x.dev)
buildInputs;
### QT/KDE
#
# configure.ac assumes that the first directory that contains headers and

View File

@ -33,7 +33,7 @@ python3Packages.buildPythonApplication rec {
homepage = "https://github.com/jopohl/urh";
description = "Universal Radio Hacker: investigate wireless protocols like a boss";
license = licenses.gpl3;
platforms = platforms.linux;
platforms = platforms.unix;
maintainers = with maintainers; [ fpletz ];
};
}

View File

@ -13,7 +13,7 @@
, Accelerate, CoreGraphics, CoreVideo
, lmdbSupport ? true, lmdb
, leveldbSupport ? true, leveldb, snappy
, cudaSupport ? config.cudaSupport or false, cudaPackages ? {}
, cudaSupport ? config.cudaSupport, cudaPackages ? { }
, cudnnSupport ? cudaSupport
, ncclSupport ? false
, pythonSupport ? false, python ? null, numpy ? null

View File

@ -2,7 +2,8 @@
, fetchpatch
, openblas, blas, lapack, opencv3, libzip, boost, protobuf, mpi
, onebitSGDSupport ? false
, cudaSupport ? false, cudaPackages ? {}, addOpenGLRunpath, cudatoolkit, nvidia_x11
, config
, cudaSupport ? config.cudaSupport, cudaPackages ? { }, addOpenGLRunpath, cudatoolkit, nvidia_x11
, cudnnSupport ? cudaSupport
}:

View File

@ -2,7 +2,7 @@
, config
, lib
, cudaPackages
, cudaSupport ? config.cudaSupport or false
, cudaSupport ? config.cudaSupport
, lang ? "en"
, webdoc ? false
, version ? null

View File

@ -1,6 +1,6 @@
{ config, stdenv, lib, fetchurl, fetchpatch, bash, cmake
, opencv3, gtest, blas, gomp, llvmPackages, perl
, cudaSupport ? config.cudaSupport or false, cudaPackages ? {}, nvidia_x11
, cudaSupport ? config.cudaSupport, cudaPackages ? { }, nvidia_x11
, cudnnSupport ? cudaSupport
}:

View File

@ -1,6 +1,7 @@
{ mkDerivation, lib, fetchFromGitHub, cmake, boost179, ceres-solver, eigen,
freeimage, glog, libGLU, glew, qtbase,
cudaSupport ? false, cudaPackages }:
config,
cudaSupport ? config.cudaSupport, cudaPackages }:
assert cudaSupport -> cudaPackages != { };

View File

@ -1,7 +1,8 @@
{ lib, stdenv, fetchurl, cmake, hwloc, fftw, perl, blas, lapack, mpi, cudatoolkit
, singlePrec ? true
, config
, enableMpi ? false
, enableCuda ? false
, enableCuda ? config.cudaSupport
, cpuAcceleration ? null
}:

View File

@ -8,19 +8,19 @@
rustPlatform.buildRustPackage rec {
pname = "gex";
version = "0.5.0";
version = "0.6.0";
src = fetchFromGitHub {
owner = "Piturnah";
repo = pname;
rev = "v${version}";
hash = "sha256-//sQ0s8bBQzuu5aO3RjPRjFuVYiGW6BwSPoCWKAx9DQ=";
hash = "sha256-J2tmDpt4vRFgD5yfFZOdBLROvyZVEthc+MHM1Yta5jI=";
};
nativeBuildInputs = [ pkg-config ];
buildInputs = [ libgit2 ];
cargoHash = "sha256-rkhkFnRDtMTWFM+E5C4jR7TWtHdy3WUtIzvGDDLHqtE=";
cargoHash = "sha256-AsUHswR7+wMyAvOp3rkvRJvThHLH993gQ+/V38vbbNQ=";
meta = with lib; {
description = "Git Explorer: cross-platform git workflow improvement tool inspired by Magit";

View File

@ -12,13 +12,13 @@
buildPythonApplication rec {
pname = "git-machete";
version = "3.17.6";
version = "3.17.8";
src = fetchFromGitHub {
owner = "virtuslab";
repo = pname;
rev = "v${version}";
hash = "sha256-o3Z1xPu5RcspU4m3Bb6ydZkXOMgOMJPN/+TLekwe/wI=";
hash = "sha256-d1vbLlGKln/zcuuKZgNOcu/z15co3p8ecrwL5lucIEk=";
};
nativeBuildInputs = [ installShellFiles ];

View File

@ -0,0 +1,80 @@
{ lib, runCommandNoCC, dasel }:
let
daselBin = lib.getExe dasel;
inherit (lib)
last
optionalString
types
;
in
rec {
# Creates a transformer function that writes input data to disk, transformed
# by both the `input` and `output` arguments.
#
# Type: makeDataWriter :: input -> output -> nameOrPath -> data -> (any -> string) -> string -> string -> any -> derivation
#
# input :: T -> string: function that takes the nix data and returns a string
# output :: string: script that takes the $inputFile and write the result into $out
# 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.
# data :: T: the data that will be converted.
#
# Example:
# writeJSON = makeDataWriter { input = builtins.toJSON; output = "cp $inputPath $out"; };
# myConfig = writeJSON "config.json" { hello = "world"; }
#
makeDataWriter = { input ? lib.id, output ? "cp $inputPath $out" }: nameOrPath: data:
assert lib.or (types.path.check nameOrPath) (builtins.match "([0-9A-Za-z._])[0-9A-Za-z._-]*" nameOrPath != null);
let
name = last (builtins.split "/" nameOrPath);
in
runCommandNoCC name
{
input = input data;
passAsFile = [ "input" ];
} ''
${output}
${optionalString (types.path.check nameOrPath) ''
mv $out tmp
mkdir -p $out/$(dirname "${nameOrPath}")
mv tmp $out/${nameOrPath}
''}
'';
# Writes the content to text.
#
# Example:
# writeText "filename.txt" "file content"
writeText = makeDataWriter {
input = toString;
output = "cp $inputPath $out";
};
# Writes the content to a JSON file.
#
# Example:
# writeJSON "data.json" { hello = "world"; }
writeJSON = makeDataWriter {
input = builtins.toJSON;
output = "${daselBin} -f $inputPath -r json -w json > $out";
};
# Writes the content to a TOML file.
#
# Example:
# writeTOML "data.toml" { hello = "world"; }
writeTOML = makeDataWriter {
input = builtins.toJSON;
output = "${daselBin} -f $inputPath -r json -w toml > $out";
};
# Writes the content to a YAML file.
#
# Example:
# writeYAML "data.yaml" { hello = "world"; }
writeYAML = makeDataWriter {
input = builtins.toJSON;
output = "${daselBin} -f $inputPath -r json -w yaml > $out";
};
}

View File

@ -1,367 +1,18 @@
{ pkgs, config, buildPackages, lib, stdenv, libiconv, mkNugetDeps, mkNugetSource, gixy }:
{ pkgs, config, lib }:
let
aliases = if config.allowAliases then (import ./aliases.nix lib) else prev: {};
writers = with lib; rec {
# Base implementation for non-compiled executables.
# Takes an interpreter, for example `${pkgs.bash}/bin/bash`
#
# Examples:
# writeBash = makeScriptWriter { interpreter = "${pkgs.bash}/bin/bash"; }
# makeScriptWriter { interpreter = "${pkgs.dash}/bin/dash"; } "hello" "echo hello world"
makeScriptWriter = { interpreter, check ? "" }: nameOrPath: content:
assert lib.or (types.path.check nameOrPath) (builtins.match "([0-9A-Za-z._])[0-9A-Za-z._-]*" nameOrPath != null);
assert lib.or (types.path.check content) (types.str.check content);
let
name = last (builtins.split "/" nameOrPath);
in
pkgs.runCommandLocal name (if (types.str.check content) then {
inherit content interpreter;
passAsFile = [ "content" ];
} else {
inherit interpreter;
contentPath = content;
}) ''
# On darwin a script cannot be used as an interpreter in a shebang but
# there doesn't seem to be a limit to the size of shebang and multiple
# arguments to the interpreter are allowed.
if [[ -n "${toString pkgs.stdenvNoCC.isDarwin}" ]] && isScript $interpreter
then
wrapperInterpreterLine=$(head -1 "$interpreter" | tail -c+3)
# Get first word from the line (note: xargs echo remove leading spaces)
wrapperInterpreter=$(echo "$wrapperInterpreterLine" | xargs echo | cut -d " " -f1)
if isScript $wrapperInterpreter
then
echo "error: passed interpreter ($interpreter) is a script which has another script ($wrapperInterpreter) as an interpreter, which is not supported."
exit 1
fi
# This should work as long as wrapperInterpreter is a shell, which is
# the case for programs wrapped with makeWrapper, like
# python3.withPackages etc.
interpreterLine="$wrapperInterpreterLine $interpreter"
else
interpreterLine=$interpreter
fi
echo "#! $interpreterLine" > $out
cat "$contentPath" >> $out
${optionalString (check != "") ''
${check} $out
''}
chmod +x $out
${optionalString (types.path.check nameOrPath) ''
mv $out tmp
mkdir -p $out/$(dirname "${nameOrPath}")
mv tmp $out/${nameOrPath}
''}
'';
# Base implementation for compiled executables.
# Takes a compile script, which in turn takes the name as an argument.
#
# Examples:
# writeSimpleC = makeBinWriter { compileScript = name: "gcc -o $out $contentPath"; }
makeBinWriter = { compileScript, strip ? true }: nameOrPath: content:
assert lib.or (types.path.check nameOrPath) (builtins.match "([0-9A-Za-z._])[0-9A-Za-z._-]*" nameOrPath != null);
assert lib.or (types.path.check content) (types.str.check content);
let
name = last (builtins.split "/" nameOrPath);
in
pkgs.runCommand name ((if (types.str.check content) then {
inherit content;
passAsFile = [ "content" ];
} else {
contentPath = content;
}) // lib.optionalAttrs (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) {
# post-link-hook expects codesign_allocate to be in PATH
# https://github.com/NixOS/nixpkgs/issues/154203
# https://github.com/NixOS/nixpkgs/issues/148189
nativeBuildInputs = [ stdenv.cc.bintools ];
}) ''
${compileScript}
${lib.optionalString strip
"${lib.getBin buildPackages.bintools-unwrapped}/bin/${buildPackages.bintools-unwrapped.targetPrefix}strip -S $out"}
# Sometimes binaries produced for darwin (e. g. by GHC) won't be valid
# mach-o executables from the get-go, but need to be corrected somehow
# which is done by fixupPhase.
${lib.optionalString pkgs.stdenvNoCC.hostPlatform.isDarwin "fixupPhase"}
${optionalString (types.path.check nameOrPath) ''
mv $out tmp
mkdir -p $out/$(dirname "${nameOrPath}")
mv tmp $out/${nameOrPath}
''}
'';
# Like writeScript but the first line is a shebang to bash
#
# Example:
# writeBash "example" ''
# echo hello world
# ''
writeBash = makeScriptWriter {
interpreter = "${pkgs.bash}/bin/bash";
# Writers for JSON-like data structures
dataWriters = import ./data.nix {
inherit lib; inherit (pkgs) runCommandNoCC dasel;
};
# Like writeScriptBin but the first line is a shebang to bash
writeBashBin = name:
writeBash "/bin/${name}";
# Like writeScript but the first line is a shebang to dash
#
# Example:
# writeDash "example" ''
# echo hello world
# ''
writeDash = makeScriptWriter {
interpreter = "${pkgs.dash}/bin/dash";
# Writers for scripts
scriptWriters = import ./scripts.nix {
inherit lib pkgs;
};
# Like writeScriptBin but the first line is a shebang to dash
writeDashBin = name:
writeDash "/bin/${name}";
# Like writeScript but the first line is a shebang to fish
#
# Example:
# writeFish "example" ''
# echo hello world
# ''
writeFish = makeScriptWriter {
interpreter = "${pkgs.fish}/bin/fish --no-config";
check = "${pkgs.fish}/bin/fish --no-config --no-execute"; # syntax check only
};
# Like writeScriptBin but the first line is a shebang to fish
writeFishBin = name:
writeFish "/bin/${name}";
# writeHaskell takes a name, an attrset with libraries and haskell version (both optional)
# and some haskell source code and returns an executable.
#
# Example:
# writeHaskell "missiles" { libraries = [ pkgs.haskellPackages.acme-missiles ]; } ''
# import Acme.Missiles
#
# main = launchMissiles
# '';
writeHaskell = name: {
libraries ? [],
ghc ? pkgs.ghc,
ghcArgs ? [],
threadedRuntime ? true,
strip ? true
}:
let
appendIfNotSet = el: list: if elem el list then list else list ++ [ el ];
ghcArgs' = if threadedRuntime then appendIfNotSet "-threaded" ghcArgs else ghcArgs;
in makeBinWriter {
compileScript = ''
cp $contentPath tmp.hs
${ghc.withPackages (_: libraries )}/bin/ghc ${lib.escapeShellArgs ghcArgs'} tmp.hs
mv tmp $out
'';
inherit strip;
} name;
# writeHaskellBin takes the same arguments as writeHaskell but outputs a directory (like writeScriptBin)
writeHaskellBin = name:
writeHaskell "/bin/${name}";
writeRust = name: {
rustc ? pkgs.rustc,
rustcArgs ? [],
strip ? true
}:
let
darwinArgs = lib.optionals stdenv.isDarwin [ "-L${lib.getLib libiconv}/lib" ];
in
makeBinWriter {
compileScript = ''
cp "$contentPath" tmp.rs
PATH=${makeBinPath [pkgs.gcc]} ${lib.getBin rustc}/bin/rustc ${lib.escapeShellArgs rustcArgs} ${lib.escapeShellArgs darwinArgs} -o "$out" tmp.rs
'';
inherit strip;
} name;
writeRustBin = name:
writeRust "/bin/${name}";
# writeJS takes a name an attributeset with libraries and some JavaScript sourcecode and
# returns an executable
#
# Example:
# writeJS "example" { libraries = [ pkgs.nodePackages.uglify-js ]; } ''
# var UglifyJS = require("uglify-js");
# var code = "function add(first, second) { return first + second; }";
# var result = UglifyJS.minify(code);
# console.log(result.code);
# ''
writeJS = name: { libraries ? [] }: content:
let
node-env = pkgs.buildEnv {
name = "node";
paths = libraries;
pathsToLink = [
"/lib/node_modules"
];
};
in writeDash name ''
export NODE_PATH=${node-env}/lib/node_modules
exec ${pkgs.nodejs}/bin/node ${pkgs.writeText "js" content} "$@"
'';
# writeJSBin takes the same arguments as writeJS but outputs a directory (like writeScriptBin)
writeJSBin = name:
writeJS "/bin/${name}";
awkFormatNginx = builtins.toFile "awkFormat-nginx.awk" ''
awk -f
{sub(/^[ \t]+/,"");idx=0}
/\{/{ctx++;idx=1}
/\}/{ctx--}
{id="";for(i=idx;i<ctx;i++)id=sprintf("%s%s", id, "\t");printf "%s%s\n", id, $0}
'';
writeNginxConfig = name: text: pkgs.runCommandLocal name {
inherit text;
passAsFile = [ "text" ];
nativeBuildInputs = [ gixy ];
} /* sh */ ''
# nginx-config-formatter has an error - https://github.com/1connect/nginx-config-formatter/issues/16
awk -f ${awkFormatNginx} "$textPath" | sed '/^\s*$/d' > $out
gixy $out
'';
# writePerl takes a name an attributeset with libraries and some perl sourcecode and
# returns an executable
#
# Example:
# writePerl "example" { libraries = [ pkgs.perlPackages.boolean ]; } ''
# use boolean;
# print "Howdy!\n" if true;
# ''
writePerl = name: { libraries ? [] }:
makeScriptWriter {
interpreter = "${pkgs.perl.withPackages (p: libraries)}/bin/perl";
} name;
# writePerlBin takes the same arguments as writePerl but outputs a directory (like writeScriptBin)
writePerlBin = name:
writePerl "/bin/${name}";
# makePythonWriter takes python and compatible pythonPackages and produces python script writer,
# which validates the script with flake8 at build time. If any libraries are specified,
# python.withPackages is used as interpreter, otherwise the "bare" python is used.
makePythonWriter = python: pythonPackages: buildPythonPackages: name: { libraries ? [], flakeIgnore ? [] }:
let
ignoreAttribute = optionalString (flakeIgnore != []) "--ignore ${concatMapStringsSep "," escapeShellArg flakeIgnore}";
in
makeScriptWriter {
interpreter =
if libraries == []
then python.interpreter
else (python.withPackages (ps: libraries)).interpreter
;
check = optionalString python.isPy3k (writeDash "pythoncheck.sh" ''
exec ${buildPythonPackages.flake8}/bin/flake8 --show-source ${ignoreAttribute} "$1"
'');
} name;
# writePyPy2 takes a name an attributeset with libraries and some pypy2 sourcecode and
# returns an executable
#
# Example:
# writePyPy2 "test_pypy2" { libraries = [ pkgs.pypy2Packages.enum ]; } ''
# from enum import Enum
#
# class Test(Enum):
# a = "success"
#
# print Test.a
# ''
writePyPy2 = makePythonWriter pkgs.pypy2 pkgs.pypy2Packages buildPackages.pypy2Packages;
# writePyPy2Bin takes the same arguments as writePyPy2 but outputs a directory (like writeScriptBin)
writePyPy2Bin = name:
writePyPy2 "/bin/${name}";
# writePython3 takes a name an attributeset with libraries and some python3 sourcecode and
# returns an executable
#
# Example:
# writePython3 "test_python3" { libraries = [ pkgs.python3Packages.pyyaml ]; } ''
# import yaml
#
# y = yaml.load("""
# - test: success
# """)
# print(y[0]['test'])
# ''
writePython3 = makePythonWriter pkgs.python3 pkgs.python3Packages buildPackages.python3Packages;
# writePython3Bin takes the same arguments as writePython3 but outputs a directory (like writeScriptBin)
writePython3Bin = name:
writePython3 "/bin/${name}";
# writePyPy3 takes a name an attributeset with libraries and some pypy3 sourcecode and
# returns an executable
#
# Example:
# writePyPy3 "test_pypy3" { libraries = [ pkgs.pypy3Packages.pyyaml ]; } ''
# import yaml
#
# y = yaml.load("""
# - test: success
# """)
# print(y[0]['test'])
# ''
writePyPy3 = makePythonWriter pkgs.pypy3 pkgs.pypy3Packages buildPackages.pypy3Packages;
# writePyPy3Bin takes the same arguments as writePyPy3 but outputs a directory (like writeScriptBin)
writePyPy3Bin = name:
writePyPy3 "/bin/${name}";
makeFSharpWriter = { dotnet-sdk ? pkgs.dotnet-sdk, fsi-flags ? "", libraries ? _: [] }: nameOrPath:
let
fname = last (builtins.split "/" nameOrPath);
path = if strings.hasSuffix ".fsx" nameOrPath then nameOrPath else "${nameOrPath}.fsx";
_nugetDeps = mkNugetDeps { name = "${fname}-nuget-deps"; nugetDeps = libraries; };
nuget-source = mkNugetSource {
name = "${fname}-nuget-source";
description = "A Nuget source with the dependencies for ${fname}";
deps = [ _nugetDeps ];
};
fsi = writeBash "fsi" ''
export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
export DOTNET_CLI_TELEMETRY_OPTOUT=1
export DOTNET_NOLOGO=1
script="$1"; shift
${dotnet-sdk}/bin/dotnet fsi --quiet --nologo --readline- ${fsi-flags} "$@" < "$script"
'';
in content: writers.makeScriptWriter {
interpreter = fsi;
} path
''
#i "nuget: ${nuget-source}/lib"
${ content }
exit 0
'';
writeFSharp =
makeFSharpWriter {};
writeFSharpBin = name:
writeFSharp "/bin/${name}";
};
writers = scriptWriters // dataWriters;
in
writers // (aliases writers)

View File

@ -0,0 +1,383 @@
{ pkgs, lib }:
let
inherit (lib)
concatMapStringsSep
elem
escapeShellArg
last
optionalString
stringLength
strings
types
;
inherit (pkgs)
buildPackages
gixy
libiconv
mkNugetDeps
mkNugetSource
stdenv
;
in
rec {
# Base implementation for non-compiled executables.
# Takes an interpreter, for example `${pkgs.bash}/bin/bash`
#
# Examples:
# writeBash = makeScriptWriter { interpreter = "${pkgs.bash}/bin/bash"; }
# makeScriptWriter { interpreter = "${pkgs.dash}/bin/dash"; } "hello" "echo hello world"
makeScriptWriter = { interpreter, check ? "" }: nameOrPath: content:
assert lib.or (types.path.check nameOrPath) (builtins.match "([0-9A-Za-z._])[0-9A-Za-z._-]*" nameOrPath != null);
assert lib.or (types.path.check content) (types.str.check content);
let
name = last (builtins.split "/" nameOrPath);
in
pkgs.runCommandLocal name (if (types.str.check content) then {
inherit content interpreter;
passAsFile = [ "content" ];
} else {
inherit interpreter;
contentPath = content;
}) ''
# On darwin a script cannot be used as an interpreter in a shebang but
# there doesn't seem to be a limit to the size of shebang and multiple
# arguments to the interpreter are allowed.
if [[ -n "${toString pkgs.stdenvNoCC.isDarwin}" ]] && isScript $interpreter
then
wrapperInterpreterLine=$(head -1 "$interpreter" | tail -c+3)
# Get first word from the line (note: xargs echo remove leading spaces)
wrapperInterpreter=$(echo "$wrapperInterpreterLine" | xargs echo | cut -d " " -f1)
if isScript $wrapperInterpreter
then
echo "error: passed interpreter ($interpreter) is a script which has another script ($wrapperInterpreter) as an interpreter, which is not supported."
exit 1
fi
# This should work as long as wrapperInterpreter is a shell, which is
# the case for programs wrapped with makeWrapper, like
# python3.withPackages etc.
interpreterLine="$wrapperInterpreterLine $interpreter"
else
interpreterLine=$interpreter
fi
echo "#! $interpreterLine" > $out
cat "$contentPath" >> $out
${optionalString (check != "") ''
${check} $out
''}
chmod +x $out
${optionalString (types.path.check nameOrPath) ''
mv $out tmp
mkdir -p $out/$(dirname "${nameOrPath}")
mv tmp $out/${nameOrPath}
''}
'';
# Base implementation for compiled executables.
# Takes a compile script, which in turn takes the name as an argument.
#
# Examples:
# writeSimpleC = makeBinWriter { compileScript = name: "gcc -o $out $contentPath"; }
makeBinWriter = { compileScript, strip ? true }: nameOrPath: content:
assert lib.or (types.path.check nameOrPath) (builtins.match "([0-9A-Za-z._])[0-9A-Za-z._-]*" nameOrPath != null);
assert lib.or (types.path.check content) (types.str.check content);
let
name = last (builtins.split "/" nameOrPath);
in
pkgs.runCommand name ((if (types.str.check content) then {
inherit content;
passAsFile = [ "content" ];
} else {
contentPath = content;
}) // lib.optionalAttrs (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) {
# post-link-hook expects codesign_allocate to be in PATH
# https://github.com/NixOS/nixpkgs/issues/154203
# https://github.com/NixOS/nixpkgs/issues/148189
nativeBuildInputs = [ stdenv.cc.bintools ];
}) ''
${compileScript}
${lib.optionalString strip
"${lib.getBin buildPackages.bintools-unwrapped}/bin/${buildPackages.bintools-unwrapped.targetPrefix}strip -S $out"}
# Sometimes binaries produced for darwin (e. g. by GHC) won't be valid
# mach-o executables from the get-go, but need to be corrected somehow
# which is done by fixupPhase.
${lib.optionalString pkgs.stdenvNoCC.hostPlatform.isDarwin "fixupPhase"}
${optionalString (types.path.check nameOrPath) ''
mv $out tmp
mkdir -p $out/$(dirname "${nameOrPath}")
mv tmp $out/${nameOrPath}
''}
'';
# Like writeScript but the first line is a shebang to bash
#
# Example:
# writeBash "example" ''
# echo hello world
# ''
writeBash = makeScriptWriter {
interpreter = "${pkgs.bash}/bin/bash";
};
# Like writeScriptBin but the first line is a shebang to bash
writeBashBin = name:
writeBash "/bin/${name}";
# Like writeScript but the first line is a shebang to dash
#
# Example:
# writeDash "example" ''
# echo hello world
# ''
writeDash = makeScriptWriter {
interpreter = "${pkgs.dash}/bin/dash";
};
# Like writeScriptBin but the first line is a shebang to dash
writeDashBin = name:
writeDash "/bin/${name}";
# Like writeScript but the first line is a shebang to fish
#
# Example:
# writeFish "example" ''
# echo hello world
# ''
writeFish = makeScriptWriter {
interpreter = "${pkgs.fish}/bin/fish --no-config";
check = "${pkgs.fish}/bin/fish --no-config --no-execute"; # syntax check only
};
# Like writeScriptBin but the first line is a shebang to fish
writeFishBin = name:
writeFish "/bin/${name}";
# writeHaskell takes a name, an attrset with libraries and haskell version (both optional)
# and some haskell source code and returns an executable.
#
# Example:
# writeHaskell "missiles" { libraries = [ pkgs.haskellPackages.acme-missiles ]; } ''
# import Acme.Missiles
#
# main = launchMissiles
# '';
writeHaskell = name: {
libraries ? [],
ghc ? pkgs.ghc,
ghcArgs ? [],
threadedRuntime ? true,
strip ? true
}:
let
appendIfNotSet = el: list: if elem el list then list else list ++ [ el ];
ghcArgs' = if threadedRuntime then appendIfNotSet "-threaded" ghcArgs else ghcArgs;
in makeBinWriter {
compileScript = ''
cp $contentPath tmp.hs
${ghc.withPackages (_: libraries )}/bin/ghc ${lib.escapeShellArgs ghcArgs'} tmp.hs
mv tmp $out
'';
inherit strip;
} name;
# writeHaskellBin takes the same arguments as writeHaskell but outputs a directory (like writeScriptBin)
writeHaskellBin = name:
writeHaskell "/bin/${name}";
writeRust = name: {
rustc ? pkgs.rustc,
rustcArgs ? [],
strip ? true
}:
let
darwinArgs = lib.optionals stdenv.isDarwin [ "-L${lib.getLib libiconv}/lib" ];
in
makeBinWriter {
compileScript = ''
cp "$contentPath" tmp.rs
PATH=${lib.makeBinPath [pkgs.gcc]} ${lib.getBin rustc}/bin/rustc ${lib.escapeShellArgs rustcArgs} ${lib.escapeShellArgs darwinArgs} -o "$out" tmp.rs
'';
inherit strip;
} name;
writeRustBin = name:
writeRust "/bin/${name}";
# writeJS takes a name an attributeset with libraries and some JavaScript sourcecode and
# returns an executable
#
# Example:
# writeJS "example" { libraries = [ pkgs.nodePackages.uglify-js ]; } ''
# var UglifyJS = require("uglify-js");
# var code = "function add(first, second) { return first + second; }";
# var result = UglifyJS.minify(code);
# console.log(result.code);
# ''
writeJS = name: { libraries ? [] }: content:
let
node-env = pkgs.buildEnv {
name = "node";
paths = libraries;
pathsToLink = [
"/lib/node_modules"
];
};
in writeDash name ''
export NODE_PATH=${node-env}/lib/node_modules
exec ${pkgs.nodejs}/bin/node ${pkgs.writeText "js" content} "$@"
'';
# writeJSBin takes the same arguments as writeJS but outputs a directory (like writeScriptBin)
writeJSBin = name:
writeJS "/bin/${name}";
awkFormatNginx = builtins.toFile "awkFormat-nginx.awk" ''
awk -f
{sub(/^[ \t]+/,"");idx=0}
/\{/{ctx++;idx=1}
/\}/{ctx--}
{id="";for(i=idx;i<ctx;i++)id=sprintf("%s%s", id, "\t");printf "%s%s\n", id, $0}
'';
writeNginxConfig = name: text: pkgs.runCommandLocal name {
inherit text;
passAsFile = [ "text" ];
nativeBuildInputs = [ gixy ];
} /* sh */ ''
# nginx-config-formatter has an error - https://github.com/1connect/nginx-config-formatter/issues/16
awk -f ${awkFormatNginx} "$textPath" | sed '/^\s*$/d' > $out
gixy $out
'';
# writePerl takes a name an attributeset with libraries and some perl sourcecode and
# returns an executable
#
# Example:
# writePerl "example" { libraries = [ pkgs.perlPackages.boolean ]; } ''
# use boolean;
# print "Howdy!\n" if true;
# ''
writePerl = name: { libraries ? [] }:
makeScriptWriter {
interpreter = "${pkgs.perl.withPackages (p: libraries)}/bin/perl";
} name;
# writePerlBin takes the same arguments as writePerl but outputs a directory (like writeScriptBin)
writePerlBin = name:
writePerl "/bin/${name}";
# makePythonWriter takes python and compatible pythonPackages and produces python script writer,
# which validates the script with flake8 at build time. If any libraries are specified,
# python.withPackages is used as interpreter, otherwise the "bare" python is used.
makePythonWriter = python: pythonPackages: buildPythonPackages: name: { libraries ? [], flakeIgnore ? [] }:
let
ignoreAttribute = optionalString (flakeIgnore != []) "--ignore ${concatMapStringsSep "," escapeShellArg flakeIgnore}";
in
makeScriptWriter {
interpreter =
if libraries == []
then python.interpreter
else (python.withPackages (ps: libraries)).interpreter
;
check = optionalString python.isPy3k (writeDash "pythoncheck.sh" ''
exec ${buildPythonPackages.flake8}/bin/flake8 --show-source ${ignoreAttribute} "$1"
'');
} name;
# writePyPy2 takes a name an attributeset with libraries and some pypy2 sourcecode and
# returns an executable
#
# Example:
# writePyPy2 "test_pypy2" { libraries = [ pkgs.pypy2Packages.enum ]; } ''
# from enum import Enum
#
# class Test(Enum):
# a = "success"
#
# print Test.a
# ''
writePyPy2 = makePythonWriter pkgs.pypy2 pkgs.pypy2Packages buildPackages.pypy2Packages;
# writePyPy2Bin takes the same arguments as writePyPy2 but outputs a directory (like writeScriptBin)
writePyPy2Bin = name:
writePyPy2 "/bin/${name}";
# writePython3 takes a name an attributeset with libraries and some python3 sourcecode and
# returns an executable
#
# Example:
# writePython3 "test_python3" { libraries = [ pkgs.python3Packages.pyyaml ]; } ''
# import yaml
#
# y = yaml.load("""
# - test: success
# """)
# print(y[0]['test'])
# ''
writePython3 = makePythonWriter pkgs.python3 pkgs.python3Packages buildPackages.python3Packages;
# writePython3Bin takes the same arguments as writePython3 but outputs a directory (like writeScriptBin)
writePython3Bin = name:
writePython3 "/bin/${name}";
# writePyPy3 takes a name an attributeset with libraries and some pypy3 sourcecode and
# returns an executable
#
# Example:
# writePyPy3 "test_pypy3" { libraries = [ pkgs.pypy3Packages.pyyaml ]; } ''
# import yaml
#
# y = yaml.load("""
# - test: success
# """)
# print(y[0]['test'])
# ''
writePyPy3 = makePythonWriter pkgs.pypy3 pkgs.pypy3Packages buildPackages.pypy3Packages;
# writePyPy3Bin takes the same arguments as writePyPy3 but outputs a directory (like writeScriptBin)
writePyPy3Bin = name:
writePyPy3 "/bin/${name}";
makeFSharpWriter = { dotnet-sdk ? pkgs.dotnet-sdk, fsi-flags ? "", libraries ? _: [] }: nameOrPath:
let
fname = last (builtins.split "/" nameOrPath);
path = if strings.hasSuffix ".fsx" nameOrPath then nameOrPath else "${nameOrPath}.fsx";
_nugetDeps = mkNugetDeps { name = "${fname}-nuget-deps"; nugetDeps = libraries; };
nuget-source = mkNugetSource {
name = "${fname}-nuget-source";
description = "A Nuget source with the dependencies for ${fname}";
deps = [ _nugetDeps ];
};
fsi = writeBash "fsi" ''
export HOME=$NIX_BUILD_TOP/.home
export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
export DOTNET_CLI_TELEMETRY_OPTOUT=1
export DOTNET_NOLOGO=1
script="$1"; shift
${dotnet-sdk}/bin/dotnet fsi --quiet --nologo --readline- ${fsi-flags} "$@" < "$script"
'';
in content: makeScriptWriter {
interpreter = fsi;
} path
''
#i "nuget: ${nuget-source}/lib"
${ content }
exit 0
'';
writeFSharp =
makeFSharpWriter {};
writeFSharpBin = name:
writeFSharp "/bin/${name}";
}

View File

@ -12,29 +12,62 @@
}:
with writers;
let
expectSuccess = test:
runCommand "run-${test.name}" {} ''
if [[ "$(${test})" != success ]]; then
echo 'test ${test.name} failed'
exit 1
fi
bin = {
bash = writeBashBin "test-writers-bash-bin" ''
touch $out
'';
expectSuccessBin = test:
runCommand "run-${test.name}" {} ''
if [[ "$(${lib.getExe test})" != success ]]; then
echo 'test ${test.name} failed'
exit 1
fi
touch $out
'';
expectDataEqual = { file, expected }:
let
expectedFile = writeText "${file.name}-expected" expected;
in
runCommand "run-${file.name}" {} ''
if ! diff -u ${file} ${expectedFile}; then
echo 'test ${file.name} failed'
exit 1
fi
touch $out
'';
in
lib.recurseIntoAttrs {
bin = lib.recurseIntoAttrs {
bash = expectSuccessBin (writeBashBin "test-writers-bash-bin" ''
if [[ "test" == "test" ]]; then echo "success"; fi
'';
'');
dash = writeDashBin "test-writers-dash-bin" ''
dash = expectSuccessBin (writeDashBin "test-writers-dash-bin" ''
test '~' = '~' && echo 'success'
'';
'');
fish = writeFishBin "test-writers-fish-bin" ''
fish = expectSuccessBin (writeFishBin "test-writers-fish-bin" ''
if test "test" = "test"
echo "success"
end
'';
'');
rust = writeRustBin "test-writers-rust-bin" {} ''
rust = expectSuccessBin (writeRustBin "test-writers-rust-bin" {} ''
fn main(){
println!("success")
}
'';
'');
haskell = writeHaskellBin "test-writers-haskell-bin" { libraries = [ haskellPackages.acme-default ]; } ''
haskell = expectSuccessBin (writeHaskellBin "test-writers-haskell-bin" { libraries = [ haskellPackages.acme-default ]; } ''
import Data.Default
int :: Int
@ -44,9 +77,9 @@ let
main = case int of
18871 -> putStrLn $ id "success"
_ -> print "fail"
'';
'');
js = writeJSBin "test-writers-js-bin" { libraries = [ nodePackages.semver ]; } ''
js = expectSuccessBin (writeJSBin "test-writers-js-bin" { libraries = [ nodePackages.semver ]; } ''
var semver = require('semver');
if (semver.valid('1.2.3')) {
@ -54,59 +87,57 @@ let
} else {
console.log('fail')
}
'';
'');
perl = writePerlBin "test-writers-perl-bin" { libraries = [ perlPackages.boolean ]; } ''
perl = expectSuccessBin (writePerlBin "test-writers-perl-bin" { libraries = [ perlPackages.boolean ]; } ''
use boolean;
print "success\n" if true;
'';
'');
pypy2 = writePyPy2Bin "test-writers-pypy2-bin" { libraries = [ pypy2Packages.enum ]; } ''
pypy2 = expectSuccessBin (writePyPy2Bin "test-writers-pypy2-bin" { libraries = [ pypy2Packages.enum ]; } ''
from enum import Enum
class Test(Enum):
a = "success"
print Test.a
'';
'');
python3 = writePython3Bin "test-writers-python3-bin" { libraries = [ python3Packages.pyyaml ]; } ''
python3 = expectSuccessBin (writePython3Bin "test-writers-python3-bin" { libraries = [ python3Packages.pyyaml ]; } ''
import yaml
y = yaml.load("""
y = yaml.safe_load("""
- test: success
""")
print(y[0]['test'])
'';
'');
pypy3 = writePyPy3Bin "test-writers-pypy3-bin" { libraries = [ pypy3Packages.pyyaml ]; } ''
pypy3 = expectSuccessBin (writePyPy3Bin "test-writers-pypy3-bin" { libraries = [ pypy3Packages.pyyaml ]; } ''
import yaml
y = yaml.load("""
y = yaml.safe_load("""
- test: success
""")
print(y[0]['test'])
'';
'');
};
simple = {
bash = writeBash "test-writers-bash" ''
simple = lib.recurseIntoAttrs {
bash = expectSuccess (writeBash "test-writers-bash" ''
if [[ "test" == "test" ]]; then echo "success"; fi
'';
'');
dash = writeDash "test-writers-dash" ''
dash = expectSuccess (writeDash "test-writers-dash" ''
test '~' = '~' && echo 'success'
'';
'');
fish = writeFish "test-writers-fish" ''
fish = expectSuccess (writeFish "test-writers-fish" ''
if test "test" = "test"
echo "success"
end
'';
'');
haskell = writeHaskell "test-writers-haskell" { libraries = [ haskellPackages.acme-default ]; } ''
haskell = expectSuccess (writeHaskell "test-writers-haskell" { libraries = [ haskellPackages.acme-default ]; } ''
import Data.Default
int :: Int
@ -116,9 +147,9 @@ let
main = case int of
18871 -> putStrLn $ id "success"
_ -> print "fail"
'';
'');
js = writeJS "test-writers-js" { libraries = [ nodePackages.semver ]; } ''
js = expectSuccess (writeJS "test-writers-js" { libraries = [ nodePackages.semver ]; } ''
var semver = require('semver');
if (semver.valid('1.2.3')) {
@ -126,43 +157,41 @@ let
} else {
console.log('fail')
}
'';
'');
perl = writePerl "test-writers-perl" { libraries = [ perlPackages.boolean ]; } ''
perl = expectSuccess (writePerl "test-writers-perl" { libraries = [ perlPackages.boolean ]; } ''
use boolean;
print "success\n" if true;
'';
'');
pypy2 = writePyPy2 "test-writers-pypy2" { libraries = [ pypy2Packages.enum ]; } ''
pypy2 = expectSuccess (writePyPy2 "test-writers-pypy2" { libraries = [ pypy2Packages.enum ]; } ''
from enum import Enum
class Test(Enum):
a = "success"
print Test.a
'';
'');
python3 = writePython3 "test-writers-python3" { libraries = [ python3Packages.pyyaml ]; } ''
python3 = expectSuccess (writePython3 "test-writers-python3" { libraries = [ python3Packages.pyyaml ]; } ''
import yaml
y = yaml.load("""
y = yaml.safe_load("""
- test: success
""")
print(y[0]['test'])
'';
'');
pypy3 = writePyPy3 "test-writers-pypy3" { libraries = [ pypy3Packages.pyyaml ]; } ''
pypy3 = expectSuccess (writePyPy3 "test-writers-pypy3" { libraries = [ pypy3Packages.pyyaml ]; } ''
import yaml
y = yaml.load("""
y = yaml.safe_load("""
- test: success
""")
print(y[0]['test'])
'';
'');
fsharp = makeFSharpWriter {
fsharp = expectSuccess (makeFSharpWriter {
libraries = { fetchNuGet }: [
(fetchNuGet { pname = "FSharp.SystemTextJson"; version = "0.17.4"; sha256 = "1bplzc9ybdqspii4q28l8gmfvzpkmgq5l1hlsiyg2h46w881lwg2"; })
];
@ -183,31 +212,31 @@ let
then "success"
else "failed"
|> printfn "%s"
'';
'');
pypy2NoLibs = writePyPy2 "test-writers-pypy2-no-libs" {} ''
pypy2NoLibs = expectSuccess (writePyPy2 "test-writers-pypy2-no-libs" {} ''
print("success")
'';
'');
python3NoLibs = writePython3 "test-writers-python3-no-libs" {} ''
python3NoLibs = expectSuccess (writePython3 "test-writers-python3-no-libs" {} ''
print("success")
'';
'');
pypy3NoLibs = writePyPy3 "test-writers-pypy3-no-libs" {} ''
pypy3NoLibs = expectSuccess (writePyPy3 "test-writers-pypy3-no-libs" {} ''
print("success")
'';
'');
fsharpNoNugetDeps = writeFSharp "test-writers-fsharp-no-nuget-deps" ''
fsharpNoNugetDeps = expectSuccess (writeFSharp "test-writers-fsharp-no-nuget-deps" ''
printfn "success"
'';
'');
};
path = {
bash = writeBash "test-writers-bash-path" (writeText "test" ''
path = lib.recurseIntoAttrs {
bash = expectSuccess (writeBash "test-writers-bash-path" (writeText "test" ''
if [[ "test" == "test" ]]; then echo "success"; fi
'');
haskell = writeHaskell "test-writers-haskell-path" { libraries = [ haskellPackages.acme-default ]; } (writeText "test" ''
''));
haskell = expectSuccess (writeHaskell "test-writers-haskell-path" { libraries = [ haskellPackages.acme-default ]; } (writeText "test" ''
import Data.Default
int :: Int
@ -217,26 +246,27 @@ let
main = case int of
18871 -> putStrLn $ id "success"
_ -> print "fail"
'');
''));
};
writeTest = expectedValue: name: test:
writeDash "run-${name}" ''
if test "$(${test})" != "${expectedValue}"; then
echo 'test ${test} failed'
exit 1
fi
'';
data = {
json = expectDataEqual {
file = writeJSON "data.json" { hello = "world"; };
expected = ''
{
"hello": "world"
}
'';
};
in runCommand "test-writers" {
passthru = { inherit writeTest bin simple path; };
meta.platforms = lib.platforms.all;
} ''
${lib.concatMapStringsSep "\n" (test: writeTest "success" test.name "${test}/bin/${test.name}") (lib.attrValues bin)}
${lib.concatMapStringsSep "\n" (test: writeTest "success" test.name test) (lib.attrValues simple)}
${lib.concatMapStringsSep "\n" (test: writeTest "success" test.name test) (lib.attrValues path)}
echo 'nix-writers successfully tested' >&2
touch $out
''
toml = expectDataEqual {
file = writeTOML "data.toml" { hello = "world"; };
expected = "hello = 'world'\n";
};
yaml = expectDataEqual {
file = writeYAML "data.yaml" { hello = "world"; };
expected = "hello: world\n";
};
};
}

View File

@ -24,6 +24,7 @@ args@
, libkrb5
, krb5
, makeWrapper
, markForCudatoolkitRootHook
, ncurses5
, numactl
, nss
@ -31,6 +32,7 @@ args@
, python3 # FIXME: CUDAToolkit 10 may still need python27
, pulseaudio
, requireFile
, setupCudaHook
, stdenv
, backendStdenv # E.g. gcc11Stdenv, set in extension.nix
, unixODBC
@ -80,11 +82,15 @@ backendStdenv.mkDerivation rec {
addOpenGLRunpath
autoPatchelfHook
autoAddOpenGLRunpathHook
markForCudatoolkitRootHook
] ++ lib.optionals (lib.versionOlder version "11") [
libsForQt5.wrapQtAppsHook
] ++ lib.optionals (lib.versionAtLeast version "11.8") [
qt6Packages.wrapQtAppsHook
];
depsTargetTargetPropagated = [
setupCudaHook
];
buildInputs = lib.optionals (lib.versionOlder version "11") [
libsForQt5.qt5.qtwebengine
freeglut
@ -129,7 +135,7 @@ backendStdenv.mkDerivation rec {
(lib.getLib libtiff)
qt6Packages.qtwayland
rdma-core
ucx
(ucx.override { enableCuda = false; }) # Avoid infinite recursion
xorg.libxshmfence
xorg.libxkbfile
] ++ (lib.optionals (lib.versionAtLeast version "12.1") (map lib.getLib ([
@ -280,24 +286,12 @@ backendStdenv.mkDerivation rec {
sed -i "1 i#define _BITS_FLOATN_H" "$out/include/host_defines.h"
'' +
# Point NVCC at a compatible compiler
# FIXME: redist cuda_nvcc copy-pastes this code
# Refer to comments in the overrides for cuda_nvcc for explanation
# CUDA_TOOLKIT_ROOT_DIR is legacy,
# Cf. https://cmake.org/cmake/help/latest/module/FindCUDA.html#input-variables
# NOTE: We unconditionally set -Xfatbin=-compress-all, which reduces the size of the compiled
# binaries. If binaries grow over 2GB, they will fail to link. This is a problem for us, as
# the default set of CUDA capabilities we build can regularly cause this to occur (for
# example, with Magma).
''
mkdir -p $out/nix-support
cat <<EOF >> $out/nix-support/setup-hook
cmakeFlags+=' -DCUDA_TOOLKIT_ROOT_DIR=$out'
cmakeFlags+=' -DCUDA_HOST_COMPILER=${backendStdenv.cc}/bin'
cmakeFlags+=' -DCMAKE_CUDA_HOST_COMPILER=${backendStdenv.cc}/bin'
if [ -z "\''${CUDAHOSTCXX-}" ]; then
export CUDAHOSTCXX=${backendStdenv.cc}/bin;
fi
export NVCC_PREPEND_FLAGS+=' --compiler-bindir=${backendStdenv.cc}/bin -Xfatbin=-compress-all'
EOF
# Move some libraries to the lib output so that programs that

View File

@ -38,10 +38,39 @@ final: prev: let
cudaFlags = final.callPackage ./flags.nix {};
# Internal hook, used by cudatoolkit and cuda redist packages
# to accommodate automatic CUDAToolkit_ROOT construction
markForCudatoolkitRootHook = (final.callPackage
({ makeSetupHook }:
makeSetupHook
{ name = "mark-for-cudatoolkit-root-hook"; }
./hooks/mark-for-cudatoolkit-root-hook.sh)
{ });
# Normally propagated by cuda_nvcc or cudatoolkit through their depsHostHostPropagated
setupCudaHook = (final.callPackage
({ makeSetupHook, backendStdenv }:
makeSetupHook
{
name = "setup-cuda-hook";
substitutions.ccRoot = "${backendStdenv.cc}";
# Required in addition to ccRoot as otherwise bin/gcc is looked up
# when building CMakeCUDACompilerId.cu
substitutions.ccFullPath = "${backendStdenv.cc}/bin/${backendStdenv.cc.targetPrefix}c++";
}
./hooks/setup-cuda-hook.sh)
{ });
in
{
inherit
backendStdenv
cudatoolkit
cudaFlags;
cudaFlags
markForCudatoolkitRootHook
setupCudaHook;
saxpy = final.callPackage ./saxpy { };
}

View File

@ -0,0 +1,8 @@
# shellcheck shell=bash
markForCUDAToolkit_ROOT() {
mkdir -p "${prefix}/nix-support"
touch "${prefix}/nix-support/include-in-cudatoolkit-root"
}
fixupOutputHooks+=(markForCUDAToolkit_ROOT)

View File

@ -0,0 +1,5 @@
# shellcheck shell=bash
# CMake's enable_language(CUDA) runs a compiler test and it doesn't account for
# CUDAToolkit_ROOT. We have to help it locate libcudart
export NVCC_APPEND_FLAGS+=" -L@cudartRoot@/lib -I@cudartRoot@/include"

View File

@ -0,0 +1,68 @@
# shellcheck shell=bash
echo Sourcing setup-cuda-hook >&2
extendCUDAToolkit_ROOT() {
if [[ -f "$1/nix-support/include-in-cudatoolkit-root" ]] ; then
addToSearchPathWithCustomDelimiter ";" CUDAToolkit_ROOT "$1"
if [[ -d "$1/include" ]] ; then
addToSearchPathWithCustomDelimiter ";" CUDAToolkit_INCLUDE_DIR "$1/include"
fi
fi
}
addEnvHooks "$targetOffset" extendCUDAToolkit_ROOT
setupCUDAToolkitCompilers() {
echo Executing setupCUDAToolkitCompilers >&2
if [[ -n "${dontSetupCUDAToolkitCompilers-}" ]] ; then
return
fi
# Point NVCC at a compatible compiler
# For CMake-based projects:
# https://cmake.org/cmake/help/latest/module/FindCUDA.html#input-variables
# https://cmake.org/cmake/help/latest/envvar/CUDAHOSTCXX.html
# https://cmake.org/cmake/help/latest/variable/CMAKE_CUDA_HOST_COMPILER.html
export cmakeFlags+=" -DCUDA_HOST_COMPILER=@ccFullPath@"
export cmakeFlags+=" -DCMAKE_CUDA_HOST_COMPILER=@ccFullPath@"
# For non-CMake projects:
# We prepend --compiler-bindir to nvcc flags.
# Downstream packages can override these, because NVCC
# uses the last --compiler-bindir it gets on the command line.
# FIXME: this results in "incompatible redefinition" warnings.
# https://docs.nvidia.com/cuda/cuda-compiler-driver-nvcc/index.html#compiler-bindir-directory-ccbin
if [ -z "${CUDAHOSTCXX-}" ]; then
export CUDAHOSTCXX="@ccFullPath@";
fi
export NVCC_PREPEND_FLAGS+=" --compiler-bindir=@ccRoot@/bin"
# NOTE: We set -Xfatbin=-compress-all, which reduces the size of the compiled
# binaries. If binaries grow over 2GB, they will fail to link. This is a problem for us, as
# the default set of CUDA capabilities we build can regularly cause this to occur (for
# example, with Magma).
#
# @SomeoneSerge: original comment was made by @ConnorBaker in .../cudatoolkit/common.nix
if [[ -z "${dontCompressFatbin-}" ]]; then
export NVCC_PREPEND_FLAGS+=" -Xfatbin=-compress-all"
fi
# CMake's enable_language(CUDA) runs a compiler test and it doesn't account for
# CUDAToolkit_ROOT. We have to help it locate libcudart
if [[ -z "${nvccDontPrependCudartFlags-}" ]] ; then
export NVCC_APPEND_FLAGS+=" -L@cudartRoot@/lib -I@cudartRoot@/include"
fi
}
setupCMakeCUDAToolkit_ROOT() {
export cmakeFlags+=" -DCUDAToolkit_INCLUDE_DIR=$CUDAToolkit_INCLUDE_DIR -DCUDAToolkit_ROOT=$CUDAToolkit_ROOT"
}
postHooks+=(setupCUDAToolkitCompilers)
preConfigureHooks+=(setupCMakeCUDAToolkit_ROOT)

View File

@ -4,6 +4,7 @@
, fetchurl
, autoPatchelfHook
, autoAddOpenGLRunpathHook
, markForCudatoolkitRootHook
}:
pname:
@ -28,6 +29,7 @@ backendStdenv.mkDerivation {
# directory to the rpath of all ELF binaries.
# Check e.g. with `patchelf --print-rpath path/to/my/binary
autoAddOpenGLRunpathHook
markForCudatoolkitRootHook
];
buildInputs = [

View File

@ -27,35 +27,27 @@ in
inherit (prev.backendStdenv) cc;
in
{
# Required by cmake's enable_language(CUDA) to build a test program
# When implementing cross-compilation support: this is
# final.pkgs.targetPackages.cudaPackages.cuda_cudart
env.cudartRoot = "${prev.lib.getDev final.cuda_cudart}";
# Point NVCC at a compatible compiler
# FIXME: non-redist cudatoolkit copy-pastes this code
# For CMake-based projects:
# https://cmake.org/cmake/help/latest/module/FindCUDA.html#input-variables
# https://cmake.org/cmake/help/latest/envvar/CUDAHOSTCXX.html
# https://cmake.org/cmake/help/latest/variable/CMAKE_CUDA_HOST_COMPILER.html
# For non-CMake projects:
# We prepend --compiler-bindir to nvcc flags.
# Downstream packages can override these, because NVCC
# uses the last --compiler-bindir it gets on the command line.
# FIXME: this results in "incompatible redefinition" warnings.
# https://docs.nvidia.com/cuda/cuda-compiler-driver-nvcc/index.html#compiler-bindir-directory-ccbin
# NOTE: We unconditionally set -Xfatbin=-compress-all, which reduces the size of the
# compiled binaries. If binaries grow over 2GB, they will fail to link. This is a problem
# for us, as the default set of CUDA capabilities we build can regularly cause this to
# occur (for example, with Magma).
postInstall = (oldAttrs.postInstall or "") + ''
mkdir -p $out/nix-support
cat <<EOF >> $out/nix-support/setup-hook
cmakeFlags+=' -DCUDA_HOST_COMPILER=${cc}/bin'
cmakeFlags+=' -DCMAKE_CUDA_HOST_COMPILER=${cc}/bin'
if [ -z "\''${CUDAHOSTCXX-}" ]; then
export CUDAHOSTCXX=${cc}/bin;
fi
export NVCC_PREPEND_FLAGS+=' --compiler-bindir=${cc}/bin -Xfatbin=-compress-all'
EOF
'';
# Desiredata: whenever a package (e.g. magma) adds cuda_nvcc to
# nativeBuildInputs (offsets `(-1, 0)`), magma should also source the
# setupCudaHook, i.e. we want it the hook to be propagated into the
# same nativeBuildInputs.
#
# Logically, cuda_nvcc should include the hook in depsHostHostPropagated,
# so that the final offsets for the propagated hook would be `(-1, 0) +
# (0, 0) = (-1, 0)`.
#
# In practice, TargetTarget appears to work:
# https://gist.github.com/fd80ff142cd25e64603618a3700e7f82
depsTargetTargetPropagated = [
final.setupCudaHook
];
});
cuda_nvprof = prev.cuda_nvprof.overrideAttrs (oldAttrs: {

View File

@ -0,0 +1,12 @@
cmake_minimum_required(VERSION 3.25)
project(saxpy LANGUAGES CXX CUDA)
find_package(CUDAToolkit REQUIRED COMPONENTS cudart cublas)
add_executable(saxpy saxpy.cu)
target_link_libraries(saxpy PUBLIC CUDA::cublas CUDA::cudart m)
target_compile_features(saxpy PRIVATE cxx_std_14)
target_compile_options(saxpy PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:
--expt-relaxed-constexpr>)
install(TARGETS saxpy)

View File

@ -0,0 +1,50 @@
{ autoAddOpenGLRunpathHook
, backendStdenv
, cmake
, cuda_cccl
, cuda_cudart
, cudaFlags
, cuda_nvcc
, lib
, libcublas
, setupCudaHook
, stdenv
}:
backendStdenv.mkDerivation {
pname = "saxpy";
version = "unstable-2023-07-11";
src = ./.;
buildInputs = [
libcublas
cuda_cudart
cuda_cccl
];
nativeBuildInputs = [
cmake
# NOTE: this needs to be pkgs.buildPackages.cudaPackages_XX_Y.cuda_nvcc for
# cross-compilation to work. This should work automatically once we move to
# spliced scopes. Delete this comment once that happens
cuda_nvcc
# Alternatively, we could remove the propagated hook from cuda_nvcc and add
# directly:
# setupCudaHook
autoAddOpenGLRunpathHook
];
cmakeFlags = [
"-DCMAKE_VERBOSE_MAKEFILE=ON"
"-DCMAKE_CUDA_ARCHITECTURES=${with cudaFlags; builtins.concatStringsSep ";" (map dropDot cudaCapabilities)}"
];
meta = {
description = "A simple (Single-precision AX Plus Y) FindCUDAToolkit.cmake example for testing cross-compilation";
license = lib.licenses.mit;
maintainers = lib.teams.cuda.members;
platforms = lib.platforms.unix;
};
}

View File

@ -0,0 +1,68 @@
#include <cublas_v2.h>
#include <cuda_runtime.h>
#include <vector>
#include <stdio.h>
static inline void check(cudaError_t err, const char *context) {
if (err != cudaSuccess) {
fprintf(stderr, "CUDA error at %s: %s\n", context, cudaGetErrorString(err));
std::exit(EXIT_FAILURE);
}
}
#define CHECK(x) check(x, #x)
__global__ void saxpy(int n, float a, float *x, float *y) {
int i = blockIdx.x * blockDim.x + threadIdx.x;
if (i < n)
y[i] = a * x[i] + y[i];
}
int main(void) {
setbuf(stderr, NULL);
fprintf(stderr, "Start\n");
int rtVersion, driverVersion;
CHECK(cudaRuntimeGetVersion(&rtVersion));
CHECK(cudaDriverGetVersion(&driverVersion));
fprintf(stderr, "Runtime version: %d\n", rtVersion);
fprintf(stderr, "Driver version: %d\n", driverVersion);
constexpr int N = 1 << 10;
std::vector<float> xHost(N), yHost(N);
for (int i = 0; i < N; i++) {
xHost[i] = 1.0f;
yHost[i] = 2.0f;
}
fprintf(stderr, "Host memory initialized, copying to the device\n");
fflush(stderr);
float *xDevice, *yDevice;
CHECK(cudaMalloc(&xDevice, N * sizeof(float)));
CHECK(cudaMalloc(&yDevice, N * sizeof(float)));
CHECK(cudaMemcpy(xDevice, xHost.data(), N * sizeof(float),
cudaMemcpyHostToDevice));
CHECK(cudaMemcpy(yDevice, yHost.data(), N * sizeof(float),
cudaMemcpyHostToDevice));
fprintf(stderr, "Scheduled a cudaMemcpy, calling the kernel\n");
saxpy<<<(N + 255) / 256, 256>>>(N, 2.0f, xDevice, yDevice);
fprintf(stderr, "Scheduled a kernel call\n");
CHECK(cudaGetLastError());
CHECK(cudaMemcpy(yHost.data(), yDevice, N * sizeof(float),
cudaMemcpyDeviceToHost));
float maxError = 0.0f;
for (int i = 0; i < N; i++)
maxError = max(maxError, abs(yHost[i] - 4.0f));
fprintf(stderr, "Max error: %f\n", maxError);
CHECK(cudaFree(xDevice));
CHECK(cudaFree(yDevice));
}

View File

@ -19,7 +19,8 @@
, clblas
, doxygen
, buildDocs ? false
, cudaSupport ? false
, config
, cudaSupport ? config.cudaSupport
, cudatoolkit
, darwin
}:

View File

@ -4,10 +4,11 @@
, avxSupport ? stdenv.hostPlatform.avxSupport
, avx2Support ? stdenv.hostPlatform.avx2Support
, avx512Support ? stdenv.hostPlatform.avx512Support
, config
# Enable NIVIA GPU support
# Note, that this needs to be built on a system with a GPU
# present for the tests to succeed.
, enableCuda ? false
, enableCuda ? config.cudaSupport
# type of GPU architecture
, nvidiaArch ? "sm_60"
, cudatoolkit

View File

@ -7,7 +7,7 @@
, opencv
, pcre
, pkg-config
, cudaSupport ? config.cudaSupport or false
, cudaSupport ? config.cudaSupport
, cudaPackages
}:

View File

@ -2,7 +2,8 @@
, x11Support ? false
, libX11
, cairo
, enableCuda ? false
, config
, enableCuda ? config.cudaSupport
, cudaPackages
}:

View File

@ -13,7 +13,7 @@
, glfw
, libGLU
, curl
, cudaSupport ? config.cudaSupport or false, cudaPackages ? {}
, cudaSupport ? config.cudaSupport, cudaPackages ? { }
, enablePython ? false, pythonPackages ? null
, enableGUI ? false,
}:

View File

@ -1,5 +1,5 @@
{ config, stdenv, lib, fetchFromGitHub, cmake, gtest, doCheck ? true
, cudaSupport ? config.cudaSupport or false, openclSupport ? false, mpiSupport ? false, javaWrapper ? false, hdfsSupport ? false
, cudaSupport ? config.cudaSupport, openclSupport ? false, mpiSupport ? false, javaWrapper ? false, hdfsSupport ? false
, rLibrary ? false, cudaPackages, opencl-headers, ocl-icd, boost, llvmPackages, openmpi, openjdk, swig, hadoop, R, rPackages }:
assert doCheck -> mpiSupport != true;

View File

@ -21,7 +21,7 @@
, sox
, vid-stab
, darwin
, cudaSupport ? config.cudaSupport or false
, cudaSupport ? config.cudaSupport
, cudaPackages ? { }
, enableJackrack ? stdenv.isLinux
, ladspa-sdk

View File

@ -8,7 +8,7 @@
, symlinkJoin
, tbb
, hostSystem ? "CPP"
, deviceSystem ? if config.cudaSupport or false then "CUDA" else "OMP"
, deviceSystem ? if config.cudaSupport then "CUDA" else "OMP"
}:
# Policy for device_vector<T>

View File

@ -14,7 +14,7 @@
, enableOpenblas ? true, openblas, blas, lapack
, enableContrib ? true
, enableCuda ? (config.cudaSupport or false) &&
, enableCuda ? config.cudaSupport &&
stdenv.hostPlatform.isx86_64
, cudaPackages ? { }
, enableUnfree ? false

View File

@ -37,7 +37,7 @@
, blas
, enableContrib ? true
, enableCuda ? (config.cudaSupport or false) && stdenv.hostPlatform.isx86_64
, enableCuda ? config.cudaSupport && stdenv.hostPlatform.isx86_64
, enableCublas ? enableCuda
, enableCudnn ? false # NOTE: CUDNN has a large impact on closure size so we disable it by default
, enableCufft ? enableCuda

View File

@ -1,9 +1,9 @@
{ lib, stdenv, fetchurl, gfortran, perl, libnl
, rdma-core, zlib, numactl, libevent, hwloc, targetPackages, symlinkJoin
, libpsm2, libfabric, pmix, ucx
, config
# Enable CUDA support
, cudaSupport ? false, cudatoolkit
, cudaSupport ? config.cudaSupport, cudatoolkit
# Enable the Sun Grid Engine bindings
, enableSGE ? false

View File

@ -1,6 +1,6 @@
{ config, lib, stdenv, fetchFromGitHub, cmake, pkg-config, xorg, libGLU
, libGL, glew, ocl-icd, python3
, cudaSupport ? config.cudaSupport or false, cudatoolkit
, cudaSupport ? config.cudaSupport, cudatoolkit
# For visibility mostly. The whole approach to cuda architectures and capabilities
# will be reworked soon.
, cudaArch ? "compute_37"

View File

@ -11,7 +11,8 @@
, enableOpencl ? true
, opencl-headers
, ocl-icd
, enableCuda ? false
, config
, enableCuda ? config.cudaSupport
, cudaPackages
, addOpenGLRunpath
}:

View File

@ -5,7 +5,7 @@
, stdenv
, cmake
, cudaPackages ? { }
, cudaSupport ? config.cudaSupport or false
, cudaSupport ? config.cudaSupport
, nvidia-thrust
, useThrustSourceBuild ? true
, pythonSupport ? true

View File

@ -86,29 +86,6 @@ let
# "75" -> "750" Cf. https://bitbucket.org/icl/magma/src/f4ec79e2c13a2347eff8a77a3be6f83bc2daec20/CMakeLists.txt#lines-273
"${minArch'}0";
cuda-common-redist = with cudaPackages; [
libcublas # cublas_v2.h
libcusparse # cusparse.h
];
# Build-time dependencies
cuda-native-redist = symlinkJoin {
name = "cuda-native-redist-${cudaVersion}";
paths = with cudaPackages; [
cuda_cudart # cuda_runtime.h
cuda_nvcc
] ++ lists.optionals (strings.versionOlder cudaVersion "11.8") [
cuda_nvprof # <cuda_profiler_api.h>
] ++ lists.optionals (strings.versionAtLeast cudaVersion "11.8") [
cuda_profiler_api # <cuda_profiler_api.h>
] ++ cuda-common-redist;
};
# Run-time dependencies
cuda-redist = symlinkJoin {
name = "cuda-redist-${cudaVersion}";
paths = cuda-common-redist;
};
in
assert (builtins.match "[^[:space:]]*" gpuTargetString) != null;
@ -128,16 +105,22 @@ stdenv.mkDerivation {
ninja
gfortran
] ++ lists.optionals cudaSupport [
cuda-native-redist
cudaPackages.cuda_nvcc
];
buildInputs = [
libpthreadstubs
lapack
blas
] ++ lists.optionals cudaSupport [
cuda-redist
] ++ lists.optionals rocmSupport [
] ++ lists.optionals cudaSupport (with cudaPackages; [
cuda_cudart
libcublas # cublas_v2.h
libcusparse # cusparse.h
] ++ lists.optionals (strings.versionOlder cudaVersion "11.8") [
cuda_nvprof # <cuda_profiler_api.h>
] ++ lists.optionals (strings.versionAtLeast cudaVersion "11.8") [
cuda_profiler_api # <cuda_profiler_api.h>
]) ++ lists.optionals rocmSupport [
hip
hipblas
hipsparse

View File

@ -1,5 +1,6 @@
{ lib, stdenv, fetchurl, gfortran, blas, lapack
, enableCuda ? false, cudatoolkit
, config
, enableCuda ? config.cudaSupport, cudatoolkit
}:
let

View File

@ -6,7 +6,8 @@
, fixDarwinDylibNames
, gmp
, mpfr
, enableCuda ? false
, config
, enableCuda ? config.cudaSupport
, cudatoolkit
}:

View File

@ -1,5 +1,6 @@
{ stdenv, lib, fetchFromGitHub, libtool, automake, autoconf, ucx
, enableCuda ? false
, config
, enableCuda ? config.cudaSupport
, cudatoolkit
, enableAvx ? stdenv.hostPlatform.avxSupport
, enableSse41 ? stdenv.hostPlatform.sse4_1Support

View File

@ -1,6 +1,7 @@
{ lib, stdenv, fetchFromGitHub, autoreconfHook, doxygen, numactl
, rdma-core, libbfd, libiberty, perl, zlib, symlinkJoin, pkg-config
, enableCuda ? false
, config
, enableCuda ? config.cudaSupport
, cudatoolkit
, enableRocm ? false
, rocm-core, rocm-runtime, rocm-device-libs, hip

View File

@ -5,7 +5,7 @@
, cmake
, gtest
, doCheck ? true
, cudaSupport ? config.cudaSupport or false
, cudaSupport ? config.cudaSupport
, ncclSupport ? false
, rLibrary ? false
, cudaPackages

View File

@ -1,7 +1,7 @@
{ lib
, buildPythonPackage
, config
, cudaSupport ? config.cudaSupport or false
, cudaSupport ? config.cudaSupport
, cupy
, fetchFromGitHub
, filelock

View File

@ -27,7 +27,7 @@
, scipy
, stdenv
# Options:
, cudaSupport ? config.cudaSupport or false
, cudaSupport ? config.cudaSupport
, cudaPackages ? {}
}:

View File

@ -40,8 +40,9 @@
, snappy
, zlib
, config
# CUDA flags:
, cudaSupport ? false
, cudaSupport ? config.cudaSupport
, cudaPackages ? {}
# MKL:

View File

@ -9,7 +9,9 @@
, six
, nose
, mako
, cudaSupport ? false, cudaPackages
, config
, cudaSupport ? config.cudaSupport
, cudaPackages ? { }
, openclSupport ? true, ocl-icd, clblas
}:

View File

@ -0,0 +1,41 @@
{ lib
, buildPythonPackage
, fetchFromGitHub
, pytestCheckHook
, hypothesis
, reprshed
}:
buildPythonPackage rec {
pname = "macaddress";
version = "2.0.2";
format = "setuptools";
src = fetchFromGitHub {
owner = "mentalisttraceur";
repo = "python-macaddress";
rev = "v${version}";
hash = "sha256-2eD5Ui8kUduKLJ0mSiwaz7TQSeF1+2ASirp70V/8+EA=";
};
pythonImportsCheck = [
"macaddress"
];
nativeCheckInputs = [
pytestCheckHook
hypothesis
reprshed
];
pytestFlagsArray = [
"$src/test.py"
];
meta = with lib; {
homepage = "https://github.com/mentalisttraceur/python-macaddress";
description = "A module for handling hardware identifiers like MAC addresses";
license = licenses.bsd0;
maintainers = with maintainers; [ netali ];
};
}

View File

@ -14,12 +14,14 @@
, runCommand
, fetchpatch
, config
# CUDA-only dependencies:
, addOpenGLRunpath ? null
, cudaPackages ? {}
# CUDA flags:
, cudaSupport ? false
, cudaSupport ? config.cudaSupport
}:
let

View File

@ -0,0 +1,28 @@
{ lib
, buildPythonPackage
, fetchFromGitHub
}:
buildPythonPackage rec {
pname = "python-reprshed";
version = "1.0.6";
format = "setuptools";
src = fetchFromGitHub {
owner = "mentalisttraceur";
repo = "python-reprshed";
rev = "v${version}";
hash = "sha256-XfmiewI74eDLKTAU6Ed76QXfJYMRb+idRACl6CW07ME=";
};
pythonImportsCheck = [
"reprshed"
];
meta = with lib; {
homepage = "https://github.com/mentalisttraceur/python-reprshed";
description = "A toolshed for writing great __repr__ methods quickly and easily";
license = licenses.bsd0;
maintainers = with maintainers; [ netali ];
};
}

View File

@ -21,7 +21,8 @@
, backports_weakref
, tensorflow-estimator-bin
, tensorboard
, cudaSupport ? false
, config
, cudaSupport ? config.cudaSupport
, cudaPackages ? {}
, zlib
, python

View File

@ -17,7 +17,8 @@
# that in nix as well. It would make some things easier and less confusing, but
# it would also make the default tensorflow package unfree. See
# https://groups.google.com/a/tensorflow.org/forum/#!topic/developers/iRCt5m4qUz0
, cudaSupport ? false
, config
, cudaSupport ? config.cudaSupport
, cudaPackages ? { }
, cudaCapabilities ? cudaPackages.cudaFlags.cudaCapabilities
, mklSupport ? false, mkl

View File

@ -17,7 +17,7 @@
buildPythonPackage rec {
pname = "teslajsonpy";
version = "3.9.0";
version = "3.9.1";
format = "pyproject";
disabled = pythonOlder "3.7";
@ -26,7 +26,7 @@ buildPythonPackage rec {
owner = "zabuldon";
repo = pname;
rev = "refs/tags/v${version}";
hash = "sha256-6H8miS0tKB99ZkiBvqJ77NIsswJ+ivYt1VZOLwTQr24=";
hash = "sha256-6QwBXWV/oMPDogzS5+EtRP9uzySvdYtnRR4Lb5IWwh4=";
};
nativeBuildInputs = [

View File

@ -11,8 +11,9 @@
, setuptools
, six
, libgpuarray
, cudaSupport ? false, cudaPackages ? {}
, cudnnSupport ? false
, config
, cudaSupport ? config.cudaSupport, cudaPackages ? { }
, cudnnSupport ? cudaSupport
}:
let

View File

@ -1,5 +1,5 @@
{ stdenv, lib, fetchFromGitHub, buildPythonPackage, python,
cudaSupport ? false, cudaPackages, magma,
config, cudaSupport ? config.cudaSupport, cudaPackages, magma,
useSystemNccl ? true,
MPISupport ? false, mpi,
buildDocs ? false,

View File

@ -1,6 +1,7 @@
{ stdenv
, boost
, cmake
, config
, cudaPackages
, eigen
, fetchFromGitHub
@ -14,7 +15,7 @@
, openssl
, writeShellScriptBin
, enableAVX2 ? stdenv.hostPlatform.avx2Support
, backend ? "opencl"
, backend ? if config.cudaSupport then "cuda" else "opencl"
, enableBigBoards ? false
, enableContrib ? false
, enableTcmalloc ? true

View File

@ -30,7 +30,8 @@
, svt-av1
, vulkan-loader
, libappindicator
, cudaSupport ? false
, config
, cudaSupport ? config.cudaSupport
, cudaPackages ? {}
}:
let

View File

@ -5,6 +5,5 @@ lib.recurseIntoAttrs {
cabalSdist = callPackage ./cabalSdist { };
documentationTarball = callPackage ./documentationTarball { };
setBuildTarget = callPackage ./setBuildTarget { };
writers = callPackage ./writers { };
incremental = callPackage ./incremental { };
}

View File

@ -1,26 +0,0 @@
# Wrap only the haskell-related tests from tests.writers
# in their own derivation for Hydra CI in the haskell-updates
# jobset. Can presumably removed as soon as tests.writers is
# always green on darwin as well:
# https://github.com/NixOS/nixpkgs/issues/126182
{ runCommand, tests }:
let
inherit (tests.writers)
writeTest
bin
simple
path
;
in
runCommand "test-haskell-writers" {
meta = {
inherit (tests.writers.meta) platforms;
};
} ''
${writeTest "success" "test-haskell-bin-writer" "${bin.haskell}/bin/${bin.haskell.name}"}
${writeTest "success" "test-haskell-simple-writer" simple.haskell}
${writeTest "success" "test-haskell-path-writer" path.haskell}
touch $out
''

View File

@ -10,16 +10,16 @@
rustPlatform.buildRustPackage rec {
pname = "hop-cli";
version = "0.2.35";
version = "0.2.52";
src = fetchFromGitHub {
owner = "hopinc";
repo = "cli";
rev = "v${version}";
hash = "sha256-TgPEcsv7/n+PzZXazozbgmX2tt4WDvyH3j6rY+M0AGE=";
hash = "sha256-xuOkW5jetl+8obeFJnbkVZa+wYWfTNiTOmcrzC8+wGE=";
};
cargoHash = "sha256-HEUsyboZQ4j5IEOqiWEBSlJqmaNDHPg1kstnM9AgZBo=";
cargoHash = "sha256-ePUlw4UzsQ2lNuJ5g5OAYh6nKTIoHdDMb34Jzuqtas8=";
nativeBuildInputs = [
pkg-config
@ -33,6 +33,11 @@ rustPlatform.buildRustPackage rec {
OPENSSL_NO_VENDOR = 1;
checkFlags = [
# This test fails on read-only filesystems
"--skip=commands::volumes::utils::test::test_parse_target_from_path_like"
];
meta = with lib; {
mainProgram = "hop";
description = "Interact with Hop in your terminal";

View File

@ -1,6 +1,7 @@
{ cmake, cudatoolkit, fetchFromGitHub, gfortran, lib, llvmPackages, python3Packages, stdenv
, config
, enableCfp ? true
, enableCuda ? false
, enableCuda ? config.cudaSupport
, enableFortran ? builtins.elem stdenv.targetPlatform.system gfortran.meta.platforms
, enableOpenMP ? true
, enablePython ? true

View File

@ -16,7 +16,7 @@ buildGoModule {
sha256 = "sha256-6yVMNSwwPZlADXuPBDRlgoz4Stuz2pgv6r6+y2/C8XY=";
};
vendorSha256 = "sha256-2N8MshBo9+2q8K00eTW5So6d8ZNRzOfQkEKmxR428gI=";
vendorSha256 = "sha256-shFld293pdmVcnu3p0NoBmPGLJddZd4O/gJ8klgdlQ8=";
subPackages = [ "." ];

View File

@ -1,5 +1,6 @@
{ cmake, fetchFromGitHub, makeWrapper, opencv3, lib, stdenv, ocl-icd, opencl-headers, OpenCL
, cudaSupport ? false, cudatoolkit ? null
, config
, cudaSupport ? config.cudaSupport, cudatoolkit ? null
}:
stdenv.mkDerivation rec {

View File

@ -1,17 +1,17 @@
{ lib, rustPlatform, fetchCrate, pkg-config, gtk4 }:
{ lib, rustPlatform, fetchCrate, pkg-config, wrapGAppsHook4, gtk4 }:
rustPlatform.buildRustPackage rec {
pname = "ripdrag";
version = "0.3.0";
version = "0.3.1";
src = fetchCrate {
inherit pname version;
sha256 = "sha256-D4WB1RdMPJfSLbJ96h3OuFhokfyY8Gamctm0XY694YM=";
hash = "sha256-SSH/HCvrUvWNIqlx7F6eNMM1eGxGGg5eel/X/q1Um1g=";
};
cargoSha256 = "sha256-C2I26E/dd18A4DDgOYGR8aS1RBrrNUwaXI4ZJHcrKy0=";
cargoHash = "sha256-FvStPBmyETjCaBqQK/KYHpwtqNCiY6n484E5bumdRzk=";
nativeBuildInputs = [ pkg-config ];
nativeBuildInputs = [ pkg-config wrapGAppsHook4 ];
buildInputs = [ gtk4 ];

View File

@ -10,16 +10,16 @@
rustPlatform.buildRustPackage rec {
pname = "topgrade";
version = "12.0.1";
version = "12.0.2";
src = fetchFromGitHub {
owner = "topgrade-rs";
repo = "topgrade";
rev = "v${version}";
hash = "sha256-H+Vx5yfHKgiUCrk42PMlu+XQsehol6aBLSwCuiBWCrs=";
hash = "sha256-PfrtTegJULzPAmKUk/6P9rD+ttPJOhaf2505og64C0Y=";
};
cargoHash = "sha256-ixFTkTyPKLeH6VcFAOAwmdc6YrrIpJ8obBwm19tFq3s=";
cargoHash = "sha256-S6jSI/KuHocYD2dhg3o1NSyA8Q04Xo215TWl8Y1C7g8=";
nativeBuildInputs = [
installShellFiles

View File

@ -5,22 +5,23 @@
, fetchFromGitHub
, python3
, darwin
, nixosTests
}:
let
buildNpmPackage' = buildNpmPackage.override { nodejs = nodejs_18; };
in buildNpmPackage' rec {
pname = "bitwarden-cli";
version = "2023.5.0";
version = "2023.7.0";
src = fetchFromGitHub {
owner = "bitwarden";
repo = "clients";
rev = "cli-v${version}";
hash = "sha256-ELKpGSY4ZbgSk4vJnTiB+IOa8RQU8Ahy3A1mYsKtthU=";
hash = "sha256-Xnfjp+qRJWvxvgSODbajLxYsP2DtOYK9CXBMfIn+qwA=";
};
npmDepsHash = "sha256-G8DEYPjEP3L4s0pr5n2ZTj8kkT0E7Po1BKhZ2hUdJuY=";
npmDepsHash = "sha256-vz7erDhh3BpHNadPwIXkD2PRCnbxM7e7lE0rvBEXGyc=";
nativeBuildInputs = [
python3
@ -36,6 +37,10 @@ in buildNpmPackage' rec {
npmWorkspace = "apps/cli";
passthru.tests = {
vaultwarden = nixosTests.vaultwarden.sqlite;
};
meta = with lib; {
changelog = "https://github.com/bitwarden/clients/releases/tag/${src.rev}";
description = "A secure and free password manager for all of your devices";

View File

@ -2,7 +2,7 @@
, addOpenGLRunpath
, config
, cudaPackages ? {}
, cudaSupport ? config.cudaSupport or false
, cudaSupport ? config.cudaSupport
, fetchurl
, makeWrapper
, opencl-headers

View File

@ -1,5 +1,6 @@
{ lib, gccStdenv, fetchFromGitLab, cudatoolkit
, cudaSupport ? false
, config
, cudaSupport ? config.cudaSupport
, pkg-config }:
gccStdenv.mkDerivation rec {

View File

@ -7,13 +7,13 @@
buildGoModule rec {
pname = "gtree";
version = "1.9.1";
version = "1.9.2";
src = fetchFromGitHub {
owner = "ddddddO";
repo = "gtree";
rev = "v${version}";
hash = "sha256-IH+dqPTtVBgIUI63tetS/s5gjleqdTEQ6iD0DeliOjY=";
hash = "sha256-RBGbFC+MOteCImPwzn2WYq5LTYF6rZEpTt1hlfHvUBw=";
};
vendorHash = "sha256-QxcDa499XV43p8fstENOtfe3iZ176R5/Ub5iovXlYIM=";

View File

@ -4207,7 +4207,7 @@ with pkgs;
libtensorflow = python3.pkgs.tensorflow.libtensorflow;
libtorch-bin = callPackage ../development/libraries/science/math/libtorch/bin.nix {
cudaSupport = config.cudaSupport or false;
inherit (config) cudaSupport;
};
tensorflow-lite = callPackage ../development/libraries/science/math/tensorflow-lite { };
@ -10904,7 +10904,7 @@ with pkgs;
nvidia-thrust-intel = callPackage ../development/libraries/nvidia-thrust {
hostSystem = "TBB";
deviceSystem = if config.cudaSupport or false then "CUDA" else "TBB";
deviceSystem = if config.cudaSupport then "CUDA" else "TBB";
};
nvidia-thrust-cuda = callPackage ../development/libraries/nvidia-thrust {
@ -15169,7 +15169,7 @@ with pkgs;
colm = callPackage ../development/compilers/colm { };
colmap = libsForQt5.callPackage ../applications/science/misc/colmap { cudaSupport = config.cudaSupport or false; };
colmap = libsForQt5.callPackage ../applications/science/misc/colmap { inherit (config) cudaSupport; };
colmapWithCuda = colmap.override { cudaSupport = true; };
chickenPackages_4 = callPackage ../development/compilers/chicken/4 { };
@ -39361,7 +39361,7 @@ with pkgs;
### SCIENCE / MATH
caffe = callPackage ../applications/science/math/caffe ({
cudaSupport = config.cudaSupport or false;
inherit (config) cudaSupport;
cudaPackages = cudaPackages_10_1;
opencv3 = opencv3WithoutCuda; # Used only for image loading.
blas = openblas;
@ -39376,7 +39376,7 @@ with pkgs;
stdenv = gcc7Stdenv;
inherit (linuxPackages) nvidia_x11;
opencv3 = opencv3WithoutCuda; # Used only for image loading.
cudaSupport = config.cudaSupport or false;
inherit (config) cudaSupport;
};
dap = callPackage ../applications/science/math/dap { };

View File

@ -117,6 +117,12 @@ let
'';
};
cudaSupport = mkMassRebuild {
type = types.bool;
default = false;
feature = "build packages with CUDA support by default";
};
showDerivationWarnings = mkOption {
type = types.listOf (types.enum [ "maintainerless" ]);
default = [];

View File

@ -1820,7 +1820,7 @@ self: super: with self; {
chai = callPackage ../development/python-modules/chai { };
chainer = callPackage ../development/python-modules/chainer {
cudaSupport = pkgs.config.cudaSupport or false;
inherit (pkgs.config) cudaSupport;
};
chainmap = callPackage ../development/python-modules/chainmap { };
@ -5290,13 +5290,13 @@ self: super: with self; {
jax-jumpy = callPackage ../development/python-modules/jax-jumpy { };
jaxlib-bin = callPackage ../development/python-modules/jaxlib/bin.nix {
cudaSupport = pkgs.config.cudaSupport or false;
inherit (pkgs.config) cudaSupport;
};
jaxlib-build = callPackage ../development/python-modules/jaxlib rec {
inherit (pkgs.darwin) cctools;
# Some platforms don't have `cudaSupport` defined, hence the need for 'or false'.
cudaSupport = pkgs.config.cudaSupport or false;
inherit (pkgs.config) cudaSupport;
IOKit = pkgs.darwin.apple_sdk_11_0.IOKit;
protobuf = pkgs.protobuf3_20; # jaxlib-build 0.3.15 won't build with protobuf 3.21
};
@ -5841,7 +5841,7 @@ self: super: with self; {
libgpuarray = callPackage ../development/python-modules/libgpuarray {
clblas = pkgs.clblas.override { inherit (self) boost; };
cudaSupport = pkgs.config.cudaSupport or false;
inherit (pkgs.config) cudaSupport;
};
libiio = (toPythonModule (pkgs.libiio.override { inherit python; })).python;
@ -6167,6 +6167,8 @@ self: super: with self; {
mac-vendor-lookup = callPackage ../development/python-modules/mac-vendor-lookup { };
macaddress = callPackage ../development/python-modules/macaddress{ };
macfsevents = callPackage ../development/python-modules/macfsevents {
inherit (pkgs.darwin.apple_sdk.frameworks) CoreFoundation CoreServices;
};
@ -7154,7 +7156,7 @@ self: super: with self; {
num2words = callPackage ../development/python-modules/num2words { };
numba = callPackage ../development/python-modules/numba {
cudaSupport = pkgs.config.cudaSupport or false;
inherit (pkgs.config) cudaSupport;
};
numbaWithCuda = self.numba.override {
@ -7322,7 +7324,7 @@ self: super: with self; {
openai-triton-bin = callPackage ../development/python-modules/openai-triton/bin.nix { };
openai-whisper = callPackage ../development/python-modules/openai-whisper {
cudaSupport = pkgs.config.cudaSupport or false;
inherit (pkgs.config) cudaSupport;
};
openant = callPackage ../development/python-modules/openant { };
@ -10908,6 +10910,8 @@ self: super: with self; {
reproject = callPackage ../development/python-modules/reproject { };
reprshed = callPackage ../development/python-modules/reprshed { };
reqif = callPackage ../development/python-modules/reqif { };
requests-aws4auth = callPackage ../development/python-modules/requests-aws4auth { };
@ -12369,12 +12373,12 @@ self: super: with self; {
tensorboardx = callPackage ../development/python-modules/tensorboardx { };
tensorflow-bin = callPackage ../development/python-modules/tensorflow/bin.nix {
cudaSupport = pkgs.config.cudaSupport or false;
inherit (pkgs.config) cudaSupport;
};
tensorflow-build = callPackage ../development/python-modules/tensorflow {
inherit (pkgs.darwin) cctools;
cudaSupport = pkgs.config.cudaSupport or false;
inherit (pkgs.config) cudaSupport;
inherit (self.tensorflow-bin) cudaPackages;
inherit (pkgs.darwin.apple_sdk.frameworks) Foundation Security;
flatbuffers-core = pkgs.flatbuffers;
@ -12493,7 +12497,7 @@ self: super: with self; {
theano-pymc = callPackage ../development/python-modules/theano-pymc { };
theano = callPackage ../development/python-modules/theano rec {
cudaSupport = pkgs.config.cudaSupport or false;
inherit (pkgs.config) cudaSupport;
cudnnSupport = cudaSupport;
};
@ -12660,9 +12664,9 @@ self: super: with self; {
toposort = callPackage ../development/python-modules/toposort { };
torch = callPackage ../development/python-modules/torch {
cudaSupport = pkgs.config.cudaSupport or false;
inherit (pkgs.config) cudaSupport;
magma =
if pkgs.config.cudaSupport or false
if pkgs.config.cudaSupport
then pkgs.magma-cuda-static
else pkgs.magma;
inherit (pkgs.darwin.apple_sdk.frameworks) Accelerate CoreServices;