on master help sign in
ad pin nixpkgs
commit6876fff3bac00c92439bc464a28abf5cb342b4b7 authorHugh JF Chen <hugh.jf.chen@gmail.com> dateSun 19 Apr 2020, 03:40 (7 years ago) parent6e30317
4 files changed+178−2
ci/DevOps/local/test/build/build.sh+2 ci/DevOps/local/test/build/nix/default.nix+160−2 ci/DevOps/local/test/build/nix/nixpkgs+10 ci/DevOps/local/test/build/nix/nixpkgs.template+6
ci/DevOps/local/test/build/build.sh+2
@@ -21,6 +21,8 @@ if [ -f ${SCRIPT_ABS_PATH}/nix/project-m36.nix ]; then
2121 [ -x ~/.emacs.d/bin/doom ] && echo "((nil . ((dante-target . \"project-m36\"))))" > ${SCRIPT_ABS_PATH}/../../../../.dir-locals.el && nix-shell --run "~/.emacs.d/bin/doom env > /dev/null 2>&1" ${SCRIPT_ABS_PATH}/nix/shell.nix
2222 nix-shell ${SCRIPT_ABS_PATH}/nix/shell.nix
2323 else
24+ nix-shell --run "cd ${SCRIPT_ABS_PATH}/../../../../.. ; cabal new-clean ; cabal new-test" ${SCRIPT_ABS_PATH}/nix/shell.nix
25+ nix-shell --run "cd ${SCRIPT_ABS_PATH}/../../../../.. ; cabal new-clean" ${SCRIPT_ABS_PATH}/nix/shell.nix
2426 nix-build -A project-m36-docker ${SCRIPT_ABS_PATH}/nix/default.nix
2527 fi
2628else
ci/DevOps/local/test/build/nix/default.nix+160−2
@@ -39,7 +39,10 @@ let
3939 };
4040 };
4141
42− pkgs = import <nixpkgs> { inherit config; };
42+ pkgs = if builtins.pathExists ./nixpkgs then
43+ import (builtins.fetchGit (import ./nixpkgs)) { inherit config; }
44+ else
45+ import <nixpkgs> { inherit config; };
4346
4447 inherit (pkgs) dockerTools stdenv buildEnv writeText;
4548
@@ -62,6 +65,160 @@ let
6265 hosts: files dns myhostname mymachines
6366 '';
6467
68+
69+ protocols = ''
70+ip 0 IP # internet protocol, pseudo protocol number
71+#hopopt 0 HOPOPT # hop-by-hop options for ipv6
72+icmp 1 ICMP # internet control message protocol
73+igmp 2 IGMP # internet group management protocol
74+ggp 3 GGP # gateway-gateway protocol
75+ipencap 4 IP-ENCAP # IP encapsulated in IP
76+st2 5 ST2 # ST2 datagram mode
77+tcp 6 TCP # transmission control protocol
78+cbt 7 CBT # CBT, Tony Ballardie
79+egp 8 EGP # exterior gateway protocol
80+igp 9 IGP # any private interior gateway
81+bbn-rcc 10 BBN-RCC-MON # BBN RCC Monitoring
82+nvp 11 NVP-II # Network Voice Protocol
83+pup 12 PUP # PARC universal packet protocol
84+argus 13 ARGUS # ARGUS
85+emcon 14 EMCON # EMCON
86+xnet 15 XNET # Cross Net Debugger
87+chaos 16 CHAOS # Chaos
88+udp 17 UDP # user datagram protocol
89+mux 18 MUX # Multiplexing protocol
90+dcn 19 DCN-MEAS # DCN Measurement Subsystems
91+hmp 20 HMP # host monitoring protocol
92+prm 21 PRM # packet radio measurement protocol
93+xns-idp 22 XNS-IDP # Xerox NS IDP
94+trunk-1 23 TRUNK-1 # Trunk-1
95+trunk-2 24 TRUNK-2 # Trunk-2
96+leaf-1 25 LEAF-1 # Leaf-1
97+leaf-2 26 LEAF-2 # Leaf-2
98+rdp 27 RDP # "reliable datagram" protocol
99+irtp 28 IRTP # Internet Reliable Transaction Protocol
100+iso-tp4 29 ISO-TP4 # ISO Transport Protocol Class 4
101+netblt 30 NETBLT # Bulk Data Transfer Protocol
102+mfe-nsp 31 MFE-NSP # MFE Network Services Protocol
103+merit-inp 32 MERIT-INP # MERIT Internodal Protocol
104+dccp 33 DCCP # Datagram Congestion Control Protocol
105+3pc 34 3PC # Third Party Connect Protocol
106+idpr 35 IDPR # Inter-Domain Policy Routing Protocol
107+xtp 36 XTP # Xpress Tranfer Protocol
108+ddp 37 DDP # Datagram Delivery Protocol
109+idpr-cmtp 38 IDPR-CMTP # IDPR Control Message Transport Proto
110+tp++ 39 TP++ # TP++ Transport Protocol
111+il 40 IL # IL Transport Protocol
112+ipv6 41 IPV6 # ipv6
113+sdrp 42 SDRP # Source Demand Routing Protocol
114+ipv6-route 43 IPV6-ROUTE # routing header for ipv6
115+ipv6-frag 44 IPV6-FRAG # fragment header for ipv6
116+idrp 45 IDRP # Inter-Domain Routing Protocol
117+rsvp 46 RSVP # Resource ReSerVation Protocol
118+gre 47 GRE # Generic Routing Encapsulation
119+dsr 48 DSR # Dynamic Source Routing Protocol
120+bna 49 BNA # BNA
121+esp 50 ESP # encapsulating security payload
122+ah 51 AH # authentication header
123+i-nlsp 52 I-NLSP # Integrated Net Layer Security TUBA
124+swipe 53 SWIPE # IP with Encryption
125+narp 54 NARP # NBMA Address Resolution Protocol
126+mobile 55 MOBILE # IP Mobility
127+tlsp 56 TLSP # Transport Layer Security Protocol
128+skip 57 SKIP # SKIP
129+ipv6-icmp 58 IPV6-ICMP icmp6 # ICMP for IPv6
130+ipv6-nonxt 59 IPV6-NONXT # no next header for ipv6
131+ipv6-opts 60 IPV6-OPTS # destination options for ipv6
132+# 61 # any host internal protocol
133+cftp 62 CFTP # CFTP
134+# 63 # any local network
135+sat-expak 64 SAT-EXPAK # SATNET and Backroom EXPAK
136+kryptolan 65 KRYPTOLAN # Kryptolan
137+rvd 66 RVD # MIT Remote Virtual Disk Protocol
138+ippc 67 IPPC # Internet Pluribus Packet Core
139+# 68 # any distributed filesystem
140+sat-mon 69 SAT-MON # SATNET Monitoring
141+visa 70 VISA # VISA Protocol
142+ipcv 71 IPCV # Internet Packet Core Utility
143+cpnx 72 CPNX # Computer Protocol Network Executive
144+cphb 73 CPHB # Computer Protocol Heart Beat
145+wsn 74 WSN # Wang Span Network
146+pvp 75 PVP # Packet Video Protocol
147+br-sat-mon 76 BR-SAT-MON # Backroom SATNET Monitoring
148+sun-nd 77 SUN-ND # SUN ND PROTOCOL-Temporary
149+wb-mon 78 WB-MON # WIDEBAND Monitoring
150+wb-expak 79 WB-EXPAK # WIDEBAND EXPAK
151+iso-ip 80 ISO-IP # ISO Internet Protocol
152+vmtp 81 VMTP # Versatile Message Transport
153+secure-vmtp 82 SECURE-VMTP # SECURE-VMTP
154+vines 83 VINES # VINES
155+ttp 84 TTP # TTP
156+#iptm 84 IPTM # Protocol Internet Protocol Traffic
157+nsfnet-igp 85 NSFNET-IGP # NSFNET-IGP
158+dgp 86 DGP # Dissimilar Gateway Protocol
159+tcf 87 TCF # TCF
160+eigrp 88 EIGRP # Enhanced Interior Routing Protocol
161+ospf 89 OSPFIGP # Open Shortest Path First IGP
162+sprite-rpc 90 Sprite-RPC # Sprite RPC Protocol
163+larp 91 LARP # Locus Address Resolution Protocol
164+mtp 92 MTP # Multicast Transport Protocol
165+ax.25 93 AX.25 # AX.25 Frames
166+ipip 94 IPIP # Yet Another IP encapsulation
167+micp 95 MICP # Mobile Internetworking Control Pro.
168+scc-sp 96 SCC-SP # Semaphore Communications Sec. Pro.
169+etherip 97 ETHERIP # Ethernet-within-IP Encapsulation
170+encap 98 ENCAP # Yet Another IP encapsulation
171+# 99 # any private encryption scheme
172+gmtp 100 GMTP # GMTP
173+ifmp 101 IFMP # Ipsilon Flow Management Protocol
174+pnni 102 PNNI # PNNI over IP
175+pim 103 PIM # Protocol Independent Multicast
176+aris 104 ARIS # ARIS
177+scps 105 SCPS # SCPS
178+qnx 106 QNX # QNX
179+a/n 107 A/N # Active Networks
180+ipcomp 108 IPComp # IP Payload Compression Protocol
181+snp 109 SNP # Sitara Networks Protocol
182+compaq-peer 110 Compaq-Peer # Compaq Peer Protocol
183+ipx-in-ip 111 IPX-in-IP # IPX in IP
184+carp 112 CARP vrrp # Common Address Redundancy Protocol
185+pgm 113 PGM # PGM Reliable Transport Protocol
186+# 114 # any 0-hop protocol
187+l2tp 115 L2TP # Layer Two Tunneling Protocol
188+ddx 116 DDX # D-II Data Exchange
189+iatp 117 IATP # Interactive Agent Transfer Protocol
190+stp 118 STP # Schedule Transfer Protocol
191+srp 119 SRP # SpectraLink Radio Protocol
192+uti 120 UTI # UTI
193+smp 121 SMP # Simple Message Protocol
194+sm 122 SM # SM
195+ptp 123 PTP # Performance Transparency Protocol
196+isis 124 ISIS # ISIS over IPv4
197+fire 125 FIRE
198+crtp 126 CRTP # Combat Radio Transport Protocol
199+crudp 127 CRUDP # Combat Radio User Datagram
200+sscopmce 128 SSCOPMCE
201+iplt 129 IPLT
202+sps 130 SPS # Secure Packet Shield
203+pipe 131 PIPE # Private IP Encapsulation within IP
204+sctp 132 SCTP # Stream Control Transmission Protocol
205+fc 133 FC # Fibre Channel
206+rsvp-e2e-ignore 134 RSVP-E2E-IGNORE # Aggregation of RSVP for IP reservations
207+mobility-header 135 Mobility-Header # Mobility Support in IPv6
208+udplite 136 UDPLite # The UDP-Lite Protocol
209+mpls-in-ip 137 MPLS-IN-IP # Encapsulating MPLS in IP
210+manet 138 MANET # MANET Protocols
211+hip 139 HIP # Host Identity Protocol
212+shim6 140 SHIM6 # Shim6 Protocol
213+wesp 141 WESP # Wrapped Encapsulating Security Payload
214+rohc 142 ROHC # Robust Header Compression
215+# 138-254 # Unassigned
216+pfsync 240 PFSYNC # PF Synchronization
217+# 253-254 # Use for experimentation and testing
218+# 255 # Reserved
219+divert 258 DIVERT # Divert pseudo-protocol
220+'';
221+
65222 project-m36-conf = ''
66223 para1 = "$(PARA1)"
67224 para2 = "$(PARA2)"
@@ -76,6 +233,7 @@ let
76233 echo '${project-m36-conf}' > $out/etc/project-m36/project-m36.conf
77234 echo '${passwd}' > $out/etc/passwd
78235 echo '${group}' > $out/etc/group
236+ echo '${protocols}' > $out/etc/ptotocols
79237 echo '${nsswitch}' > $out/etc/nsswitch.conf
80238 '';
81239 };
@@ -92,7 +250,7 @@ let
92250 "PARA2="
93251 ];
94252 User = "project-m36";
95− Cmd = [ "${static-project-m36}/bin/project-m36" "/etc/project-m36/project-m36.conf" ];
253+ Cmd = [ "${static-project-m36}/bin/project-m36-server" ];
96254 ExposedPorts = {
97255 "5432/tcp" = {};
98256 };
ci/DevOps/local/test/build/nix/nixpkgsnew file+10
@@ -0,0 +1,10 @@
1+# nixpkgs-19.09 at 2020-04-05T15:13:59Z
2+{
3+ # Descriptive name to make the store path easier to identify
4+ name = "nixos-19.09-2020-04-05";
5+ url = "https://github.com/nixos/nixpkgs-channels/";
6+ # Commit hash for nixos-19.09 as of 2020-04-05
7+ # `git ls-remote https://github.com/nixos/nixpkgs-channels nixos-unstable`
8+ ref = "refs/heads/nixos-19.09";
9+ rev = "f6c1d3b113ce9e7c908991df2e8eed02f03df1bc";
10+}
ci/DevOps/local/test/build/nix/nixpkgs.templatenew file+6
@@ -0,0 +1,6 @@
1+nixpkgs = fetchFromGitHub {
2+ owner = "NixOS";
3+ repo = "nixpkgs-channels";
4+ rev = "2f6440eb09b7e6e3322720ac91ce7e2cdeb413f9";
5+ sha256 = "0vb7ikjscrp2rw0dfw6pilxqpjm50l5qg2x2mn1vfh93dkl2aan7";
6+};