mirror of
https://github.com/CHN-beta/nixos.git
synced 2026-01-12 21:39:26 +08:00
Compare commits
13 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 1325418934 | |||
| 780f86a0b7 | |||
| b6495a02a8 | |||
| e171f3cd97 | |||
| 6b8ecc62c1 | |||
| b8320c00a7 | |||
| 3d162ddfb9 | |||
| ec321e117c | |||
| 29e15e70ab | |||
| eb3ec5828f | |||
| 9ec5772480 | |||
| 7796e96c20 | |||
| a5b9725b41 |
@@ -130,7 +130,7 @@ inputs:
|
||||
nfs."/" = "192.168.84.0/24";
|
||||
};
|
||||
bugs = [ "xmunet" "backlight" "amdpstate" "iwlwifi" ];
|
||||
packages = { android-studio = {}; mathematica = {}; };
|
||||
packages = { android-studio = {}; mathematica = {}; vasp = {}; };
|
||||
user.users = [ "chn" "test" ];
|
||||
};
|
||||
boot.loader.grub =
|
||||
|
||||
@@ -62,6 +62,7 @@ inputs:
|
||||
];
|
||||
};
|
||||
};
|
||||
packages.vasp = {};
|
||||
user.users = [ "chn" "xll" "zem" "yjq" "gb" "wp" "hjp" "wm" "GROUPIII-1" "GROUPIII-2" "GROUPIII-3" ];
|
||||
};
|
||||
};
|
||||
|
||||
@@ -80,6 +80,7 @@ inputs:
|
||||
};
|
||||
};
|
||||
};
|
||||
packages.vasp = {};
|
||||
user.users = [ "chn" "xll" "zem" "yjq" "gb" "wp" "hjp" "wm" "lly" "yxf" "hss" "zzn" ];
|
||||
};
|
||||
};
|
||||
|
||||
@@ -90,7 +90,6 @@ inputs:
|
||||
freshrss.enable = true;
|
||||
send = {};
|
||||
huginn = {};
|
||||
fz-new-order = {};
|
||||
httpapi.enable = true;
|
||||
gitea = { enable = true; ssh = {}; };
|
||||
grafana = {};
|
||||
|
||||
@@ -66,27 +66,6 @@ freshrss:
|
||||
chn: ENC[AES256_GCM,data:Z4UmsXv1KiVfZMIQOEHH,iv:pF5lQLggkxm9y7taDVcp366JKp8U+8akNEdPA+Nf9Uo=,tag:0TajgUI/VgM3FxG1j6c/jA==,type:str]
|
||||
huginn:
|
||||
invitationCode: ENC[AES256_GCM,data:JDN913i+zf6+obWxrNAbgx1NJGPyewRm,iv:lqnjbSk46J0ZJN6ccbbiCiOK92W8fj2mWRwQHKqy2dc=,tag:UYZesryRlfAMo7xhKQ7zgw==,type:str]
|
||||
fz-new-order:
|
||||
token: ENC[AES256_GCM,data:JdMiu4du4S4fLg7b8LATG4g8NlahIFPvilGd1MsXNeMtnQs=,iv:fWBFYAVlfzi1dD/TpiA5N0JMY/LHTYPZGSh4sbK1BZc=,tag:LQTZe3DNk8xoy2+G4zld9A==,type:str]
|
||||
uids:
|
||||
#ENC[AES256_GCM,data:btt80rJcGg==,iv:DCBo36NMFiQO+dXom+AYTrSMYEAGCNXdMTJDIQVRlFA=,tag:LzoynD0J9surdmcFvVf/NQ==,type:comment]
|
||||
user0: ENC[AES256_GCM,data:53ag/e8f4aVEkUVszd7MzxNpDBBIkqGMneASW9/m5xU=,iv:LEZoitbzvTFAiXKZAPPOok/WaKsuTWgvd41Rq4/FMP4=,tag:opV15bhvDF1FR0UURsm+Iw==,type:str]
|
||||
#ENC[AES256_GCM,data:jXeZGm4rrw==,iv:hxZ6AU6FLzoUSJIeUh4zjuR6kvDfDhJCpvG47M+jRdc=,tag:AqMF7SJ96OEh0G8cgqvvuA==,type:comment]
|
||||
user1: ENC[AES256_GCM,data:emM3ffDBmymM9367YJG0lvYpw7iRl24fHSd5G4C4g6U=,iv:sJ9zLlgU2zZGFpeuIZXtL0Dqvd8RwbKU/a6HFdZTnvU=,tag:L6M7H24DXMvV55pYRiX8WA==,type:str]
|
||||
#ENC[AES256_GCM,data:gMDlZq2HXQ==,iv:hyJ2gkzrt0BZ3rO5rmz1tiS3jbrrA3VjpqjgPXQymjQ=,tag:aOWFyhuTjV9umsWJ0VjJDg==,type:comment]
|
||||
user2: ENC[AES256_GCM,data:b4jqm4Xm9dU2tYqqddKcHYcOh0Ol9W309fpQPcG2cQo=,iv:EKUDKnbYX8MTqd/G4NaQUVZ4mZAw3GvAlDe7XIVvVZQ=,tag:+oO6MaA6PFVbnP2ahfAArw==,type:str]
|
||||
#ENC[AES256_GCM,data:L0wkMIIuSA==,iv:j0LGq9Xe+Dru8bCwt93T51ZaK0ex/7CZJdBDn6jhq7w=,tag:EU4/62fe3p7QjpfSMAYHCQ==,type:comment]
|
||||
user3: ENC[AES256_GCM,data:dWJzu6S6T598TiKqX48LUcT1BAc0/gVy1tAknkvmg8k=,iv:KWl/av7a3hj27p+S2hhe2QpcNMFGJPsnnCjcaqzjOqc=,tag:HQbtRPxO8OnfKIBqTDjKlA==,type:str]
|
||||
#ENC[AES256_GCM,data:8/kYjPRSEA==,iv:etABb0TqNHhEs3/HGuRixEJUGhyXSTXI3cvhTTAUlXA=,tag:IfPzvdSamLcY1dRJls74GQ==,type:comment]
|
||||
user4: ENC[AES256_GCM,data:F6tbn2WBo9HrM+fmtf70GrNJyZ6qJ2HrNdJG788zMKM=,iv:Dx/7MUJVZO61u/DqwrrqmWIVpx4Qpi88SMflCRvj7Wc=,tag:WH6tsk/69+EEz2DS1srrNw==,type:str]
|
||||
config0:
|
||||
username: ENC[AES256_GCM,data:DDGErXyt,iv:7Z3U++o930QhngC+NzNna32F2AKSWjEFnJYXY00rCM4=,tag:L83e1KTQkVwSWSwhTwTzYQ==,type:str]
|
||||
password: ENC[AES256_GCM,data:Jy9Gbo0i,iv:ZthlQ0x5At9TUbh6MUiLkZUoVdCG0gp0SEyMtxKhnjM=,tag:fKmnopQ/sVFQsmb2ISOk0A==,type:str]
|
||||
comment: ENC[AES256_GCM,data:lb51oO8l,iv:4Iac4P+zfa7/T+aq5429VbdHoK7+WZkj1nC+yPOoIy0=,tag:NRl5GjjKn4OHfIGDNh+3MA==,type:str]
|
||||
config1:
|
||||
username: ENC[AES256_GCM,data:/QlSea1D,iv:0gMEI2JJudtKHE9J7IlI8Hsfo0jQwCy2Ap8EXxVqUVo=,tag:2DnWRv1b2VhtV5wSnnOzqg==,type:str]
|
||||
password: ENC[AES256_GCM,data:FHd4UPV2,iv:jI5BwcfxTBj2igdFUQtKS4LGnt5O96Kp3RPvnpXxFR8=,tag:Lfe8paHNQ44nRb/gk0oUbg==,type:str]
|
||||
comment: ENC[AES256_GCM,data:QILd5mRa,iv:mmM6h721UIXTuRL7k9TDOPdRrqMuq5M8krz5yWR20Mw=,tag:ALpQZjR6W0X44rST8U74NQ==,type:str]
|
||||
grafana:
|
||||
secret: ENC[AES256_GCM,data:1Wfq8QmhzKBObdktheFPySzXYlOJzHWbYYQXgn3beLOwSlW9f7bUn+wIrRoj1e8WlFJkAU2xywzjzzy/UwpSYA==,iv:/0YoHTs54O+cT6VVt1U5CYXr2qEdY2kijOlnMZMW4d0=,tag:SD/IELlcgfS7p9NBEa6D/g==,type:str]
|
||||
chn: ENC[AES256_GCM,data:8R92k7RH1491u6lfQdM0U3SG8TPi3vWhZyj810XSjnA=,iv:8v6ijLHgoTPT6MGoP/lWB+UEZCCgOpvfskWCJJ63Udo=,tag:k9SHzJ9d54Rny3n8EbksOw==,type:str]
|
||||
@@ -165,7 +144,7 @@ sops:
|
||||
d0h3aDh5QXFZYWJFdmNVYnJxQ3pBeVUKTl0XVvtwJcz+RpSylgDPl/R8msInxvWX
|
||||
eQGmrDHibeE1V+KSDiuNzC4MVRIrOnh1beHrhnVQ86HwPVgJqs2FoQ==
|
||||
-----END AGE ENCRYPTED FILE-----
|
||||
lastmodified: "2025-05-16T02:55:19Z"
|
||||
mac: ENC[AES256_GCM,data:fsqb3NvXwyoGWfcJEV04XcWiifB/zEW+LU8twQ2sY3cZWR5KHAWgVXCXrCunYiSy/Q5nf+ldTgoXKdmNu1pVOJQQXRCY1q1y9MV36msAfIUc1hdkDlo2ka5+d4aBcpqr5nPo5ZU6GJ5by1p8WIPSOWCGfsqMMlKhIWJ+8YaqokU=,iv:cfveyxa/0/qKRHc6wsjAC9stZSkgF85khnp3LTtF+K0=,tag:5vVFg0isyJcg3Twhq5Ouaw==,type:str]
|
||||
lastmodified: "2025-05-26T10:55:01Z"
|
||||
mac: ENC[AES256_GCM,data:ek8oYslh51198fhnYy8LgZQBo3QEnCumeSzLEIEFp/bQshfPVtiMt29n37y89GZjfvd/UL/J/i4sxHqF328+MoMtIYwcDzJoHp/ZNJYZoM19UjEsPL5YemRRXz++gw3tvDgqPzYvtr93pg6+WcPNToIhzsew7QzYj2xLiSaecvQ=,iv:wk8RcTUbZwUHRAgNRuZ3SWWv6O57hHBCkccYNZiMwPQ=,tag:8bwhsrkk8bVMwThZQPkNXg==,type:str]
|
||||
unencrypted_suffix: _unencrypted
|
||||
version: 3.10.2
|
||||
|
||||
27
flake.lock
generated
27
flake.lock
generated
@@ -34,6 +34,26 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"bscpkgs": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1748433430,
|
||||
"narHash": "sha256-rTmarmlP4SplEBAD+RM0kD5cB1F5g93H8ooSodxl8XE=",
|
||||
"owner": "CHN-beta",
|
||||
"repo": "bscpkgs",
|
||||
"rev": "bd7d5b02b59c4807e551a43f43489f79206e326a",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "CHN-beta",
|
||||
"repo": "bscpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"cachyos-lts": {
|
||||
"locked": {
|
||||
"lastModified": 1743535541,
|
||||
@@ -511,11 +531,11 @@
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1748069742,
|
||||
"narHash": "sha256-GcfcL/c9Q696oftYwlKjTZS1UTTQR7jSzxNa+imZ+tI=",
|
||||
"lastModified": 1748221239,
|
||||
"narHash": "sha256-zUlZp/ebt+EVBp1sA2ChVGz9MSdZpz/rIesOFSq23bo=",
|
||||
"owner": "CHN-beta",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "08e074b33507733ffb0ccb3006eb5fbad612ce6f",
|
||||
"rev": "3da8a40d3722ba5bc42e5076c774ac24daf3cc0d",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -820,6 +840,7 @@
|
||||
"inputs": {
|
||||
"blog": "blog",
|
||||
"blurred-wallpaper": "blurred-wallpaper",
|
||||
"bscpkgs": "bscpkgs",
|
||||
"cachyos-lts": "cachyos-lts",
|
||||
"catppuccin": "catppuccin",
|
||||
"concurrencpp": "concurrencpp",
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
inputs = { nixpkgs.follows = "nixpkgs"; home-manager.follows = "home-manager"; };
|
||||
};
|
||||
catppuccin = { url = "github:catppuccin/nix"; inputs.nixpkgs.follows = "nixpkgs"; };
|
||||
bscpkgs = { url = "github:CHN-beta/bscpkgs"; inputs.nixpkgs.follows = "nixpkgs"; };
|
||||
cachyos-lts.url = "github:drakon64/nixos-cachyos-kernel";
|
||||
nixvirt = { url = "github:CHN-beta/NixVirt"; inputs.nixpkgs.follows = "nixpkgs"; };
|
||||
shadowrz = { url = "github:ShadowRZ/nur-packages"; inputs.nixpkgs.follows = "nixpkgs"; };
|
||||
|
||||
@@ -114,12 +114,24 @@
|
||||
mathematica = pkgs.mathematica.src;
|
||||
oneapi =
|
||||
{
|
||||
src = pkgs.fetchurl
|
||||
src = pkgs.fetchurl
|
||||
{
|
||||
url = "https://registrationcenter-download.intel.com/akdlm/IRC_NAS/2cf9c083-82b5-4a8f-a515-c599b09dcefc/"
|
||||
+ "intel-oneapi-hpc-toolkit-2025.1.1.40_offline.sh";
|
||||
sha256 = "1qjy9dsnskwqsk66fm99b3cch1wp3rl9dx7y884p3x5kwiqdma2x";
|
||||
};
|
||||
version = "2025.1";
|
||||
fullVersion = "2025.1.1.40";
|
||||
components =
|
||||
[
|
||||
"intel.oneapi.lin.dpcpp-cpp-common,v=2025.1.1+10"
|
||||
"intel.oneapi.lin.dpcpp-cpp-common.runtime,v=2025.1.1+10"
|
||||
"intel.oneapi.lin.ifort-compiler,v=2025.1.1+10"
|
||||
"intel.oneapi.lin.compilers-common.runtime,v=2025.1.1+10"
|
||||
"intel.oneapi.lin.mpi.runtime,v=2021.15.0+493"
|
||||
"intel.oneapi.lin.umf,v=0.10.0+355"
|
||||
"intel.oneapi.lin.tbb.runtime,v=2022.1.0+425"
|
||||
"intel.oneapi.lin.compilers-common,v=2025.1.1+10"
|
||||
];
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,13 +1,7 @@
|
||||
inputs:
|
||||
{
|
||||
options.nixos.packages.vasp = let inherit (inputs.lib) mkOption types; in mkOption
|
||||
{
|
||||
type = types.nullOr (types.submodule {});
|
||||
# default = if builtins.elem inputs.config.nixos.model.type [ "desktop" "server" ] then {} else null;
|
||||
# TODO: fix vasp
|
||||
default = null;
|
||||
};
|
||||
# TODO: add more options to correctly configure VASP
|
||||
{ type = types.nullOr (types.submodule {}); default = null; };
|
||||
config = let inherit (inputs.config.nixos.packages) vasp; in inputs.lib.mkIf (vasp != null)
|
||||
{
|
||||
nixos.packages.packages = with inputs.pkgs;
|
||||
|
||||
@@ -1,99 +0,0 @@
|
||||
inputs:
|
||||
{
|
||||
options.nixos.services.fz-new-order = let inherit (inputs.lib) mkOption types; in mkOption
|
||||
{ type = types.nullOr (types.submodule {}); default = null; };
|
||||
config = let inherit (inputs.config.nixos.services) fz-new-order; in inputs.lib.mkIf (fz-new-order != null)
|
||||
{
|
||||
users =
|
||||
{
|
||||
users.fz-new-order =
|
||||
{
|
||||
uid = inputs.config.nixos.user.uid.fz-new-order;
|
||||
group = "fz-new-order";
|
||||
home = "/var/lib/fz-new-order";
|
||||
createHome = true;
|
||||
isSystemUser = true;
|
||||
};
|
||||
groups.fz-new-order.gid = inputs.config.nixos.user.gid.fz-new-order;
|
||||
};
|
||||
systemd =
|
||||
{
|
||||
timers.fz-new-order =
|
||||
{
|
||||
wantedBy = [ "timers.target" ];
|
||||
timerConfig = { OnBootSec = "10m"; OnUnitActiveSec = "10m"; Unit = "fz-new-order.service"; };
|
||||
};
|
||||
services.fz-new-order = rec
|
||||
{
|
||||
description = "fz-new-order";
|
||||
after = [ "network.target" ];
|
||||
requires = after;
|
||||
serviceConfig =
|
||||
{
|
||||
User = inputs.config.users.users."fz-new-order".name;
|
||||
Group = inputs.config.users.users."fz-new-order".group;
|
||||
WorkingDirectory = "/var/lib/fz-new-order";
|
||||
ExecStart =
|
||||
let
|
||||
src = inputs.pkgs.replaceVars ./main.cpp
|
||||
{ config_file = inputs.config.sops.templates."fz-new-order/config.json".path; };
|
||||
binary = inputs.pkgs.stdenv.mkDerivation
|
||||
{
|
||||
name = "fz-new-order";
|
||||
inherit src;
|
||||
buildInputs = with inputs.pkgs; [ jsoncpp.dev cereal fmt httplib ];
|
||||
dontUnpack = true;
|
||||
buildPhase =
|
||||
''
|
||||
runHook preBuild
|
||||
g++ -std=c++20 -O2 -o fz-new-order ${src} -ljsoncpp -lfmt
|
||||
runHook postBuild
|
||||
'';
|
||||
installPhase =
|
||||
''
|
||||
runHook preInstall
|
||||
mkdir -p $out/bin
|
||||
cp fz-new-order $out/bin/fz-new-order
|
||||
runHook postInstall
|
||||
'';
|
||||
};
|
||||
in "${binary}/bin/fz-new-order";
|
||||
};
|
||||
};
|
||||
tmpfiles.rules =
|
||||
[
|
||||
"d /var/lib/fz-new-order 0700 fz-new-order fz-new-order"
|
||||
"Z /var/lib/fz-new-order - fz-new-order fz-new-order"
|
||||
];
|
||||
};
|
||||
sops = let userNum = 5; configNum = 2; in
|
||||
{
|
||||
templates."fz-new-order/config.json" =
|
||||
{
|
||||
owner = inputs.config.users.users."fz-new-order".name;
|
||||
group = inputs.config.users.users."fz-new-order".group;
|
||||
content = let placeholder = inputs.config.sops.placeholder; in builtins.toJSON
|
||||
{
|
||||
token = placeholder."fz-new-order/token";
|
||||
uids = builtins.map (j: placeholder."fz-new-order/uids/user${builtins.toString j}")
|
||||
(builtins.genList (n: n) userNum);
|
||||
config = builtins.map
|
||||
(i: builtins.listToAttrs (builtins.map
|
||||
(attrName: { name = attrName; value = placeholder."fz-new-order/config${toString i}/${attrName}"; })
|
||||
[ "username" "password" "comment" ]))
|
||||
(builtins.genList (n: n) configNum);
|
||||
};
|
||||
};
|
||||
secrets =
|
||||
{ "fz-new-order/token" = {}; }
|
||||
// (builtins.listToAttrs (builtins.map
|
||||
(i: { name = "fz-new-order/uids/user${toString i}"; value = {}; })
|
||||
(builtins.genList (n: n) userNum)))
|
||||
// (builtins.listToAttrs (builtins.concatLists (builtins.map
|
||||
(i: builtins.map
|
||||
(attrName: { name = "fz-new-order/config${builtins.toString i}/${attrName}"; value = {}; })
|
||||
[ "username" "password" "comment" ])
|
||||
(builtins.genList (n: n) configNum))));
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,244 +0,0 @@
|
||||
# include <iostream>
|
||||
# include <set>
|
||||
# include <sstream>
|
||||
# include <filesystem>
|
||||
# include <cereal/types/set.hpp>
|
||||
# include <cereal/archives/json.hpp>
|
||||
# include <fmt/format.h>
|
||||
# include <fmt/ranges.h>
|
||||
# include <httplib.h>
|
||||
# include <json/json.h>
|
||||
|
||||
std::string urlencode(std::string s)
|
||||
{
|
||||
auto hexchar = [](unsigned char c, unsigned char &hex1, unsigned char &hex2)
|
||||
{
|
||||
hex1 = c / 16;
|
||||
hex2 = c % 16;
|
||||
hex1 += hex1 <= 9 ? '0' : 'a' - 10;
|
||||
hex2 += hex2 <= 9 ? '0' : 'a' - 10;
|
||||
};
|
||||
const char *str = s.c_str();
|
||||
std::vector<char> v(s.size());
|
||||
v.clear();
|
||||
for (std::size_t i = 0, l = s.size(); i < l; i++)
|
||||
{
|
||||
char c = str[i];
|
||||
if
|
||||
(
|
||||
(c >= '0' && c <= '9')
|
||||
|| (c >= 'a' && c <= 'z')
|
||||
|| (c >= 'A' && c <= 'Z')
|
||||
|| c == '-' || c == '_' || c == '.' || c == '!' || c == '~'
|
||||
|| c == '*' || c == '\'' || c == '(' || c == ')'
|
||||
)
|
||||
v.push_back(c);
|
||||
else
|
||||
{
|
||||
v.push_back('%');
|
||||
unsigned char d1, d2;
|
||||
hexchar(c, d1, d2);
|
||||
v.push_back(d1);
|
||||
v.push_back(d2);
|
||||
}
|
||||
}
|
||||
return std::string(v.cbegin(), v.cend());
|
||||
}
|
||||
|
||||
void oneshot
|
||||
(
|
||||
const std::string& username, const std::string& password, const std::string& comment,
|
||||
const std::set<std::string>& wxuser, const std::string& token
|
||||
)
|
||||
{
|
||||
httplib::Client fzclient("http://scmv9.fengzhansy.com:8882");
|
||||
httplib::Client wxclient("http://wxpusher.zjiecode.com");
|
||||
auto& log = std::clog;
|
||||
|
||||
try
|
||||
{
|
||||
// get JSESSIONID
|
||||
auto cookie_jsessionid = [&]() -> std::string
|
||||
{
|
||||
log << "get /scmv9/login.jsp\n";
|
||||
auto result = fzclient.Get("/scmv9/login.jsp");
|
||||
if (result.error() != httplib::Error::Success)
|
||||
throw std::runtime_error("request failed");
|
||||
auto it = result.value().headers.find("Set-Cookie");
|
||||
if (it == result.value().headers.end() || it->first != "Set-Cookie")
|
||||
throw std::runtime_error("find cookie failed");
|
||||
log << fmt::format("set_cookie JSESSIONID {}\n", it->second.substr(0, it->second.find(';')));
|
||||
return it->second.substr(0, it->second.find(';'));
|
||||
}();
|
||||
|
||||
// login
|
||||
auto cookie_pppp = [&]() -> std::string
|
||||
{
|
||||
auto body = fmt::format("method=dologinajax&rand=1234&userc={}&mdid=P&passw={}", username, password);
|
||||
httplib::Headers headers =
|
||||
{
|
||||
{ "X-Requested-With", "XMLHttpRequest" },
|
||||
{
|
||||
"User-Agent",
|
||||
"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.97 Safari/537.36"
|
||||
},
|
||||
{ "Content-Type", "application/x-www-form-urlencoded; charset=UTF-8" },
|
||||
{ "Origin", "http://scmv9.fengzhansy.com:8882" },
|
||||
{ "Referer", "http://scmv9.fengzhansy.com:8882/scmv9/login.jsp" },
|
||||
{ "Cookie", cookie_jsessionid }
|
||||
};
|
||||
log << "post /scmv9/data.jsp\n";
|
||||
auto result = fzclient.Post("/scmv9/data.jsp", headers, body, "application/x-www-form-urlencoded; charset=UTF-8");
|
||||
if (result.error() != httplib::Error::Success)
|
||||
throw std::runtime_error("request failed");
|
||||
log << fmt::format("set_cookie pppp {}\n", fmt::format("pppp={}%40{}", username, password));
|
||||
return fmt::format("pppp={}%40{}", username, password);
|
||||
}();
|
||||
|
||||
// get order list
|
||||
auto order_list = [&]() -> std::map<std::string, std::pair<std::string, std::string>>
|
||||
{
|
||||
auto body = fmt::format("method=dgate&rand=1234&op=scmmgr_pcggl&nv%5B%5D=opmode&nv%5B%5D=dd_qry&nv%5B%5D=bill&nv%5B%5D=&nv%5B%5D=storeid&nv%5B%5D=&nv%5B%5D=vendorid&nv%5B%5D={}&nv%5B%5D=qr_status&nv%5B%5D=&nv%5B%5D=ddprt&nv%5B%5D=%25&nv%5B%5D=fdate&nv%5B%5D=&nv%5B%5D=tdate&nv%5B%5D=&nv%5B%5D=shfdate&nv%5B%5D=&nv%5B%5D=shtdate&nv%5B%5D=&nv%5B%5D=fy_pno&nv%5B%5D=1&nv%5B%5D=fy_psize&nv%5B%5D=10", username);
|
||||
httplib::Headers headers =
|
||||
{
|
||||
{ "X-Requested-With", "XMLHttpRequest" },
|
||||
{
|
||||
"User-Agent",
|
||||
"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.97 Safari/537.36"
|
||||
},
|
||||
{ "Content-Type", "application/x-www-form-urlencoded; charset=UTF-8" },
|
||||
{ "Origin", "http://scmv9.fengzhansy.com:8882"
|
||||
},
|
||||
{ "Referer", "http://scmv9.fengzhansy.com:8882/scmv9/SCM/cggl_po_qry.jsp" },
|
||||
{ "Cookie", fmt::format("{}; {}", cookie_jsessionid, cookie_pppp) }
|
||||
};
|
||||
log << "post /scmv9/data.jsp\n";
|
||||
auto result = fzclient.Post("/scmv9/data.jsp", headers, body, "application/x-www-form-urlencoded; charset=UTF-8");
|
||||
if (result.error() != httplib::Error::Success)
|
||||
throw std::runtime_error("request failed");
|
||||
log << fmt::format("get result {}\n", result.value().body);
|
||||
std::stringstream result_body(result.value().body);
|
||||
Json::Value root;
|
||||
result_body >> root;
|
||||
std::map<std::string, std::pair<std::string, std::string>> orders;
|
||||
for (unsigned i = 0; i < root["dt"][1].size(); i++)
|
||||
{
|
||||
log << fmt::format
|
||||
(
|
||||
"insert order {} {} {}\n", root["dt"][1][i].asString(), root["dt"][2][i].asString(),
|
||||
root["dt"][4][i].asString()
|
||||
);
|
||||
orders.insert({root["dt"][1][i].asString(), {root["dt"][2][i].asString(), root["dt"][4][i].asString()}});
|
||||
}
|
||||
return orders;
|
||||
}();
|
||||
|
||||
// read order old
|
||||
auto order_old = [&]() -> std::set<std::string>
|
||||
{
|
||||
if (!std::filesystem::exists("orders.json"))
|
||||
return {};
|
||||
else
|
||||
{
|
||||
std::ifstream ins("orders.json");
|
||||
cereal::JSONInputArchive ina(ins);
|
||||
std::set<std::string> data;
|
||||
cereal::load(ina, data);
|
||||
return data;
|
||||
}
|
||||
}();
|
||||
|
||||
// push new order info
|
||||
for (const auto& order : order_list)
|
||||
if (!order_old.contains(order.first))
|
||||
{
|
||||
auto body = fmt::format
|
||||
(
|
||||
"method=dgate&rand=1234&op=scmmgr_pcggl&nv%5B%5D=opmode&nv%5B%5D=ddsp_qry&nv%5B%5D=bill&nv%5B%5D={}",
|
||||
order.first
|
||||
);
|
||||
httplib::Headers headers =
|
||||
{
|
||||
{ "X-Requested-With", "XMLHttpRequest" },
|
||||
{
|
||||
"User-Agent",
|
||||
"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.97 Safari/537.36"
|
||||
},
|
||||
{ "Content-Type", "application/x-www-form-urlencoded; charset=UTF-8" },
|
||||
{ "Origin", "http://scmv9.fengzhansy.com:8882" },
|
||||
{ "Referer", "http://scmv9.fengzhansy.com:8882/scmv9/SCM/cggl_po_qry.jsp" },
|
||||
{ "Cookie", fmt::format("{}; {}", cookie_jsessionid, cookie_pppp) }
|
||||
};
|
||||
log << "post /scmv9/data.jsp\n";
|
||||
auto result = fzclient.Post
|
||||
("/scmv9/data.jsp", headers, body, "application/x-www-form-urlencoded; charset=UTF-8");
|
||||
if (result.error() != httplib::Error::Success)
|
||||
throw std::runtime_error("request failed");
|
||||
log << fmt::format("get result {}\n", result.value().body);
|
||||
std::stringstream result_body(result.value().body);
|
||||
Json::Value root;
|
||||
result_body >> root;
|
||||
|
||||
std::stringstream push_body;
|
||||
double all_cost = 0;
|
||||
push_body << fmt::format
|
||||
(
|
||||
"{} {} {}店\n", comment, order.second.second.substr(order.second.second.find('-') + 1),
|
||||
order.second.first.substr(1, 2)
|
||||
);
|
||||
for (unsigned i = 0; i < root["dt"][6].size(); i++)
|
||||
{
|
||||
push_body << fmt::format
|
||||
(
|
||||
"{} {}{}\n", root["dt"][6][i].asString().substr(root["dt"][6][i].asString().length() - 4),
|
||||
root["dt"][7][i].asString(), root["dt"][5][i].asString()
|
||||
);
|
||||
// 订货金额 maybe empty ???
|
||||
if (root["dt"][10][i].asString() != "")
|
||||
all_cost += std::stod(root["dt"][10][i].asString());
|
||||
}
|
||||
push_body << fmt::format("共{:.2f}元\n", all_cost);
|
||||
log << fmt::format("push to wx {}\n", push_body.str());
|
||||
auto encoded = urlencode(push_body.str());
|
||||
|
||||
for (const auto& wxu : wxuser)
|
||||
{
|
||||
auto path = fmt::format
|
||||
("/api/send/message/?appToken={}&content={}&uid={}", token, encoded, wxu);
|
||||
auto wxresult = wxclient.Get(path.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
// save data
|
||||
{
|
||||
for (const auto& order : order_list)
|
||||
if (!order_old.contains(order.first))
|
||||
order_old.insert(order.first);
|
||||
std::ofstream os("orders.json");
|
||||
cereal::JSONOutputArchive oa(os);
|
||||
cereal::save(oa, order_old);
|
||||
}
|
||||
}
|
||||
catch (const std::exception& ex)
|
||||
{
|
||||
log << ex.what() << "\n" << std::flush;
|
||||
std::terminate();
|
||||
}
|
||||
}
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
Json::Value configs;
|
||||
std::ifstream("@config_file@") >> configs;
|
||||
auto config_uids = configs["uids"];
|
||||
std::set<std::string> uids;
|
||||
for (auto& uid : config_uids)
|
||||
uids.insert(uid.asString());
|
||||
for (auto& config : configs["config"])
|
||||
oneshot
|
||||
(
|
||||
config["username"].asString(), config["password"].asString(), config["comment"].asString(),
|
||||
uids, configs["token"].asString()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -13,23 +13,24 @@ let
|
||||
{ cudaForwardCompat = nixpkgs.cuda.forwardCompat; })
|
||||
);
|
||||
allowInsecurePredicate = p: inputs.lib.warn "Allowing insecure package ${p.name or "${p.pname}-${p.version}"}" true;
|
||||
config = cudaConfig
|
||||
// {
|
||||
inherit allowInsecurePredicate;
|
||||
allowUnfree = true;
|
||||
android_sdk.accept_license = true;
|
||||
}
|
||||
// (inputs.lib.optionalAttrs (nixpkgs.march != null)
|
||||
{
|
||||
# TODO: test znver3 do use AVX
|
||||
oneapiArch = let match = {}; in match.${nixpkgs.march} or nixpkgs.march;
|
||||
nvhpcArch = nixpkgs.march;
|
||||
contentAddressedByDefault = true;
|
||||
})
|
||||
// (inputs.lib.optionalAttrs (nixpkgs.nixRoot != null)
|
||||
{ nix = { storeDir = "${nixpkgs.nixRoot}/store"; stateDir = "${nixpkgs.nixRoot}/var"; }; });
|
||||
in platformConfig //
|
||||
{
|
||||
config = cudaConfig //
|
||||
{
|
||||
inherit allowInsecurePredicate;
|
||||
allowUnfree = true;
|
||||
android_sdk.accept_license = true;
|
||||
}
|
||||
// (inputs.lib.optionalAttrs (nixpkgs.march != null)
|
||||
{
|
||||
# TODO: test znver3 do use AVX
|
||||
oneapiArch = let match = {}; in match.${nixpkgs.march} or nixpkgs.march;
|
||||
nvhpcArch = nixpkgs.march;
|
||||
# contentAddressedByDefault = true;
|
||||
})
|
||||
// (inputs.lib.optionalAttrs (nixpkgs.nixRoot != null)
|
||||
{ nix = { storeDir = "${nixpkgs.nixRoot}/store"; stateDir = "${nixpkgs.nixRoot}/var"; }; });
|
||||
inherit config;
|
||||
overlays =
|
||||
[
|
||||
inputs.topInputs.nur-xddxdd.overlays.inSubTree
|
||||
@@ -58,7 +59,7 @@ in platformConfig //
|
||||
};
|
||||
libvirt = (prev.libvirt.override { iptables = final.nftables; }).overrideAttrs
|
||||
(prev: { patches = prev.patches or [] ++ [ ./libvirt.patch ]; });
|
||||
root = prev.root.overrideAttrs (prev:
|
||||
root = (prev.root.override { stdenv = final.gcc13Stdenv; }).overrideAttrs (prev:
|
||||
{
|
||||
patches = prev.patches or [] ++ [ ./root.patch ];
|
||||
cmakeFlags = prev.cmakeFlags ++ [ "-DCMAKE_CXX_STANDARD=23" ];
|
||||
@@ -70,7 +71,7 @@ in platformConfig //
|
||||
{
|
||||
pkgs-2305 = "nixpkgs-2305";
|
||||
pkgs-2311 = "nixpkgs-2311";
|
||||
pkgs-2411 = "nixpkgs-2411";
|
||||
pkgs-2411 = { source = "nixpkgs-2411"; overlay = inputs.topInputs.bscpkgs.overlays.default; };
|
||||
pkgs-unstable =
|
||||
{
|
||||
source = "nixpkgs-unstable";
|
||||
@@ -114,12 +115,7 @@ in platformConfig //
|
||||
packages = name: import inputs.topInputs.${source.${name}.source or source.${name}}
|
||||
{
|
||||
localSystem = platformConfig.hostPlatform or { inherit (platformConfig) system; };
|
||||
config = cudaConfig //
|
||||
{
|
||||
allowUnfree = true;
|
||||
# contentAddressedByDefault = true;
|
||||
inherit allowInsecurePredicate;
|
||||
};
|
||||
inherit config;
|
||||
overlays = [(source.${name}.overlay or (_: _: {}))];
|
||||
};
|
||||
in builtins.listToAttrs (builtins.map
|
||||
@@ -156,8 +152,11 @@ in platformConfig //
|
||||
{
|
||||
scipy = prev.scipy.overridePythonAttrs (prev:
|
||||
{ disabledTests = prev.disabledTests or [] ++ [ "test_hyp2f1" ]; });
|
||||
rich = prev.rich.overridePythonAttrs (prev:
|
||||
{ disabledTests = prev.disabledTests or [] ++ [ "test_brokenpipeerror" ]; });
|
||||
# paperwork-backend = prev.paperwork-backend.overrideAttrs (prev: { doCheck = false; });
|
||||
})];
|
||||
inherit (final.pkgs-2411) intelPackages_2023;
|
||||
})
|
||||
# // (inputs.lib.optionalAttrs (nixpkgs.march == "silvermont")
|
||||
# { c-blosc = prev.c-blosc.overrideAttrs { doCheck = false; }; })
|
||||
|
||||
70
modules/user/chn/plasma/autostart.nix
Normal file
70
modules/user/chn/plasma/autostart.nix
Normal file
@@ -0,0 +1,70 @@
|
||||
inputs:
|
||||
{
|
||||
config = inputs.lib.mkIf (builtins.elem inputs.config.nixos.model.type [ "desktop" "server" ])
|
||||
{
|
||||
home-manager.users.chn.config.home.file =
|
||||
let
|
||||
programs =
|
||||
{
|
||||
nheko = rec
|
||||
{
|
||||
fileName = "nheko.desktop";
|
||||
path = "${inputs.pkgs.nheko}/share/applications/${fileName}";
|
||||
};
|
||||
kclockd = rec
|
||||
{
|
||||
fileName = "org.kde.kclockd-autostart.desktop";
|
||||
path = "${inputs.pkgs.kdePackages.kdeGear.kclock}/etc/xdg/autostart/${fileName}";
|
||||
};
|
||||
yakuake = rec
|
||||
{
|
||||
fileName = "org.kde.yakuake.desktop";
|
||||
path = "${inputs.pkgs.kdePackages.yakuake}/share/applications/${fileName}";
|
||||
};
|
||||
telegram = rec
|
||||
{
|
||||
fileName = "org.telegram.desktop.desktop";
|
||||
path = inputs.pkgs.writeText fileName (builtins.replaceStrings
|
||||
[ "Exec=telegram-desktop -- %u" ] [ "Exec=telegram-desktop -autostart" ]
|
||||
(builtins.readFile "${inputs.pkgs.telegram-desktop}/share/applications/${fileName}"));
|
||||
};
|
||||
element = rec
|
||||
{
|
||||
fileName = "element-desktop.desktop";
|
||||
path = inputs.pkgs.writeText fileName (builtins.replaceStrings
|
||||
[ "Exec=element-desktop %u" ] [ "Exec=element-desktop --hidden" ]
|
||||
(builtins.readFile "${inputs.pkgs.element-desktop.desktopItem}/share/applications/${fileName}"));
|
||||
};
|
||||
kmail = rec
|
||||
{
|
||||
fileName = "org.kde.kmail2.desktop";
|
||||
path = "${inputs.pkgs.kdePackages.kmail}/share/applications/${fileName}";
|
||||
};
|
||||
discord = rec
|
||||
{
|
||||
fileName = "discord.desktop";
|
||||
path = inputs.pkgs.writeText fileName (builtins.replaceStrings
|
||||
[ "Exec=Discord" ] [ "Exec=Discord --start-minimized" ]
|
||||
(builtins.readFile "${inputs.pkgs.discord.desktopItem}/share/applications/${fileName}"));
|
||||
};
|
||||
crow-translate = rec
|
||||
{
|
||||
fileName = "org.kde.CrowTranslate.desktop";
|
||||
path = "${inputs.pkgs.crow-translate}/share/applications/${fileName}";
|
||||
};
|
||||
};
|
||||
devices =
|
||||
{
|
||||
pc = [ "nheko" "kclockd" "yakuake" "telegram" "element" "kmail" "discord" "crow-translate" ];
|
||||
one = [ "kclockd" "yakuake" "telegram" "element" "kmail" "crow-translate" ];
|
||||
};
|
||||
in builtins.listToAttrs (builtins.map
|
||||
(file:
|
||||
{
|
||||
name = ".config/autostart/${programs.${file}.fileName}";
|
||||
value.source = programs.${file}.path;
|
||||
})
|
||||
(devices.${inputs.config.nixos.model.hostname} or []));
|
||||
environment.persistence."/nix/rootfs/current".users.chn.directories = [ ".config/autostart" ];
|
||||
};
|
||||
}
|
||||
@@ -64,7 +64,7 @@ inputs:
|
||||
};
|
||||
};
|
||||
home.file.".local/share/konsole/Breeze.colorscheme".text = builtins.replaceStrings
|
||||
[ "Opacity=1" ] [ "Opacity=0.9\nBlur=true" ]
|
||||
[ "Opacity=1" ] [ "Opacity=0.8\nBlur=true" ]
|
||||
(builtins.readFile "${inputs.pkgs.libsForQt5.konsole}/share/konsole/Breeze.colorscheme");
|
||||
};
|
||||
environment.persistence."/nix/rootfs/current".users.chn.directories =
|
||||
|
||||
@@ -37,6 +37,7 @@ inputs:
|
||||
padding.value = 4;
|
||||
wobblywindowsEnabled.value = true;
|
||||
};
|
||||
"org.kde.kdecoration2".theme.value = "Klassy";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -125,10 +125,11 @@ inputs: rec
|
||||
blog = inputs.pkgs.callPackage inputs.topInputs.blog { inherit (inputs.topInputs) hextra; };
|
||||
phono3py = inputs.pkgs.python3Packages.callPackage ./phono3py.nix { src = inputs.topInputs.phono3py; };
|
||||
vm = inputs.pkgs.callPackage ./vm { inherit biu; stdenv = inputs.pkgs.clang18Stdenv; };
|
||||
oneapiPackages =
|
||||
oneapiPackages = inputs.pkgs.lib.makeScope inputs.pkgs.newScope (final:
|
||||
{
|
||||
stdenv = inputs.pkgs.callPackage ./oneapi/stdenv.nix { src = inputs.topInputs.self.src.oneapi; };
|
||||
};
|
||||
stdenv = inputs.pkgs.callPackage ./oneapi/stdenv.nix { src = inputs.topInputs.self.src.oneapi; inherit gccFull; };
|
||||
fmt = (inputs.pkgs.fmt.override { inherit (final) stdenv; }).overrideAttrs { doCheck = false; env.VERBOSE = "1"; };
|
||||
});
|
||||
|
||||
fromYaml = content: builtins.fromJSON (builtins.readFile
|
||||
(inputs.pkgs.runCommand "toJSON" {}
|
||||
|
||||
@@ -1,70 +1,87 @@
|
||||
{
|
||||
src, stdenv, autoPatchelfHook, wrapCCWith, config, overrideCC, makeSetupHook, writeScript, overrideInStdenv,
|
||||
runCommand,
|
||||
gcc, glibc, libz, zstd, libxml2, flock, numactl, ncurses, openssl, gmp, kdePackages,
|
||||
libxcrypt-legacy, libfabric, rdma-core, xorg, bash
|
||||
runCommand, lib, gccFull,
|
||||
gcc, glibc, zlib, zstd, libxml2, flock, numactl, ncurses, openssl, gmp, kdePackages,
|
||||
libxcrypt-legacy, libfabric, rdma-core, xorg, bash, p7zip, hwloc
|
||||
}:
|
||||
let
|
||||
oneapi = stdenv.mkDerivation
|
||||
{
|
||||
pname = "oneapi";
|
||||
inherit (src) src version;
|
||||
buildInputs = [];
|
||||
nativeBuildInputs = [ ncurses stdenv.cc.cc autoPatchelfHook ];
|
||||
buildInputs = [ zlib stdenv.cc.cc hwloc ];
|
||||
nativeBuildInputs = [ autoPatchelfHook p7zip ];
|
||||
langFortran = true;
|
||||
dontUnpack = true;
|
||||
dontConfigure = true;
|
||||
dontBuild = true;
|
||||
unpackPhase =
|
||||
''
|
||||
mkdir installer
|
||||
sh ${src.src} --extract-only --extract-folder installer
|
||||
addAutoPatchelfSearchPath installer/intel*/lib
|
||||
autoPatchelf installer/intel*/bootstrapper
|
||||
'';
|
||||
installPhase =
|
||||
let installComponents = builtins.concatStringsSep "\n" (builtins.map
|
||||
(component:
|
||||
''
|
||||
pushd ${component}
|
||||
7za x cupPayload.cup
|
||||
cp -r _installdir/* ../../../../install
|
||||
popd
|
||||
'')
|
||||
src.components);
|
||||
in
|
||||
''
|
||||
mkdir -p $out/install
|
||||
export HOME=$out
|
||||
echo "will install to $out/install"
|
||||
sh installer/intel*/install.sh --silent --eula accept --install-dir $out/install
|
||||
mv $out/install/compiler/${src.version}/{bin,include,lib,share,opt/compiler/include} $out
|
||||
mv $out/bin/compiler/* $out/bin
|
||||
rm -rf $out/install
|
||||
# addAutoPatchelfSearchPath
|
||||
mkdir -p installer install $out
|
||||
sh ${src.src} --extract-only --extract-folder installer
|
||||
pushd installer/intel-oneapi-hpc-toolkit-${src.fullVersion}_offline/packages
|
||||
${installComponents}
|
||||
popd
|
||||
cp -r install/compiler/${src.version}/{bin,include,lib,share} $out
|
||||
cp -r install/{mpi,tbb,umf}/*/lib $out
|
||||
|
||||
# mv $out/bin/compiler/* $out/bin
|
||||
# rm -r $out/bin/compiler
|
||||
# mv $out/bin/clang%2B%2B $out/bin/clang++
|
||||
mv $out/bin/compiler/clang%2B%2B $out/bin/compiler/clang++
|
||||
|
||||
# mv $out/lib/crt/* $out/lib
|
||||
# rm -r $out/lib/crt
|
||||
'';
|
||||
autoPatchelfIgnoreMissingDeps = [];
|
||||
autoPatchelfIgnoreMissingDeps = [ "libze_loader.so.1" "libcuda.so.1" "libhwloc.so.5" ];
|
||||
passthru = { inherit src; };
|
||||
};
|
||||
wrapper = (wrapCCWith
|
||||
{
|
||||
cc = oneapi;
|
||||
extraBuildCommands =
|
||||
''
|
||||
# provide libgcc_s.so but not libgomp.so
|
||||
echo "-L${gcc.cc.libgcc}/lib" >> $out/nix-support/cc-ldflags
|
||||
let
|
||||
gcc = stdenv.cc.cc;
|
||||
gccVersion = builtins.concatStringsSep "." (lib.take 3 (builtins.splitVersion gcc.version));
|
||||
in
|
||||
''
|
||||
echo "-isystem ${oneapi}/include" >> $out/nix-support/cc-cflags
|
||||
echo "-isystem ${oneapi}/include/intel64" >> $out/nix-support/cc-cflags
|
||||
echo "-isystem ${oneapi}/include/icx" >> $out/nix-support/cc-cflags
|
||||
echo "-isystem ${gcc}/include/c++/${gcc.version}/${stdenv.targetPlatform.config}" >> $out/nix-support/cc-cflags
|
||||
echo "-isystem ${gcc}/include/c++/${gcc.version}" >> $out/nix-support/cc-cflags
|
||||
echo "--gcc-toolchain=${stdenv.cc}/lib/gcc/x86_64-unknown-linux-gnu/14.2.1" >> $out/nix-support/cc-cflags
|
||||
echo "-march=${config.oneapiArch}" >> $out/nix-support/cc-cflags-before
|
||||
|
||||
echo "-tp=${config.nvhpcArch}" >> $out/nix-support/cc-cflags-before
|
||||
echo "-L${gcc.lib}/lib" >> $out/nix-support/cc-ldflags
|
||||
echo "-L${gcc}/lib/gcc/${stdenv.targetPlatform.config}/${gccVersion}" >> $out/nix-support/cc-ldflags
|
||||
echo "-L${oneapi}/lib" >> $out/nix-support/cc-ldflags
|
||||
echo "-Lsome_path_does_not_exist" >> $out/nix-support/cc-ldflags
|
||||
|
||||
echo "-noswitcherror" >> $out/nix-support/cc-cflags
|
||||
# echo 'export "PATH=${gcc}/bin:$PATH"' >> $out/nix-support/cc-wrapper-hook
|
||||
|
||||
# print verbose output for debugging
|
||||
# echo "-v" >> $out/nix-support/cc-cflags
|
||||
echo "" > $out/nix-support/add-hardening.sh
|
||||
|
||||
# echo "" > $out/nix-support/add-hardening.sh
|
||||
echo "-v" >> $out/nix-support/cc-cflags
|
||||
|
||||
# substitute -idirafter in libc-cflags
|
||||
# somehow -isystem does not work
|
||||
sed -i 's/-idirafter/-I/g' $out/nix-support/libc-cflags
|
||||
|
||||
for i in nvc nvc++ nvcc nvfortran; do
|
||||
wrap $i $wrapper ${oneapi}/bin/$i
|
||||
done
|
||||
'';
|
||||
for i in icx icpx ifx; do
|
||||
wrap $i $wrapper ${oneapi}/bin/$i
|
||||
done
|
||||
'';
|
||||
}).overrideAttrs (prev: { installPhase = prev.installPhase +
|
||||
''
|
||||
export named_cc=nvc
|
||||
export named_cxx=nvc++
|
||||
export named_fc=nvfortran
|
||||
export named_cc=icx
|
||||
export named_cxx=icpx
|
||||
export named_fc=ifx
|
||||
'';});
|
||||
# in overrideInStdenv (overrideCC stdenv wrapper) [ ]
|
||||
in oneapi
|
||||
in overrideInStdenv (overrideCC stdenv wrapper) [ ]
|
||||
|
||||
Reference in New Issue
Block a user